/* ============================================================================
   FITNESS CALENDAR STYLES
   Responsive calendar view for class booking with dynamic scaling
   ============================================================================ */

/* ── CSS Variables for Dynamic Sizing ───────────────────────────────────── */
:root {
    /* Font sizes that scale with screen size - COMPACT */
    --calendar-title-size: clamp(1rem, 2.5vw, 1.5rem);
    --calendar-day-number: clamp(0.875rem, 1.5vw, 1.125rem);
    --calendar-day-name: clamp(0.625rem, 1.2vw, 0.75rem);
    --class-name-size: clamp(0.75rem, 1.2vw, 0.875rem);
    --class-time-size: clamp(0.625rem, 1vw, 0.75rem);
    --class-meta-size: clamp(0.5625rem, 0.9vw, 0.65rem);

    /* Spacing that scales - COMPACT */
    --calendar-padding: clamp(0.75rem, 1.5vw, 1rem);
    --card-padding: clamp(0.5rem, 1vw, 0.625rem);
    --card-gap: clamp(0.375rem, 0.75vw, 0.5rem);
}

/* ── Calendar Container ─────────────────────────────────────────────────── */
.calendar-container {
    padding: var(--calendar-padding);
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* ── Calendar Header ────────────────────────────────────────────────────── */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.calendar-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--calendar-title-size);
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.7);
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

/* ── Quick Actions ──────────────────────────────────────────────────────── */
.calendar-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.calendar-quick-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

/* ── Calendar Grid ──────────────────────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

/* ── Weekly Grid (Horizontal Layout) ────────────────────────────────────── */
.weekly-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.week-headers-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.week-day-header {
    text-align: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px 6px 0 0;
}

.week-day-header.is-today {
    background: rgba(200, 160, 60, 0.15);
    border-color: rgba(200, 160, 60, 0.4);
}

.week-day-header .day-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--calendar-day-name);
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.125rem;
}

.week-day-header .day-number {
    font-size: var(--calendar-day-number);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.week-day-header.is-today .day-name,
.week-day-header.is-today .day-number {
    color: #c8a03c;
}

.week-columns-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
    min-height: 300px;
}

.week-day-column {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 6px 6px;
    padding: 0.5rem;
    overflow-y: auto;
    max-height: 500px;
}

.week-day-column.is-today {
    background: rgba(200, 160, 60, 0.08);
    border-color: rgba(200, 160, 60, 0.3);
}

.week-day-column.is-past {
    opacity: 0.6;
}

.no-classes-message {
    text-align: center;
    padding: 1rem 0.375rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

/* ── Day Column ─────────────────────────────────────────────────────────── */
.calendar-day {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    min-height: 300px;
    transition: all 0.3s;
}

.calendar-day.is-today {
    background: rgba(200, 160, 60, 0.08);
    border-color: rgba(200, 160, 60, 0.3);
}

.calendar-day.is-past {
    opacity: 0.6;
}

.day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.day-name {
    font-size: var(--calendar-day-name);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.day-date {
    font-size: var(--calendar-day-number);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-day.is-today .day-date {
    color: #c8a03c;
}

.day-sessions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-classes {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    padding: 1rem 0;
}

/* ── Class Card ─────────────────────────────────────────────────────────── */
.class-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: var(--card-padding);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.class-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.class-card.special-class {
    border: 2px solid #c8a03c;
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.1), rgba(255, 255, 255, 0.05));
}

.class-card.past-class {
    opacity: 0.5;
    cursor: default;
}

.class-card.past-class:hover {
    transform: none;
}

.class-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--class-time-size);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.375rem;
}

.class-name {
    font-size: var(--class-name-size);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 0.375rem 0;
    line-height: 1.2;
}

.class-meta {
    display: flex;
    gap: var(--card-gap);
    margin-bottom: 0.375rem;
}

.class-category {
    font-size: var(--class-meta-size);
    padding: 0.1875rem 0.375rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.class-difficulty {
    font-size: var(--class-meta-size);
    padding: 0.1875rem 0.375rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.class-difficulty.beginner {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.class-difficulty.intermediate {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
}

.class-difficulty.advanced {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.class-instructor {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.instructor-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.class-capacity {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.capacity-available {
    color: #34c759;
    font-weight: 600;
}

.capacity-full {
    color: #ff9f0a;
    font-weight: 600;
}

.capacity-past {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.booking-badge {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.booking-badge.confirmed {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.booking-badge.waitlist {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
    border: 1px solid rgba(255, 159, 10, 0.3);
}

.special-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #c8a03c;
    color: #0a1628;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(200, 160, 60, 0.3);
}

/* ── Loading Overlay ────────────────────────────────────────────────────── */
.calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    gap: 1rem;
    z-index: 10;
}

/* ── Class Details Modal ────────────────────────────────────────────────── */
.class-details-modal {
    padding: 1.5rem;
}

.class-header {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.2), rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.class-header.special-class {
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.3), rgba(200, 160, 60, 0.2));
    border: 2px solid #c8a03c;
}

.class-category-badge,
.class-difficulty-badge {
    position: absolute;
    top: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.875rem;
}

.class-category-badge {
    left: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.class-difficulty-badge {
    right: 1rem;
}

.special-star {
    font-size: 3rem;
}

.class-datetime {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.datetime-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.class-description {
    margin-bottom: 1.5rem;
}

.class-description h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.95);
}

.class-description p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.class-instructor-details {
    margin-bottom: 1.5rem;
}

.class-instructor-details h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
}

.instructor-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.instructor-card img,
.instructor-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.instructor-placeholder {
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.instructor-info h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
}

.instructor-info p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.capacity-info {
    margin-bottom: 1.5rem;
}

.capacity-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, #34c759, #30d158);
    transition: width 0.3s;
}

.capacity-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.waitlist-count {
    color: #ff9f0a;
}

.class-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.booking-status {
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

.booking-status.confirmed {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.booking-status.waitlist {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
    border: 1px solid rgba(255, 159, 10, 0.3);
}

.past-class-message {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

/* ── My Classes List ────────────────────────────────────────────────────── */
.my-classes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.my-class-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.25rem;
}

.my-class-item.waitlist {
    border-color: rgba(255, 159, 10, 0.3);
}

.my-class-item .class-date {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.my-class-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.95);
}

.my-class-item .class-time {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.375rem;
}

.my-class-item .class-instructor {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
}

.booking-status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.booking-status-badge.confirmed {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.booking-status-badge.waitlist {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

.class-item-actions {
    display: flex;
    gap: 0.5rem;
}

.no-bookings {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
}

/* ── Mobile Responsive ──────────────────────────────────────────────────── */
/* Extra Large Screens (Desktop monitors) */
@media (min-width: 1920px) {
    :root {
        --calendar-title-size: 2.5rem;
        --calendar-day-number: 1.75rem;
        --calendar-day-name: 1rem;
        --class-name-size: 1.125rem;
        --class-time-size: 1rem;
        --class-meta-size: 0.875rem;
    }
}

/* Large Screens (Laptop) */
@media (max-width: 1440px) {
    :root {
        --calendar-title-size: 1.75rem;
        --calendar-day-number: 1.5rem;
        --calendar-day-name: 0.875rem;
    }
}

/* Medium Screens (Tablet landscape) */
@media (max-width: 1024px) {
    :root {
        --calendar-title-size: 1.5rem;
        --calendar-day-number: 1.25rem;
        --calendar-day-name: 0.8rem;
        --class-name-size: 0.9rem;
        --class-time-size: 0.75rem;
        --class-meta-size: 0.7rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    :root {
        --calendar-title-size: 1.25rem;
        --calendar-day-number: 1rem;
        --calendar-day-name: 0.75rem;
        --class-name-size: 0.875rem;
        --class-time-size: 0.7rem;
        --class-meta-size: 0.65rem;
    }

    .calendar-container {
        padding: 1rem;
    }

    .calendar-nav-btn {
        width: 44px;
        height: 44px;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .calendar-day {
        min-height: auto;
        padding: 0.875rem;
    }

    .day-header {
        flex-direction: row;
        justify-content: space-between;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .class-card {
        padding: 1rem;
    }

    .class-details-modal {
        padding: 1rem;
    }

    .class-datetime {
        flex-direction: column;
        gap: 0.75rem;
    }

    .instructor-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .class-actions button {
        width: 100%;
    }

    .class-item-actions {
        flex-direction: column;
    }

    .class-item-actions button {
        width: 100%;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    :root {
        --calendar-title-size: 1.125rem;
        --calendar-day-number: 0.9rem;
        --calendar-day-name: 0.7rem;
        --class-name-size: 0.8rem;
        --class-time-size: 0.65rem;
        --class-meta-size: 0.6rem;
        --calendar-padding: 0.75rem;
        --card-padding: 0.75rem;
        --card-gap: 0.375rem;
    }

    .calendar-nav-btn {
        width: 40px;
        height: 40px;
    }

    .calendar-grid {
        gap: 0.5rem;
    }

    .class-card {
        padding: 0.75rem;
    }
}

/* ── Attend Button & Booking Badges ─────────────────────────────────────── */
.btn-attend {
    width: 100%;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.8), rgba(200, 160, 60, 0.6));
    border: 1px solid rgba(200, 160, 60, 0.5);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.375rem;
}

.btn-attend:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(200, 160, 60, 1), rgba(200, 160, 60, 0.8));
    border-color: rgba(200, 160, 60, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 160, 60, 0.3);
}

.btn-attend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Booking Badge - Gold styling for confirmed bookings */
.booking-badge {
    margin-top: 0.375rem;
    padding: 0.375rem;
    border-radius: 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.booking-badge.confirmed {
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.2), rgba(200, 160, 60, 0.1));
    border: 2px solid rgba(200, 160, 60, 0.6);
    color: #c8a03c;
    box-shadow: 0 0 20px rgba(200, 160, 60, 0.3);
}

.booking-badge.waitlist {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2), rgba(255, 149, 0, 0.1));
    border: 2px solid rgba(255, 149, 0, 0.5);
    color: #FF9500;
}

/* Gold chip for booked classes in class card */
.class-card:has(.booking-badge.confirmed) {
    border: 2px solid rgba(200, 160, 60, 0.5);
    box-shadow: 0 0 20px rgba(200, 160, 60, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(200, 160, 60, 0.05));
}

.class-card:has(.booking-badge.confirmed)::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.3), transparent);
    border-radius: 12px;
    z-index: -1;
}
