/* CSS Variables */
:root {
    --gym-black: #0a0a0a;
    --gym-yellow: #DCA54A;
    --gym-white: #ffffff;
    --gym-gray: #333333;
    --gym-light-gray: #666666;
}

/* Font Face */
@font-face {
    font-family: 'Maze Runner';
    src: url('MAZE_RUNNER.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles - Mobile First */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--gym-black);
    color: var(--gym-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container - Mobile First */
.container {
    min-height: 100vh;
    padding: 15px;
    max-width: 100%;
}

/* Header - Mobile Optimized */
.gym-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gym-yellow);
}

.gym-header h1 {
    font-family: 'Maze Runner', Arial, sans-serif;
    color: var(--gym-yellow);
    font-size: 2.2rem;
    font-weight: normal;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--gym-white);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Reservation Flow - Mobile First */
.reservation-flow {
    margin-top: 20px;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.step-title {
    font-family: 'Maze Runner', Arial, sans-serif;
    color: var(--gym-yellow);
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: normal;
    letter-spacing: 1px;
}

/* Calendar Navigation - Mobile */
.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.nav-btn {
    background-color: var(--gym-yellow);
    color: var(--gym-black);
    border: none;
    padding: 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gym-black);
}

.nav-btn:active {
    transform: scale(0.95);
}

.current-month {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    flex: 1;
}

/* Calendar Container - Mobile */
.calendar-container {
    background-color: #1a1a1a;
    border: 1px solid var(--gym-gray);
    border-radius: 10px;
    padding: 10px;
}

/* Calendar Grid - Mobile Optimized */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 15px;
}

.calendar-header {
    text-align: center;
    padding: 5px 0;
    color: var(--gym-yellow);
    font-weight: bold;
    font-size: 0.75rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    min-height: 38px;
    border-radius: 3px;
}

.calendar-day:active:not(.disabled) {
    transform: scale(0.95);
}

.calendar-day.today {
    border: 2px solid var(--gym-yellow);
}

.calendar-day.selected {
    background-color: var(--gym-yellow);
    color: var(--gym-black);
    font-weight: bold;
}

.calendar-day.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #0f0f0f;
    color: #666;
}

/* Selected Date Display - Mobile */
.selected-date {
    font-size: 1.1rem;
    color: var(--gym-white);
    margin-bottom: 15px;
    text-align: center;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 5px;
}

.back-btn {
    background-color: transparent;
    color: var(--gym-yellow);
    border: 2px solid var(--gym-yellow);
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
    font-size: 1rem;
    width: 100%;
    font-weight: 600;
}

.back-btn:active {
    background-color: var(--gym-yellow);
    color: var(--gym-black);
}

/* Time Slots Header Section */
.time-slots-header-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 15px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 1px solid rgba(220, 165, 74, 0.2);
}

.icon-btn {
    background-color: transparent;
    border: 1px solid var(--gym-yellow);
    color: var(--gym-yellow);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    padding: 0;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    color: var(--gym-yellow);
}

.icon-btn:active {
    transform: scale(0.95);
    background-color: rgba(220, 165, 74, 0.1);
}

.header-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 32px; /* Balance out the back button width */
}

.header-content .selected-date {
    font-size: 1.1rem;
    color: var(--gym-yellow);
    font-weight: 600;
    line-height: 32px; /* Match button height */
}

/* Slots Info Section */
.slots-info {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: rgba(220, 165, 74, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(220, 165, 74, 0.1);
    font-size: 0.85rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
}

.info-icon {
    font-size: 1rem;
}

/* Time Slots Container */
.time-slots-container {
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 140px; /* Space for fixed selection summary */
}

.time-slots-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background-color: var(--gym-yellow);
    color: var(--gym-black);
    font-weight: bold;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.column-header {
    padding: 15px 10px;
    border-right: 1px solid var(--gym-black);
}

.column-header:last-child {
    border-right: none;
}

/* Time Slots List */
.time-slots-list {
    max-height: 500px;
    overflow-y: auto;
}

.time-slot-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid #2a2a2a;
}

.time-slot-row:last-child {
    border-bottom: none;
}

/* Add padding to last visible slot to prevent cutoff */
.time-slots-list .time-slot-row:last-child {
    margin-bottom: 10px;
}

.time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gym-yellow);
    background-color: #0f0f0f;
    border-right: 1px solid #2a2a2a;
}

.slot-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border-right: 1px solid #2a2a2a;
    position: relative;
}

.slot-cell:last-child {
    border-right: none;
}

.slot-cell.available {
    background-color: #1a1a1a;
}

.slot-cell.available:active {
    background-color: #2a2a2a;
}

.slot-cell.reserved {
    background-color: #0f0f0f;
    opacity: 0.5;
    cursor: not-allowed;
}

.slot-cell.selected {
    background-color: var(--gym-yellow);
    color: var(--gym-black);
}

.slot-status {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Selection Summary */
.selection-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--gym-black);
    padding: 15px;
    border-top: 3px solid var(--gym-yellow);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.summary-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.summary-icon {
    width: 40px;
    height: 40px;
    background-color: var(--gym-yellow);
    color: var(--gym-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
}

.summary-text {
    flex-grow: 1;
    text-align: left;
}

.summary-title {
    font-size: 1.1rem;
    margin: 0 0 5px 0;
    font-weight: bold;
}

.summary-subtitle {
    font-size: 0.9rem;
    margin: 0;
    color: #aaa;
}

#selectedCount {
    color: var(--gym-yellow);
    font-weight: bold;
}

.continue-btn {
    background-color: var(--gym-yellow);
    color: var(--gym-black);
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.continue-btn:active {
    transform: scale(0.98);
}

/* Booking Summary */
.booking-summary {
    background-color: #1a1a1a;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.booking-summary h3 {
    font-family: 'Maze Runner', Arial, sans-serif;
    color: var(--gym-yellow);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: normal;
    letter-spacing: 1px;
}

.booking-date {
    background: linear-gradient(135deg, #DCA54A10, #DCA54A20);
    border: 1px solid #DCA54A30;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 15px;
    text-align: center;
    color: var(--gym-yellow);
    font-size: 1.1rem;
}

.booking-slots {
    margin-top: 10px;
}

.booking-summary-item {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #0f0f0f;
    border-radius: 5px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: var(--gym-yellow);
}

/* Modal - Mobile Optimized */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: #1a1a1a;
    margin: 0;
    padding: 15px;
    border: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.close {
    color: var(--gym-white);
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:active {
    color: var(--gym-yellow);
}

.modal h2 {
    color: var(--gym-yellow);
    margin-bottom: 10px;
    margin-top: 20px;
    font-size: 1.5rem;
}

.modal-subtitle {
    color: var(--gym-white);
    margin-bottom: 20px;
    opacity: 0.8;
    font-size: 1rem;
}

/* Form Styles - Mobile Optimized */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gym-yellow);
    font-weight: bold;
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    background-color: var(--gym-black);
    color: var(--gym-white);
    border: 2px solid #333;
    border-radius: 5px;
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gym-yellow);
}

/* Form Actions - Mobile */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.submit-btn,
.cancel-btn {
    padding: 16px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    width: 100%;
}

.submit-btn {
    background-color: var(--gym-yellow);
    color: var(--gym-black);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.cancel-btn {
    background-color: transparent;
    color: var(--gym-white);
    border: 2px solid var(--gym-gray);
}

.cancel-btn:active {
    background-color: var(--gym-gray);
}

/* Success Message - Mobile */
.success-message {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2a5a2a;
    color: var(--gym-white);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: bottom 0.3s ease;
    z-index: 2000;
    text-align: center;
    font-size: 1rem;
    width: calc(100% - 30px);
    max-width: 400px;
}

.success-message.show {
    bottom: 20px;
}

/* Tablet and Desktop Styles */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 15px;
    }

    .gym-header h1 {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .step-title {
        font-size: 1.8rem;
    }

    .calendar-container {
        max-width: 600px;
        margin: 0 auto;
        padding: 30px;
    }

    .calendar-grid {
        gap: 8px;
    }

    .calendar-day {
        font-size: 1.1rem;
    }

    .calendar-day:hover:not(.disabled):not(.selected) {
        background-color: #2a2a2a;
        border-color: var(--gym-yellow);
        color: var(--gym-white);
    }

    .nav-btn:hover {
        background-color: var(--gym-white);
        transform: translateY(-2px);
    }

    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
        max-width: 900px;
        margin: 20px auto;
    }

    .time-slot.available:hover {
        border-color: var(--gym-yellow);
        transform: translateY(-2px);
    }

    .back-btn {
        width: auto;
        display: inline-block;
    }

    .back-btn:hover {
        background-color: var(--gym-yellow);
        color: var(--gym-black);
    }

    .modal-content {
        margin: 5% auto;
        padding: 40px;
        width: 90%;
        max-width: 600px;
        min-height: auto;
        border-radius: 10px;
    }

    .close:hover {
        color: var(--gym-yellow);
    }

    .form-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .submit-btn,
    .cancel-btn {
        width: auto;
        padding: 12px 30px;
    }

    .submit-btn:hover:not(:disabled) {
        background-color: var(--gym-white);
        transform: translateY(-2px);
    }

    .cancel-btn:hover {
        background-color: var(--gym-gray);
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .time-slots-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Very small screens (320px) */
@media (max-width: 350px) {
    .container {
        padding: 10px;
    }
    
    .gym-header h1 {
        font-size: 1.75rem;
    }
    
    .nav-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    .nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .calendar-container {
        padding: 8px;
    }
    
    .calendar-grid {
        gap: 1px;
    }
    
    .calendar-header {
        font-size: 0.7rem;
        padding: 3px 0;
    }
    
    .calendar-day {
        font-size: 0.85rem;
        min-height: 35px;
    }
    
    .time-slots-container {
        font-size: 0.9rem;
    }
    
    
    .column-header {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
}