/*
 * Ray Light Reading - Reserve System CSS
 * Design: Premium, Elegant, Responsive
 */

:root {
    --primary-color: #f8f9fa;
    --accent-color: #d4af37;
    /* Gold */
    --text-color: #333;
    --bg-overlay: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.3);
    --success-color: #28a745;
    --secondary-color: #0077b6;
    /* Ocean/Sky Blue */
    --error-color: #dc3545;
    --font-main: 'Outfit', 'Inter', 'Noto Sans JP', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    /* 背景画像は別途設定される想定だが、ベースのグラデーションを用意 */
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    min-height: 100vh;
}

.reserve-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
}

h1,
h2 {
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--accent-color);
}

/* Calendar Implementation */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav-btn {
    background: none;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-nav-btn:hover {
    background: var(--accent-color);
    color: white;
}

#current-month {
    margin: 0;
    font-size: 1.4em;
    font-weight: 300;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    text-align: center;
    font-weight: bold;
    color: #888;
    font-size: 0.8em;
    margin-bottom: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.calendar-day {
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    font-size: 0.9em;
}

.calendar-day:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    border-color: var(--accent-color);
}

.calendar-day.selected {
    background: var(--accent-color);
    color: white;
}

.calendar-day.disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
}

/* Time Slot Selection */
.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.time-slot {
    padding: 10px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot:hover:not(.disabled) {
    background: var(--accent-color);
    color: white;
}

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

.time-slot.disabled {
    border-color: #eee;
    color: #ccc;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* 予約済みスロットの表示 */
.time-slot.reserved {
    color: #c62828;
    /* 深い赤 */
    background-color: #fff;
    /* 背景は白 */
    /* 左上から右下へ一本だけ赤い斜線を引く (太さを半分に調整) */
    /* ※30度方向のグラデーションにすることで、対角線上の「\」を描画します */
    background-image: linear-gradient(26deg, transparent 48%, #c62828 48%, #c62828 52%, transparent 52%);
    border-color: #ef9a9a;
    cursor: not-allowed;
    text-decoration: none;
}

.time-slot.reserved:hover {
    background-color: #f9f9f9;
    border-color: #eee;
    transform: none;
    box-shadow: none;
}

/* Form Styling */
.reserve-form {
    display: none;
    /* 初期は非表示 */
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #666;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* プレースホルダー（入力例）の色を薄く設定 */
::placeholder {
    color: #ccc !important;
    opacity: 1;
    /* ブラウザによる透過を防ぐ */
}

/* IEなどの互換性用 */
:-ms-input-placeholder {
    color: #ccc !important;
}

::-ms-input-placeholder {
    color: #ccc !important;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: opacity 0.3s;
    margin-top: 30px;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* Steps & Course Selection */
.step-section {
    margin-bottom: 40px;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* 左揃え */
    font-size: 1.2em;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
}

.step-badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 10px;
    font-weight: 500;
    vertical-align: middle;
}

.course-options {
    margin-bottom: 2rem;
}

.course-select {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    /* ブラウザ標準の矢印を消す場合 */
    /* カスタム矢印を追加する場合はここにbackground-image等を入れる */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

.course-select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.course-option.selected .course-check {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: white;
}

.course-info {
    display: flex;
    flex-direction: column;
}

.course-title {
    font-weight: 500;
    font-size: 1.1em;
    color: var(--text-color);
}

.course-desc {
    font-size: 0.85em;
    color: #888;
}

/* Mobile Adjustments */
/* Confirmation Modal */
/* Inline Confirmation View */
#confirmation-screen {
    display: none;
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

#confirmation-screen .modal-content {
    background: white;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--accent-color);
    box-sizing: border-box;
}

.booking-disabled {
    pointer-events: none;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: opacity 0.5s ease, filter 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.modal-open {
    overflow: hidden;
}

/* Success View */
#success-screen {
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.success-box {
    background: #f0f7f7;
    /* ソフトブルー */
    border: 1px solid var(--secondary-color);
    color: #2c3e50;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.1);
}

.success-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.success-message {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.success-reservation-no {
    display: inline-block;
    background: white;
    padding: 15px 30px;
    border-radius: 12px;
    border: 2px dashed var(--secondary-color);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    letter-spacing: 0.1em;
}

.confirmation-summary {
    background: #fdfaf5;
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 4px;
}

.summary-value {
    font-weight: 500;
    font-size: 1.1em;
    color: var(--text-color);
}

.confirm-controls {
    display: flex;
    gap: 15px;
    margin-top: 2rem;
}

.back-btn {
    flex: 1;
    padding: 15px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #e0e0e0;
}

.confirm-btn-final {
    flex: 2;
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: opacity 0.3s;
}

.confirm-btn-final:hover {
    opacity: 0.9;
}

@media (max-width: 600px) {
    .calendar-day {
        padding: 5px 2px;
        font-size: 0.8em;
    }

    .confirm-controls {
        flex-direction: column-reverse;
        /* スマホでは上下並び（確定ボタンを上に） */
    }
}

.home-btn {
    display: inline-block;
    padding: 12px 40px;
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 30px;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
}

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

/* 上部ナビゲーション */
.nav-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
}

.nav-home-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
}