/* Court Booking Grid Styles */

.hidden-nav-item {
    display: none !important;
}

/* Hide main header navigation on mobile when logged in */
@media (max-width: 768px) {
    header nav.hide-on-mobile-when-logged-in,
    #mobileMenuBtn.hide-on-mobile-when-logged-in {
        display: none !important;
    }
}

.court-booking-main {
    min-height: 100vh;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
}

.booking-grid-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header Bar */
.booking-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-arrow,
.date-nav-arrow {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.nav-arrow:hover,
.date-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
}

.date-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.today-label {
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
}

#currentDateDisplay {
    color: #fff;
    font-weight: 600;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #3a3a3a;
    padding: 8px 15px;
    border-radius: 6px;
}

.date-picker-display {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    min-width: 200px;
    text-align: center;
}

.location-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.location-display i {
    color: #4CAF50;
}

.menu-wrapper {
    position: relative;
}

.menu-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* User Menu Dropdown */
.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-menu.show {
    opacity: 1;
    transform: translateY(0);
}

.user-menu-header {
    padding: 15px 20px;
    background: #2a2a2a;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.user-menu-header i {
    font-size: 20px;
}

.user-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.user-menu-item:hover {
    background: #f5f5f5;
}

.user-menu-item i {
    width: 20px;
    text-align: center;
    color: #666;
}

.user-menu-item:hover i {
    color: #4CAF50;
}

/* Booking Success Toast */
.booking-success-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2000;
    min-width: 300px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.booking-success-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    color: #333;
    font-size: 14px;
}

.toast-content i {
    color: #4CAF50;
    font-size: 20px;
}

.toast-action-btn {
    background: #4CAF50;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.toast-action-btn:hover {
    background: #45a049;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    background: #3a3a3a;
    border-radius: 6px;
    padding: 4px;
}

.view-btn {
    background: transparent;
    border: none;
    color: #ccc;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.view-btn.active {
    background: #4CAF50;
    color: #fff;
}

.view-btn i {
    font-size: 12px;
}

/* Booking Grid */
.booking-grid-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.booking-grid {
    display: grid;
    gap: 2px;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

/* Day View Grid */
.day-view {
    grid-template-columns: 120px repeat(4, 1fr);
    min-width: 800px;
}

/* Week View Grid - Calendar Style */
.week-view {
    grid-template-columns: repeat(7, 1fr); /* 7 days (Monday to Sunday) */
    min-width: 800px;
    max-width: 1200px;
    margin: 0 auto;
}

.week-calendar-header {
    grid-column: 1 / -1;
}

.week-calendar-week {
    grid-column: 1 / -1;
}

.week-day-header {
    font-size: 12px;
    padding: 12px 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.week-calendar-cell {
    min-height: 150px;
    padding: 15px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.week-calendar-cell:hover:not(.unavailable) {
    transform: scale(1.03);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.week-day-number {
    font-weight: 700;
    font-size: 32px;
    line-height: 1;
}

.week-month-name {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.week-availability-indicator {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 600;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.week-calendar-cell.today {
    border: 2px solid #FFC107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.week-calendar-cell.mostly-booked {
    background: #ff9800;
    color: #fff;
}

.week-calendar-cell.partially-available {
    background: #ffc107;
    color: #333;
}

.week-calendar-cell.available {
    background: #4CAF50;
    color: #fff;
}

.week-calendar-cell.unavailable {
    background: #757575;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Month View Grid - Calendar Style */
.month-view {
    grid-template-columns: repeat(7, 1fr); /* 7 days of week */
    min-width: 800px;
    max-width: 1200px;
    margin: 0 auto;
}

.month-calendar-header {
    grid-column: 1 / -1;
}

.month-calendar-week {
    grid-column: 1 / -1;
}

.month-day-header {
    font-size: 12px;
    padding: 12px 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-calendar-cell {
    min-height: 80px;
    padding: 10px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.month-calendar-cell:hover:not(.unavailable) {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.month-day-number {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.month-availability-indicator {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 500;
}

.month-calendar-cell.today {
    border: 2px solid #FFC107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.month-calendar-cell.mostly-booked {
    background: #ff9800;
    color: #fff;
}

.month-calendar-cell.partially-available {
    background: #ffc107;
    color: #333;
}

.month-calendar-cell.available {
    background: #4CAF50;
    color: #fff;
}

.month-calendar-cell.unavailable {
    background: #757575;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.5;
}

.month-calendar-cell.next-month-cell {
    opacity: 0.7;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.3);
}

.month-calendar-cell.next-month-cell:hover {
    opacity: 1;
    transform: scale(1.05);
    background: #4CAF50;
    border-style: solid;
    border-color: #FFC107;
}

.hidden-view {
    display: none !important;
}

.recurring-info {
    display: none;
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.recurring-info p {
    margin: 0;
    color: #1976d2;
    font-size: 14px;
}

/* Time Column Header */
.time-header {
    background: #1a1a1a;
    color: #fff;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-right: 2px solid #3a3a3a;
}

/* Court Column Headers */
.court-header {
    background: #1a1a1a;
    color: #fff;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    border-right: 2px solid #3a3a3a;
}

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

/* Time Slot Rows */
.time-slot-row {
    display: contents;
}

.time-cell {
    background: #2a2a2a;
    color: #fff;
    padding: 12px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    border-right: 2px solid #3a3a3a;
    border-bottom: 1px solid #3a3a3a;
}

/* Court Status Cells */
.court-cell {
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 2px solid #3a3a3a;
    border-bottom: 1px solid #3a3a3a;
    position: relative;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

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

/* Available (Green) */
.court-cell.available {
    background: #4CAF50;
    color: #fff;
}

.court-cell.available:hover {
    background: #45a049;
    transform: scale(1.02);
}

.court-cell.available::before {
    content: '✓';
    font-size: 16px;
    font-weight: bold;
}

/* Booked (Blue) */
.court-cell.booked {
    background: #2196F3;
    color: #fff;
    cursor: not-allowed;
}

.court-cell.booked .booking-info {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.court-cell.booked .booked-by {
    font-size: 9px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Unavailable (Grey) */
.court-cell.unavailable {
    background: #757575;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
}

.court-cell.unavailable::before {
    content: '✗';
    font-size: 16px;
    font-weight: bold;
}

/* Admin-blocked slot shown to users as "Closed" — distinct red from grey maintenance */
.court-cell.unavailable.closed {
    background: #b91c1c;
    opacity: 0.92;
}
.court-cell.unavailable.closed::before {
    content: '🔒';
    font-size: 14px;
}

/* Selected State */
.court-cell.selected {
    outline: 3px solid #FFC107;
    outline-offset: -3px;
    z-index: 10;
}

/* Legend */
.booking-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.available {
    background: #4CAF50;
}

.legend-color.booked {
    background: #2196F3;
}

.legend-color.unavailable {
    background: #757575;
}

/* Booking Actions */
.booking-actions {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.confirm-booking-btn {
    background: #424242;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.confirm-booking-btn:enabled {
    background: #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.confirm-booking-btn:enabled:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.confirm-booking-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Booking Modal */
.booking-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.booking-details {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.detail-row.total {
    border-top: 2px solid #333;
    padding-top: 15px;
    margin-top: 10px;
    font-weight: 600;
    font-size: 18px;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 2px solid #e0e0e0;
}

.btn-secondary,
.btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: #757575;
    color: #fff;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-primary {
    background: #4CAF50;
    color: #fff;
}

.btn-primary:hover {
    background: #45a049;
}

/* Authentication Prompt Overlay */
.auth-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.auth-prompt-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-prompt-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.auth-prompt-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.auth-prompt-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-prompt-buttons .btn-primary,
.auth-prompt-buttons .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.auth-prompt-buttons .btn-primary {
    background: #4CAF50;
    color: #fff;
}

.auth-prompt-buttons .btn-primary:hover {
    background: #45a049;
}

.auth-prompt-buttons .btn-secondary {
    background: #757575;
    color: #fff;
}

.auth-prompt-buttons .btn-secondary:hover {
    background: #616161;
}

/* Responsive Design */
@media (max-width: 768px) {
    .court-booking-main {
        padding: 10px;
    }

    .booking-grid-container {
        padding: 15px;
        border-radius: 8px;
    }

    .booking-grid-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .nav-arrow {
        display: none; /* Hide on mobile, use date nav arrows instead */
    }

    .date-display {
        order: 1;
        width: 100%;
    }

    .today-label {
        font-size: 12px;
    }

    #currentDateDisplay {
        font-size: 13px;
    }

    .date-picker-wrapper {
        width: 100%;
        justify-content: space-between;
        padding: 10px;
    }

    .date-picker-display {
        min-width: auto;
        font-size: 13px;
        flex: 1;
    }

    .location-display {
        order: 2;
        justify-content: center;
        font-size: 12px;
    }

    .view-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
        padding: 2px;
    }

    .view-btn {
        flex: 1;
        padding: 8px 6px;
        font-size: 11px;
    }

    .view-btn i {
        font-size: 10px;
    }

    .menu-wrapper {
        order: 4;
        align-self: flex-end;
    }

    .user-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }

    /* Day View - Mobile optimized: Time selection first, then courts */
    .mobile-day-view {
        grid-template-columns: 1fr;
        min-width: auto;
        gap: 0;
    }

    .mobile-time-selector,
    .mobile-court-selector {
        width: 100%;
        padding: 0;
    }

    .mobile-view-header {
        background: #2a2a2a;
        padding: 20px;
        border-radius: 8px 8px 0 0;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .mobile-view-header h3 {
        color: #fff;
        margin: 0;
        font-size: 20px;
        font-weight: 600;
    }

    .mobile-view-header p {
        color: #fff !important;
        margin: 4px 0 0 0;
        font-size: 14px;
    }

    .mobile-back-btn {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #fff;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.3s ease;
        flex-shrink: 0;
    }

    .mobile-back-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .mobile-time-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
        background: #1a1a1a;
    }

    .mobile-time-item {
        background: #2a2a2a;
        border: 2px solid #3a3a3a;
        color: #fff;
        padding: 15px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
    }

    .mobile-time-item:not(.unavailable):not(:disabled):hover {
        background: #4CAF50;
        border-color: #4CAF50;
        transform: translateY(-2px);
    }

    .mobile-time-item.unavailable,
    .mobile-time-item:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: #1a1a1a;
    }

    .mobile-court-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        background: #1a1a1a;
    }

    .mobile-court-card {
        background: #2a2a2a;
        border-radius: 12px;
        padding: 20px;
        border: 2px solid #3a3a3a;
        transition: all 0.3s ease;
    }

    .mobile-court-card.available {
        border-color: #4CAF50;
    }

    .mobile-court-card.booked {
        border-color: #2196F3;
        opacity: 0.8;
    }

    .mobile-court-card.unavailable {
        border-color: #757575;
        opacity: 0.6;
    }

    .court-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }

    .court-card-header h4 {
        color: #fff;
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }

    .court-status-badge {
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .court-status-badge.available {
        background: #4CAF50;
        color: #fff;
    }

    .court-status-badge.booked {
        background: #2196F3;
        color: #fff;
    }

    .court-status-badge.unavailable {
        background: #757575;
        color: #fff;
    }

    .court-card-info {
        margin-bottom: 15px;
    }

    .court-card-info p {
        color: #fff !important;
        margin: 0;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .court-card-info p * {
        color: inherit !important;
    }

    .court-card-info i {
        color: #4CAF50;
    }

    .court-select-btn {
        width: 100%;
        background: #4CAF50;
        color: #fff;
        border: none;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.3s ease;
    }

    .court-select-btn:hover {
        background: #45a049;
        color: #fff;
    }

    /* Week View - Simplified mobile layout */
    .week-view {
        grid-template-columns: 1fr;
        min-width: auto;
        max-width: 100%;
    }

    .week-calendar-header {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .week-day-header {
        font-size: 10px;
        padding: 8px 4px;
    }

    .week-calendar-week {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .week-calendar-cell {
        min-height: 100px;
        padding: 10px 6px;
    }

    .week-day-number {
        font-size: 24px;
    }

    .week-month-name {
        font-size: 11px;
    }

    .week-availability-indicator {
        font-size: 10px;
        padding: 3px 6px;
    }

    /* Month View - Simplified mobile layout */
    .month-view {
        grid-template-columns: repeat(7, 1fr);
        min-width: auto;
        max-width: 100%;
        gap: 2px;
    }

    .month-day-header {
        font-size: 10px;
        padding: 8px 4px;
    }

    .month-calendar-cell {
        min-height: 60px;
        padding: 8px 4px;
    }

    .month-day-number {
        font-size: 14px;
    }

    .month-availability-indicator {
        font-size: 9px;
    }

    .booking-grid-wrapper {
        overflow-x: visible;
    }

    .booking-legend {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        padding: 12px;
        font-size: 12px;
    }

    .legend-item {
        font-size: 11px;
    }

    .confirm-booking-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Modal improvements */
    .booking-modal {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
    }

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

    .modal-body {
        padding: 15px;
    }

    .booking-details {
        padding: 12px;
    }

    .detail-row {
        padding: 8px 0;
        font-size: 14px;
    }

    .detail-row.total {
        font-size: 16px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer .btn-secondary,
    .modal-footer .btn-primary {
        width: 100%;
    }

    /* Toast notification */
    .booking-success-toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        flex-direction: column;
        gap: 10px;
    }

    .toast-action-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .court-booking-main {
        padding: 5px;
    }

    .booking-grid-container {
        padding: 10px;
    }

    .booking-grid-header {
        padding: 10px;
        gap: 10px;
    }

    .date-picker-wrapper {
        padding: 8px;
    }

    .date-picker-display {
        font-size: 12px;
    }

    .view-btn {
        padding: 6px 4px;
        font-size: 10px;
    }

    .view-btn span {
        display: none; /* Hide text, show only icons on very small screens */
    }

    .view-btn i {
        margin: 0;
    }

    .week-calendar-cell {
        min-height: 80px;
        padding: 8px 4px;
    }

    .week-day-number {
        font-size: 20px;
    }

    .month-calendar-cell {
        min-height: 50px;
        padding: 6px 3px;
    }

    .month-day-number {
        font-size: 12px;
    }

    .month-availability-indicator {
        font-size: 8px;
    }

    .booking-legend {
        font-size: 10px;
        gap: 10px;
    }

    .legend-item {
        font-size: 10px;
    }

    .user-menu {
        min-width: 180px;
    }

    .user-menu-item {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ============================================
   MODERN ADMIN COURT BOOKING REDESIGN
   Clean, light-themed, professional UX
   ============================================ */

/* Wrapper */
.cb-admin-wrapper {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* Top Bar */
.cb-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.cb-top-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.cb-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.3px;
}
.cb-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f0fdf4;
    color: #15803d;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #bbf7d0;
}
.cb-location-badge i { font-size: 11px; }
.cb-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cb-user-select {
    padding: 8px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #fff;
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.2s;
}
.cb-user-select:focus { border-color: #3b82f6; outline: none; }
.cb-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.cb-icon-btn:hover { background: #f8fafc; border-color: #cbd5e1; color: #334155; }
.cb-refresh-btn:hover { color: #3b82f6; border-color: #93c5fd; }

/* Controls Bar */
.cb-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px 16px;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f1f5f9;
}
.cb-date-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cb-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}
.cb-nav-btn:hover { background: #e2e8f0; color: #1e293b; }
.cb-date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
    min-width: 180px;
}
.cb-date-main {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}
.cb-date-today {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* View Toggle */
.cb-view-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.cb-view-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cb-view-btn:hover { color: #334155; background: rgba(255,255,255,0.5); }
.cb-view-btn.active {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.cb-view-btn i { font-size: 11px; }

/* Filters */
.cb-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cb-time-filter {
    padding: 7px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #fff;
    cursor: pointer;
}
.cb-time-filter:focus { border-color: #3b82f6; outline: none; }

/* Quick Actions (shown contextually) */
.cb-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #fefce8;
    border-bottom: 1px solid #fef08a;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.cb-action-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.cb-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cb-action-block { background: #fef3c7; color: #92400e; }
.cb-action-block:not(:disabled):hover { background: #fde68a; }
.cb-action-unblock { background: #fce7f3; color: #9d174d; }
.cb-action-unblock:not(:disabled):hover { background: #fbcfe8; }
.cb-action-bulk { background: #fee2e2; color: #991b1b; }
.cb-action-bulk:hover { background: #fecaca; }
.cb-action-manage { background: #e0e7ff; color: #3730a3; }
.cb-action-manage:hover { background: #c7d2fe; }
.cb-actions-hint { font-size: 12px; color: #92400e; font-weight: 600; margin-right: 4px; }

/* Grid Wrapper */
.cb-grid-wrapper {
    padding: 0 24px 20px;
    overflow-x: auto;
}

/* Override existing dark grid styles for admin */
.cb-admin-wrapper .booking-grid-container {
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: none;
}
.cb-admin-wrapper .booking-grid-header { display: none; }

/* Day View Grid - Modern Light Theme */
.cb-admin-wrapper .booking-grid.day-view {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    gap: 0;
    overflow: hidden;
}
.cb-admin-wrapper .time-header {
    background: #f8fafc;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 12px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 2px solid #e5e7eb;
}
.cb-admin-wrapper .court-header {
    background: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    padding: 14px 12px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 2px solid #e5e7eb;
    letter-spacing: -0.2px;
}
.cb-admin-wrapper .court-header:last-child { border-right: none; }
.cb-admin-wrapper .time-cell {
    background: #fafbfc;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 8px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

/* Court Cells - Modern */
.cb-admin-wrapper .court-cell {
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    min-height: 44px;
    font-size: 11px;
    padding: 8px 6px;
    transition: all 0.15s ease;
}
.cb-admin-wrapper .court-cell:last-child { border-right: none; }

/* Available - Soft sage green, minimal */
.cb-admin-wrapper .court-cell.available {
    background: #f0fdf4;
    color: #16a34a;
    cursor: pointer;
}
.cb-admin-wrapper .court-cell.available::before {
    content: none;
}
.cb-admin-wrapper .court-cell.available:hover {
    background: #dcfce7;
    transform: none;
    box-shadow: inset 0 0 0 2px #86efac;
}

/* Booked - Modern blue */
.cb-admin-wrapper .court-cell.booked {
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
}
.cb-admin-wrapper .court-cell.booked .booking-info-admin {
    font-size: 11px;
    font-weight: 600;
}
.cb-admin-wrapper .court-cell.booked .booking-user-name {
    font-size: 11px;
    font-weight: 600;
    color: #1e40af;
}
.cb-admin-wrapper .court-cell.booked .booking-override-badge {
    font-size: 9px;
    background: #fbbf24;
    color: #78350f;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    display: inline-block;
    margin-top: 2px;
}

/* Blocked - Warm red */
.cb-admin-wrapper .court-cell.blocked {
    background: #fef2f2;
    color: #dc2626;
    cursor: pointer;
}

/* Unavailable - Neutral */
.cb-admin-wrapper .court-cell.unavailable {
    background: #f9fafb;
    color: #9ca3af;
    opacity: 1;
    cursor: default;
}
.cb-admin-wrapper .court-cell.unavailable::before {
    content: none;
}

/* Selected */
.cb-admin-wrapper .court-cell.selected {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    z-index: 5;
}

/* Override cell */
.cb-admin-wrapper .court-cell.override {
    background: #fefce8;
    border-left: 3px solid #eab308;
}

/* Week View - Light */
.cb-admin-wrapper #weekViewGrid {
    background: #ffffff !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px !important;
}
.cb-admin-wrapper .week-day-header {
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    border-bottom: 2px solid #e5e7eb;
    padding: 12px 8px;
    border-right: 1px solid #f1f5f9;
}
.cb-admin-wrapper .week-calendar-cell {
    border: 1px solid #f1f5f9;
    min-height: 120px;
    border-radius: 0;
    transition: all 0.15s;
}
.cb-admin-wrapper .week-calendar-cell:hover:not(.unavailable) {
    transform: none;
    box-shadow: inset 0 0 0 2px #93c5fd;
    background: #eff6ff;
}
.cb-admin-wrapper .week-calendar-cell.available { background: #f0fdf4; color: #15803d; }
.cb-admin-wrapper .week-calendar-cell.partially-available { background: #fffbeb; color: #92400e; }
.cb-admin-wrapper .week-calendar-cell.mostly-booked { background: #fff1f2; color: #9f1239; }
.cb-admin-wrapper .week-calendar-cell.today { border: 2px solid #3b82f6; box-shadow: none; }
.cb-admin-wrapper .week-day-number { font-size: 28px; color: inherit; }
.cb-admin-wrapper .week-month-name { font-size: 12px; }
.cb-admin-wrapper .week-availability-indicator { background: rgba(0,0,0,0.06); color: inherit; font-size: 11px; }

/* Month View - Light */
.cb-admin-wrapper #monthViewGrid {
    background: #ffffff !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px !important;
}
.cb-admin-wrapper .month-day-header {
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    border-bottom: 2px solid #e5e7eb;
    border-right: 1px solid #f1f5f9;
}
.cb-admin-wrapper .month-calendar-cell {
    border: 1px solid #f1f5f9;
    transition: all 0.15s;
}
.cb-admin-wrapper .month-calendar-cell:hover:not(.unavailable) {
    transform: none;
    box-shadow: inset 0 0 0 2px #93c5fd;
}
.cb-admin-wrapper .month-calendar-cell.available { background: #f0fdf4; color: #15803d; }
.cb-admin-wrapper .month-calendar-cell.partially-available { background: #fffbeb; color: #92400e; }
.cb-admin-wrapper .month-calendar-cell.mostly-booked { background: #fff1f2; color: #9f1239; }
.cb-admin-wrapper .month-calendar-cell.today { border: 2px solid #3b82f6; box-shadow: none; }
.cb-admin-wrapper .month-calendar-cell.next-month-cell { opacity: 0.4; }
.cb-admin-wrapper .month-calendar-cell.next-month-cell:hover { opacity: 0.7; background: #eff6ff; border-style: solid; border-color: #93c5fd; }

/* Compact Legend */
.cb-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
}
.cb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}
.cb-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.cb-dot-available { background: #22c55e; }
.cb-dot-booked { background: #3b82f6; }
.cb-dot-blocked { background: #ef4444; }
.cb-dot-unavailable { background: #d1d5db; }

/* Responsive for new admin layout */
@media (max-width: 768px) {
    .cb-top-bar { flex-direction: column; align-items: stretch; padding: 16px 16px 12px; }
    .cb-top-left { justify-content: space-between; }
    .cb-top-right { justify-content: stretch; }
    .cb-user-select { min-width: auto; flex: 1; }
    .cb-controls-bar { flex-direction: column; align-items: stretch; padding: 12px 16px; }
    .cb-date-nav { justify-content: center; }
    .cb-view-toggle { justify-content: center; }
    .cb-filters { justify-content: center; }
    .cb-grid-wrapper { padding: 0 12px 16px; }
    .cb-quick-actions { padding: 10px 16px; flex-wrap: wrap; }
    .cb-legend { gap: 12px; padding: 12px 16px; flex-wrap: wrap; justify-content: center; }
}

