:root {
    --primary-black: #000000;
    --text-muted: #888888;
    --bg-white: #ffffff;
    --accent-tan: #a19480;
    --border-color: #f0f0f0;
    --safe-area: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-white);
    color: var(--primary-black);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
    /* Optional: prevents "layout shift" if the scrollbar disappears */
    padding-right: 15px;
}

.calendar-app {
    scroll-margin-top: 58px;
    padding: 50px 0;
}

/* --- STICKY HEADER --- */
.calendar-nav {
    position: relative;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    align-items: center;
    max-width: 1100px; /* Slightly wider for desktop breathing room */
    margin: 0 auto;
    padding: 0 var(--safe-area);
}

/* --- DATE BAR --- */
.days-container {
    display: flex;
    gap: 12px;
    flex-grow: 1;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px 0;
}
.days-container::-webkit-scrollbar { display: none; }

.day-item {
    flex: 0 0 auto;
    text-align: center;
    min-width: 70px;
    padding: 12px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s ease;
}

.day-item.active { background: var(--primary-black); color: #fff; }
.day-item .date-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.day-item .day-name { display: block; font-size: 16px; font-weight: 400; }

.nav-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 10px 15px;
    cursor: pointer;
}
.nav-btn.disabled { opacity: 0.1; cursor: not-allowed; }

/* --- SCHEDULE GRID (MOBILE FIRST) --- */
.schedule-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px var(--safe-area);
}

.schedule-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Increased gap between vertical elements for a more spread look */
    gap: 12px;
    padding: 30px 0; /* More padding between rows */
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.col-time {
    grid-column: 1;
}
.col-time strong {
    font-size: 0.95rem;
    display: block;
}
.col-time span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.col-location {
    grid-column: 2;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.col-class {
    grid-column: 1 / span 2;
    font-size: 1rem; /* Slightly larger for emphasis on mobile */
    font-weight: 700;
    margin-top: 5px;
    letter-spacing: 0.5px;
    text-align: center; /* Centered title for a spread look */
}

.col-trainer {
    grid-column: 1 / span 2;
    /*font-size: 0.8rem;*/
    font-family: "Noto Sans Armenian", Sylfaen, sans-serif;
    font-weight: bold;
    font-size: 12px;
    color: var(--accent-tan);
    text-align: center; /* Centered trainer name */
    margin-bottom: 5px;
}

.col-type {
    grid-column: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.col-status {
    grid-column: 2;
    text-align: right;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Updated Action and Button for Bottom Center @ 80% width */
.col-action {
    grid-column: 1 / span 2;
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.btn-book {
    background: var(--accent-tan);
    color: #fff;
    border: none;
    padding: 14px 0; /* Vertical padding */
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    width: 80%; /* Requested width */
}
.btn-book.secondary { background: #b5ada3; }

/* --- DESKTOP LAYOUT (768px+) --- */
/* Your existing desktop styles remain the same and will override these centerings */
@media (min-width: 768px) {
    .days-container {
        justify-content: center;
    }

    .schedule-row {
        grid-template-columns: 0.8fr 1.2fr 1.8fr 1.5fr 0.8fr 1.2fr 1fr;
        align-items: center;
        gap: 20px;
        padding: 25px 0;
    }

    .col-time, .col-location, .col-class, .col-trainer, .col-type, .col-status, .col-action {
        grid-column: auto;
        text-align: left;
        margin: 0;
    }

    .col-class { font-size: 0.9rem; text-align: left; }
    .col-trainer { text-align: left; }
    .col-status { margin-top: 0; display: block; text-align: left; }
    .col-action { text-align: right; display: block; }

    .btn-book {
        width: 110px; /* Reset width for desktop */
        padding: 10px 20px;
    }
}

.pagination-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 40px 0;
}

.page-btn {
    border: 1px solid var(--border-color);
    background: white;
    color: var(--primary-black);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none !important;
}

.page-btn.active {
    background: var(--primary-black);
    color: white;
    border-color: var(--primary-black);
}

.page-btn:hover:not(.active) {
    background: var(--border-color);
}


/* --- MODAL STYLES --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-white);
    width: 90%;
    max-width: 400px; /* Default for mobile */
    padding: 40px 30px;
    border-radius: 8px;
    position: relative;
    text-align: center;
    text-transform: uppercase;
    transition: max-width 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content h3 { margin-bottom: 10px; font-size: 1.1rem; letter-spacing: 1px; }
.modal-content p { margin-bottom: 30px; font-size: 0.8rem; color: var(--accent-tan); }

/* Form Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 15px;
}

.form-group { text-align: left; }
.form-group label { display: block; font-size: 0.65rem; font-weight: 700; margin-bottom: 8px; color: var(--text-muted); }

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
}

/* Updated Button: Matches regular BOOK button color */
.btn-book-submit {
    background: var(--accent-tan); /* Matches btn-book */
    color: #fff;
    border: none;
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 25px;
    transition: opacity 0.3s;
}

.btn-book-submit:hover { opacity: 0.9; }
.btn-book-submit:disabled { background: #b5ada3; cursor: not-allowed; }

/* --- SIMPLIFIED SUCCESS VIEW STYLES --- */
.success-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.success-svg {
    width: 80px;
    height: 80px;
    display: block;
}

.success-svg-circle {
    stroke: var(--accent-tan);
    stroke-width: 2;
}

.success-svg-check {
    stroke: var(--accent-tan);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Optional: Subtle fade-in for the whole view */
#bookingSuccessView {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Checkbox Styling */
.checkbox-group {
    grid-column: 1 / span 2; /* Full width on desktop */
    margin-top: 10px;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    color: var(--primary-black);
    padding-top: 3px;
}

/* Hide the browser's default checkbox */
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create a custom checkbox */
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 4px;
    transition: background-color 0.2s;
}

/* On mouse-over, add a grey background color */
.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

/* When the checkbox is checked, add the accent color */
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-tan);
}

/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the checkmark when checked */
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Style the checkmark indicator */
.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


.date-scroll-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 10px 0;
}

/* Left shadow/fade */
.date-scroll-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    z-index: 2;
    pointer-events: none; /* Allows users to click through the shadow to the dates */
}

/* Right shadow/fade */
.date-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 100%;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    z-index: 2;
    pointer-events: none; /* Allows users to click through the shadow to the dates */
}

.date-scroll-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding: 0 120px 0 40px; /* Increased side padding so dates don't start hidden under the shadow */
    scrollbar-width: none;
    position: relative;
    z-index: 1;
}

.date-scroll-container::-webkit-scrollbar { display: none; } /* Hide for Chrome */

.date-item {
    flex: 0 0 70px;
    text-align: center;
    padding: 15px 5px;
    scroll-snap-align: center;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.3s;
}

.date-item.active {
    background: #a6998a;
    color: white;
}

.date-scroll-container {
    /* Standard grab cursor */
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    /* Smooth out the transition */
    scroll-behavior: smooth;
}

/* When the user is actually clicking/dragging */
.date-scroll-container:active {
    cursor: grabbing;
}

/* Disable snap-scrolling temporarily during drag for a fluid feel */
.date-scroll-container.active-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
}

/* --- CANCELLATION WARNING --- */
.cancellation-warning {
    margin: 40px auto !important;
    padding: 25px;
    /*background-color: #fffaf9; */
    /*border: 1px solid #f2dede;*/
    border-radius: 8px;
    max-width: 800px;
    text-align: center;
}

.warning-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.warning-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d9534f; /* Muted Red */
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.cancellation-warning h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #333;
}

.cancellation-warning p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 8px;
}

.cancellation-warning .thank-you {
    margin-top: 15px;
    font-style: italic;
    color: var(--text-muted);
}

/* --- DESKTOP MODAL ADJUSTMENTS --- */
@media (min-width: 768px) {
    .modal-content {
        max-width: 700px;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr; /* Name and Mobile side-by-side */
        gap: 20px;
    }

    /* This makes the email field span across both columns on desktop */
    .email-field {
        grid-column: 1 / span 2;
    }

    .btn-book-submit {
        width: 60%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cancellation-warning {
        margin: 20px 10px;
        padding: 20px 15px;
    }
}
/* --- UTILITIES --- */
.info-msg { text-align: center; padding: 100px 20px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
