:root {
  --primary-color: #ff9a9e;
  --primary-light: #ffcccb;
  --primary-dark: #e57373;
  --secondary-color: #4a90e2;
  --secondary-light: #64b5f6;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --medium-gray: #ddd;
  --dark-gray: #999;
  --error-color: #f44336;
  --success-color: #4caf50;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--light-gray);
  color: var(--text-color);
}

.container {
  max-width: 900px;
  margin: 20px auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.header {
  background-color: var(--primary-color);
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
}

.header h1 {
  margin: 0;
  font-size: 2em;
}

.header p {
  margin: 10px 0 0;
  font-size: 1.1em;
}

.content {
  padding: 30px;
}

/* タブ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--medium-gray);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  border-bottom-color: var(--primary-color);
  font-weight: bold;
}

/* 料金表 */
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: white;
  box-shadow: var(--box-shadow);
  border-radius: 8px;
  overflow: hidden;
}

.price-table th, .price-table td {
  padding: 12px 15px;
  text-align: center;
  border: 1px solid var(--medium-gray);
}

.price-table th {
  background-color: var(--primary-light);
  font-weight: bold;
}

.price-table tr:nth-child(even) {
  background-color: var(--light-gray);
}

.price-note {
  font-size: 0.9em;
  color: var(--dark-gray);
  margin: 10px 0;
}

/* 予約フォーム */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  font-size: 16px;
}

/* 日付選択部分のスタイリング */
.date-input-container {
  position: relative;
  margin-bottom: 10px;
}

.date-helper-text {
  margin-top: 5px;
  font-size: 0.9em;
  color: var(--dark-gray);
  display: flex;
  align-items: center;
}

.calendar-icon {
  font-size: 1.2em;
  margin-right: 6px;
  display: none; /* アイコンを非表示に */
}

/* カスタムカレンダーボタン */
.calendar-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background-color: transparent; /* 背景を透明に */
  border: none; /* ボーダーも削除 */
  cursor: pointer;
  z-index: 10;
  display: none; /* 完全に非表示 */
}

.calendar-button:hover {
  /* ホバー効果も削除 */
}

/* カスタムカレンダーパネル */
.calendar-panel {
  display: none;
  position: absolute;
  z-index: 100;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 300px;
  padding: 15px;
  margin-top: 5px;
  left: 0;
  top: 50px;
}

.calendar-panel.show {
  display: block;
  animation: fadeIn 0.3s;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-header button {
  background: none;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 4px;
}

.calendar-header button:hover {
  background-color: var(--light-gray);
}

#currentMonth {
  font-weight: bold;
  font-size: 1.1em;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 5px;
}

.weekdays div {
  text-align: center;
  font-weight: bold;
  color: var(--dark-gray);
  font-size: 0.9em;
  padding: 5px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  text-align: center;
  padding: 10px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-day:hover {
  background-color: var(--light-gray);
}

.calendar-day.today {
  background-color: var(--secondary-light);
  color: white;
  font-weight: bold;
}

.calendar-day.selected {
  background-color: var(--secondary-color);
  color: white;
  font-weight: bold;
}

.calendar-day.disabled {
  color: var(--medium-gray);
  cursor: not-allowed;
  text-decoration: line-through;
}

.calendar-day.other-month {
  color: var(--medium-gray);
  opacity: 0.5;
}

/* 日付入力フィールドをカスタマイズ */
input[type="date"] {
  cursor: pointer;
  position: relative;
  padding-right: 35px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* カスタム日付表示 */
.custom-date-display {
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  padding: 8px 12px;
  width: 100%;
  background-color: white;
  cursor: pointer;
  font-family: sans-serif;
  transition: all 0.2s;
  /* カレンダーボタンが非表示の場合の右側スペース調整 */
  padding-right: 35px;
  position: relative;
}

/* 疑似要素でカレンダーを表す小さな三角形を追加 */
.custom-date-display::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #666;
}

.custom-date-display:hover {
  background-color: var(--light-gray);
  border-color: var(--secondary-color);
}

/* ネイティブカレンダーピッカーを非表示にする */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-inner-spin-button {
  display: none;
  opacity: 0;
}

input[type="date"]::-webkit-clear-button {
  display: none;
}

/* カレンダービュー */
.calendar-view {
  margin-bottom: 20px;
}

.date-selector {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.date-display {
  margin: 0 15px;
  font-weight: bold;
}

.date-nav-btn {
  background-color: transparent;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.date-nav-btn:hover {
  background-color: var(--light-gray);
}

/* タイムスロット選択 */
.time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.time-slot {
  border: 1px solid var(--medium-gray);
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1 0 calc(20% - 10px);
  max-width: calc(20% - 10px);
  min-width: 100px;
  position: relative;
}

.time-slot:hover {
  background-color: #f0f7ff;
  border-color: var(--secondary-color);
}

.time-slot.selected {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.time-slot.selected::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  font-weight: bold;
}

.time-slot.booked {
  background-color: #f9d7d7;
  color: #9a3838;
  border-color: #e0b2b2;
  cursor: not-allowed;
  text-decoration: line-through;
}

.time-slot.blocked {
  background-color: #e0e0e0;
  color: #727272;
  border-color: #c0c0c0;
  cursor: not-allowed;
  position: relative;
  overflow: hidden;
}

.time-slot.blocked::before {
  content: "管理者設定";
  position: absolute;
  font-size: 8px;
  background: #666;
  color: white;
  top: 0;
  right: 0;
  padding: 2px 4px;
  transform: rotate(0);
  transform-origin: top right;
}

.time-slot.blocked:after {
  content: "✕";
  position: absolute;
  font-size: 16px;
  color: rgba(114, 114, 114, 0.5);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.time-slot.unavailable {
  cursor: not-allowed;
}

/* ボタン */
.btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: block;
  width: 100%;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: var(--secondary-light);
}

.btn-outline {
  background-color: transparent;
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
}

.btn-outline:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* 確認メッセージ */
.confirmation {
  background-color: #e6f7e6;
  border: 1px solid #c3e6c3;
  border-radius: 4px;
  padding: 20px;
  margin-top: 20px;
  display: none;
  position: relative;
  overflow: hidden;
}

.confirmation h3 {
  margin-top: 0;
  color: var(--success-color);
}

.confirmation.show-with-animation p {
  opacity: 0;
  animation: slideInRight 0.5s forwards;
}

.confirmation.show-with-animation p:nth-child(1) { animation-delay: 0.1s; }
.confirmation.show-with-animation p:nth-child(2) { animation-delay: 0.2s; }
.confirmation.show-with-animation p:nth-child(3) { animation-delay: 0.3s; }
.confirmation.show-with-animation p:nth-child(4) { animation-delay: 0.4s; }
.confirmation.show-with-animation p:nth-child(5) { animation-delay: 0.5s; }
.confirmation.show-with-animation p:nth-child(6) { animation-delay: 0.6s; }

.success-icon {
  text-align: center;
  margin-bottom: 15px;
  color: var(--success-color);
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 紙吹雪エフェクト */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 8px;
  background-color: #f0f0f0;
  animation: confetti-fall linear forwards;
  opacity: 0.8;
  border-radius: 2px;
  transform: rotate(15deg);
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* スタジオ情報 */
.studio-info {
  background-color: #f8f8f8;
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
}

.studio-info h3 {
  margin-top: 0;
  color: var(--primary-dark);
}

/* ラジオボタンとチェックボックスのスタイリング */
.radio-group, .checkbox-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-item, .checkbox-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.radio-item input, .checkbox-item input {
  margin-right: 8px;
  width: auto;
}

/* 価格表示 */
.price-display {
  font-size: 1.2em;
  font-weight: bold;
  text-align: right;
  margin: 20px 0;
}

/* エラーメッセージ */
.error-message {
  color: var(--error-color);
  font-size: 0.9em;
  margin-top: 5px;
}

/* アニメーション */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes highlight {
  0% { background-color: var(--secondary-light); }
  100% { background-color: var(--secondary-color); }
}

/* 時間枠選択アニメーション */
.time-slot.selected {
  animation: highlight 0.3s ease-out;
}

.time-slot:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

/* 料金表示アニメーション */
.price-display.updated {
  animation: pulse 0.5s ease-out;
}

/* 確認メッセージアニメーション */
.confirmation {
  animation: fadeIn 0.8s ease-out;
}

.confirmation h3 {
  animation: slideInRight 0.5s ease-out;
}

.confirmation p {
  animation: slideInRight 0.5s ease-out;
  animation-delay: calc(var(--animation-order, 0) * 0.1s);
}

/* 送信ボタンアニメーション */
.btn:active {
  transform: scale(0.98);
}

.btn.submitting {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.btn.submitting::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 300%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* 日付ナビゲーションアニメーション */
.date-display.changing {
  animation: fadeIn 0.3s ease-out;
}

/* エラーモーダル */
.error-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.error-modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: slideInUp 0.3s;
}

.error-modal-content h3 {
  color: var(--error-color);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

.error-modal-content p {
  color: #333;
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.5;
  background-color: #fff5f5;
  padding: 10px;
  border-radius: 4px;
  border-left: 3px solid var(--error-color);
}

.error-modal-content .btn {
  max-width: 150px;
  margin: 0 auto;
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 0;
  }
  
  .time-slot {
    flex: 1 0 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
  }
}

@media (max-width: 480px) {
  .content {
    padding: 15px;
  }
  
  .time-slot {
    flex: 1 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
  
  .radio-group, .checkbox-group {
    flex-direction: column;
    gap: 10px;
  }
}

/* 当日予約警告スタイル */
.same-day-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
  font-weight: bold;
}

.same-day-warning a {
  color: #0056b3;
  text-decoration: underline;
}

.same-day-warning p {
  margin: 5px 0;
}

/* 無効化された予約ボタンのスタイル */
button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #cccccc;
  color: #666666;
  border-color: #bbbbbb;
}

/* 管理者アイコンスタイル */
.admin-icon-container {
  position: absolute;
  top: 15px;
  right: 15px;
}

.admin-icon {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s;
}

.admin-icon:hover {
  color: rgba(255, 255, 255, 0.9);
}

.admin-icon svg {
  width: 18px;
  height: 18px;
}
