/* ミーティング予約カレンダー用CSS */

/* カレンダーフィールド */
.calendar-field {
  margin-bottom: 20px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

/* カレンダーコンテナ */
.calendar-container {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 350px;
}

/* カレンダーヘッダー（月切替） */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.calendar-title {
  font-weight: bold;
  font-size: 1rem;
}
.calendar-nav {
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 1rem;
}
.calendar-nav:hover {
  background: #e0e0e0;
}
.calendar-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 曜日ヘッダー */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 5px;
}
.calendar-weekdays span:first-child { color: #e74c3c; } /* 日 */
.calendar-weekdays span:last-child { color: #3498db; }  /* 土 */

/* 日付グリッド */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

/* 日付セル */
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 4px;
  position: relative;
  cursor: default;
}
.calendar-day.empty {
  background: transparent;
}
.calendar-day.sun .day-num { color: #e74c3c; }
.calendar-day.sat .day-num { color: #3498db; }
/* 過去・予約不可は薄字 */
.calendar-day.past,
.calendar-day.unavailable {
  opacity: 0.4;
}

/* 予約可能マーク */
.calendar-day .status {
  font-size: 0.7rem;
  margin-top: 2px;
}

/* ○空きあり: 青の枠線 */
.calendar-day.available {
  border: 2px solid #2196f3;
  cursor: pointer;
}
.calendar-day.available:hover {
  background: #e3f2fd;
}
.calendar-day.available .status {
  color: #1565c0;
}

/* △一部空き: 緑の枠線 */
.calendar-day.partial {
  border: 2px solid #4caf50;
  cursor: pointer;
}
.calendar-day.partial:hover {
  background: #f1f8e9;
}
.calendar-day.partial .status {
  color: #2e7d32;
}

/* 出張MTG: 黄色の枠線（二重線で強調） */
.calendar-day.trip {
  border: 2px solid #ff9800 !important;
}
.calendar-day.trip:hover {
  background: #fff8e1 !important;
}

/* カレンダー凡例 */
.calendar-legend {
  margin: 0 0 10px 0;
  padding: 0 0 0 1.2em;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.8;
}
.calendar-legend li {
  margin: 0;
}

/* 選択結果表示 */
.selection-display {
  margin-top: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
}
.selection-title {
  margin: 0 0 10px 0;
  font-weight: bold;
  font-size: 0.95rem;
}
.selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.selection-item {
  display: flex;
  align-items: flex-start;
  padding: 8px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
}
.selection-label {
  width: 70px;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
}
.selection-value {
  flex: 1;
  line-height: 1.5;
}
.selection-value.empty {
  color: #999;
}
.selection-clear {
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: 10px;
  white-space: nowrap;
  align-self: flex-start;
}
.selection-clear:hover {
  text-decoration: underline;
}

/* 時間帯選択ポップアップ */
.time-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.time-popup.hidden {
  display: none;
}
.time-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}
.time-popup-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  min-width: 280px;
  max-width: 90%;
}
.time-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.time-popup-title {
  font-weight: bold;
  font-size: 1.1rem;
}
.time-popup-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
}
.time-popup-close:hover {
  color: #333;
}
.time-popup-body {
  text-align: center;
}
.time-popup-date {
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.time-popup-warning {
  color: #e74c3c;
  font-weight: bold;
  margin-bottom: 10px;
}
.time-popup-warning.hidden {
  display: none;
}
.time-popup-urgent {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px;
  font-size: 0.9rem;
  margin-bottom: 15px;
  text-align: left;
}
.time-popup-urgent.hidden {
  display: none;
}

/* 時間帯選択行 */
.time-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}
.time-slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.time-slot-row.disabled {
  opacity: 0.4;
}
.time-slot-label {
  font-size: 1rem;
  color: #333;
}

/* チェックボックス風ボタン（立体的な正方形） */
.time-slot-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  transition: all 0.1s;
  border-radius: 3px;
  flex-shrink: 0;

  /* 立体的なデザイン */
  background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
  border-style: solid;
  border-width: 3px;
  border-top-color: #fff;
  border-left-color: #eee;
  border-bottom-color: #888;
  border-right-color: #999;
  box-shadow:
    0 3px 6px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.time-slot-btn:hover {
  background: linear-gradient(180deg, #eee, #d8d8d8);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.time-slot-btn:active {
  background: linear-gradient(180deg, #d8d8d8, #ccc);
  border-top-color: #888;
  border-left-color: #999;
  border-bottom-color: #fff;
  border-right-color: #eee;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  transform: translateY(2px);
}
.time-slot-btn:disabled {
  cursor: not-allowed;
  box-shadow: none;
}
.time-slot-btn:disabled:hover {
  background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
  transform: none;
}

/* 個人情報セクション区切り線 */
.personal-section-divider {
  margin: 30px 0 20px 0;
}
.personal-section-divider h3 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 4px solid #636363;
  font-size: 1.1rem;
  color: #636363;
}

/* ラジオボタン・チェックボックスを1行ずつ表示 */
.field-input label {
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}
.field-input label:last-child {
  margin-bottom: 0;
}
.field-input input[type="radio"],
.field-input input[type="checkbox"] {
  margin-right: 8px;
}

/* 条件分岐フィールドのアニメーション */
.field[data-show-if] {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

/* カレンダーフィールドのアニメーション */
.calendar-field {
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .calendar-container {
    max-width: 100%;
  }
  .time-popup-content {
    padding: 15px;
  }
  .time-slot-btn {
    padding: 10px 18px;
  }
}
