/**
 * 予約カレンダー - カード型UI スタイルシート
 * URBAN CLASSIC PILATES 予約システム用
 */

/* ================================================
   モーダルオーバーレイとコンテナ
   ================================================ */

.reservation-modal-overlay {
    display: none; /* 初期状態は非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.reservation-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.reservation-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

/* ================================================
   モーダルヘッダー
   ================================================ */

.reservation-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 100;
}

.reservation-modal-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: #333333;
    margin: 0 0 8px;
}

.reservation-modal-header p {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

.reservation-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #666666;
    transition: all 0.2s ease;
}

.reservation-modal-close:hover {
    background: #e0e0e0;
    color: #333333;
    transform: rotate(90deg);
}

/* ================================================
   モーダルボディ
   ================================================ */

.reservation-modal-body {
    padding: 24px;
}

/* ================================================
   日付カード一覧
   ================================================ */

.reservation-date-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reservation-date-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}

.reservation-date-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #cccccc;
}

/* 日付カードヘッダー */
.reservation-date-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.reservation-date-card.expanded .reservation-date-header {
    background: linear-gradient(135deg, #5568d3 0%, #6340a0 100%);
}

.reservation-date-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.reservation-date-weekday {
    font-size: 14px;
    opacity: 0.9;
    margin-left: 12px;
}

.reservation-date-toggle {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.reservation-date-card.expanded .reservation-date-toggle {
    transform: rotate(180deg);
}

/* 時間スロット一覧 */
.reservation-time-slots {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 20px;
    background: #fafafa;
}

.reservation-date-card.expanded .reservation-time-slots {
    max-height: 800px;
    padding: 20px;
}

.reservation-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* ================================================
   時間スロットボタン
   ================================================ */

.reservation-time-button {
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.reservation-time-button:hover:not(:disabled) {
    border-color: #667eea;
    background: #f0f3ff;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* 選択状態 */
.reservation-time-button.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.reservation-time-button.selected::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 16px;
    font-weight: bold;
}

/* 無効状態（予約済み） */
.reservation-time-button:disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #999999;
    cursor: not-allowed;
    opacity: 0.6;
}

.reservation-time-button:disabled::before {
    content: "×";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #cccccc;
    font-weight: bold;
}

/* 第1希望で選択済み（第2希望で無効化） */
.reservation-time-button.disabled-by-first-hope {
    background: #fff5f5;
    border-color: #ffcccc;
    color: transparent; /* 元のテキストを透明にして非表示 */
    cursor: not-allowed;
    opacity: 0.7;
}

.reservation-time-button.disabled-by-first-hope::before {
    content: "第1希望";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #cc6666;
    font-weight: bold;
    white-space: nowrap;
}

/* 第2希望で選択済み（第1希望で無効化） */
.reservation-time-button.disabled-by-second-hope {
    background: #f5f5ff;
    border-color: #ccccff;
    color: transparent; /* 元のテキストを透明にして非表示 */
    cursor: not-allowed;
    opacity: 0.7;
}

.reservation-time-button.disabled-by-second-hope::before {
    content: "第2希望";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #6666cc;
    font-weight: bold;
    white-space: nowrap;
}

/* ================================================
   モーダルフッター（確定ボタン）
   ================================================ */

.reservation-modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #f0f0f0;
    background: #ffffff;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.reservation-confirm-button {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.reservation-confirm-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.reservation-confirm-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.reservation-confirm-button:disabled:hover {
    transform: none;
}

/* ================================================
   選択表示エリア
   ================================================ */

.reservation-selected-display {
    margin-bottom: 16px;
    padding: 16px;
    background: #f0f3ff;
    border-radius: 8px;
    border: 2px solid #667eea;
    text-align: center;
}

.reservation-selected-label {
    font-size: 14px;
    color: #666666;
    margin-bottom: 8px;
    display: block;
}

.reservation-selected-datetime {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.reservation-selected-display.empty {
    display: none;
}

/* ================================================
   レスポンシブデザイン
   ================================================ */

/* タブレット */
@media (max-width: 768px) {
    .reservation-modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .reservation-modal-header h2 {
        font-size: 20px;
    }

    .reservation-date-title {
        font-size: 16px;
    }

    .reservation-time-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .reservation-time-button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* スマートフォン */
@media (max-width: 480px) {
    .reservation-modal-overlay.active {
        padding: 0;
        align-items: flex-end;
    }

    .reservation-modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }

    .reservation-modal-header {
        padding: 20px 16px 12px;
    }

    .reservation-modal-header h2 {
        font-size: 18px;
    }

    .reservation-modal-header p {
        font-size: 12px;
    }

    .reservation-modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: 16px;
        right: 16px;
    }

    .reservation-modal-body {
        padding: 16px;
    }

    .reservation-date-cards {
        gap: 16px;
    }

    .reservation-date-header {
        padding: 12px 16px;
    }

    .reservation-date-title {
        font-size: 15px;
    }

    .reservation-date-weekday {
        font-size: 12px;
        margin-left: 8px;
    }

    .reservation-time-slots {
        padding: 0 16px;
    }

    .reservation-date-card.expanded .reservation-time-slots {
        padding: 16px;
    }

    .reservation-time-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .reservation-time-button {
        padding: 12px 8px;
        font-size: 14px;
    }

    .reservation-modal-footer {
        padding: 16px;
    }

    .reservation-confirm-button {
        padding: 14px 24px;
        font-size: 16px;
    }

    .reservation-selected-datetime {
        font-size: 18px;
    }
}

/* ================================================
   アクセシビリティ
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .reservation-modal-content,
    .reservation-time-button,
    .reservation-confirm-button,
    .reservation-date-toggle {
        animation: none;
        transition: none;
    }
}

/* フォーカス時のアウトライン */
.reservation-time-button:focus,
.reservation-confirm-button:focus,
.reservation-modal-close:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* 2025-10-28　追加 */
.admissionArea table button {
    background-color: #f66389 !important;
    background-image: none !important;
}
.reservation-date-header {
    background-color: #eaeaeb;
    background-image: none;
}
.reservation-date-card.expanded .reservation-date-header {
    background-color: #f66389;
    background-image: none;
}
.reservation-date-card.expanded .reservation-date-header .reservation-date-title,
.reservation-date-card.expanded .reservation-date-header .reservation-date-weekday,
.reservation-date-card.expanded .reservation-date-toggle {
    color: #fff;
}
.reservation-time-button:hover:not(:disabled) {
    border-color: #f66389;
    background: #fff;
    color: #f66389;
}
.reservation-time-button:focus,
.reservation-confirm-button:focus,
.reservation-modal-close:focus {
    outline: 3px solid #f66389;
}
.reservation-time-button.selected {
    background-image: none;
    color: #f66389;
    border-color: #f66389;;
}
.reservation-confirm-button {
    background-image: linear-gradient(0deg,#fadbaa,#f39801,#f39801,#fadbaa);
    border: 1px solid #f39800;
}
.reservation-confirm-button:disabled {
    border: 1px solid #ccc;
}