/**
 * Facility Booking Dashboard Styles
 * File: public/css/modules/facility-booking-dashboard.css
 * Created: Saturday, December 28, 2025
 * Version: 1.0.0
 * 
 * Purpose: Complete styling for facility booking dashboard
 * Dependencies: main.css (base styles), components.css (standard components)
 */

/* ========================================================================
   DASHBOARD CONTAINER
   ======================================================================== */

.facility-dashboard-content {
    background: #f8f9fa;
    min-height: calc(100vh - 100px);
}

.facility-dashboard {
    max-width: 100%;
    margin: 0 auto;
}

/* ========================================================================
   CONTROLS BAR
   ======================================================================== */

.controls-bar {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.controls-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Date Selector */
.date-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-selector label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.date-selector .date-input {
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.date-selector .date-input:hover {
    border-color: #2a5298;
}

.date-selector .date-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.quick-dates {
    display: flex;
    gap: 8px;
}

.quick-date-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-date-btn:hover {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.quick-date-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

/* Proxy Booking Button */
.proxy-booking-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s;
    white-space: nowrap;
}

.proxy-booking-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Facility Filters */
.facility-filters {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.filter-chip {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: #2a5298;
}

.filter-chip.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.filter-chip .badge {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.filter-chip.active .badge {
    background: rgba(255, 255, 255, 0.3);
}

.filter-dot {
    font-size: 16px;
}

.filter-dot.meeting {
    color: #f57c00;
}

.filter-dot.pool {
    color: #1976d2;
}

.filter-dot.tennis {
    color: #388e3c;
}

/* ========================================================================
   LEGEND BAR
   ======================================================================== */

.legend-bar {
    background: #fff;
    padding: 16px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 24px;
    align-items: center;
    font-size: 13px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.legend-color.booked {
    background: #f44336;
}

.legend-color.my-booking {
    background: #2196f3;
}

.legend-color.passed {
    background: #e0e0e0;
}

.legend-color.proxy {
    background: #10b981;
}

/* ========================================================================
   CALENDAR GRID
   ======================================================================== */

.calendar-container {
    padding: 30px;
    overflow-x: auto;
    background: #fff;
}

.calendar-grid-inner {
    display: grid;
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    min-width: 1400px;
}

/* Time Headers */
.time-header {
    background: #f5f5f5;
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 10;
}

.time-header.facility-label {
    text-align: left;
    background: #2a5298;
    color: white;
    font-size: 14px;
}

/* Facility Label Cell */
.facility-label {
    background: white;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 2px solid #e0e0e0;
}

.facility-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.facility-meta {
    font-size: 12px;
    color: #666;
}

.facility-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    align-self: flex-start;
}

.facility-type-badge.meeting {
    background: #fff3e0;
    color: #f57c00;
}

.facility-type-badge.pool {
    background: #e3f2fd;
    color: #1976d2;
}

.facility-type-badge.tennis {
    background: #e8f5e9;
    color: #388e3c;
}

/* Time Slot Cells */
.time-slot {
    background: white;
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    position: relative;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Available Slots */
.time-slot.available {
    background: #e8f5e9;
    border: 2px solid transparent;
}

.time-slot.available:hover {
    background: #4caf50;
    color: white;
    transform: scale(1.03);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    border-radius: 6px;
}

.time-slot.available:hover::before {
    content: 'Book';
    font-weight: 600;
}

/* Booked Slots */
.time-slot.booked {
    background: #ffebee;
    color: #c62828;
    cursor: default;
}

/* User's Bookings */
.time-slot.my-booking {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
    cursor: pointer;
}

.time-slot.my-booking:hover {
    background: #1976d2;
    color: white;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.time-slot.my-booking:hover .booking-actions {
    opacity: 1;
}

/* Proxy Bookings */
.time-slot.proxy-booking {
    background: #d1fae5;
    color: #065f46;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #10b981;
}

.time-slot.proxy-booking:hover {
    background: #10b981;
    color: white;
    transform: scale(1.03);
}

.time-slot.proxy-booking:hover .booking-actions {
    opacity: 1;
}

/* Passed Time Slots */
.time-slot.passed {
    background: #fafafa;
    color: #999;
    cursor: default;
    opacity: 0.6;
}

/* Manager Deletable Indicator */
.time-slot.manager-deletable {
    border: 2px dashed #f59e0b !important;
}

.time-slot.manager-deletable:hover .booking-actions {
    opacity: 1;
}

/* Lot Number Display */
.lot-number {
    font-size: 13px;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.time-slot.booked .lot-number {
    background: rgba(198, 40, 40, 0.15);
}

.time-slot.my-booking .lot-number {
    background: rgba(21, 101, 192, 0.15);
}

.time-slot.proxy-booking .lot-number {
    background: rgba(6, 95, 70, 0.15);
}

/* Proxy Badge */
.proxy-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #10b981;
    color: white;
    border-radius: 3px;
    font-weight: 600;
}

/* Booking Actions */
.booking-actions {
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.delete-btn {
    padding: 4px 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* ========================================================================
   STATS BAR
   ======================================================================== */

.stats-bar {
    background: #f8f9fa;
    padding: 16px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 32px;
    font-size: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item .stat-value {
    font-weight: 600;
    font-size: 18px;
    color: #2a5298;
}

.stat-item .stat-label {
    color: #666;
}

/* ========================================================================
   MODAL OVERLAYS
   ======================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

/* Modal Header */
.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

/* Modal Content */
.modal-content {
    padding: 30px;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Booking Summary */
.booking-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

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

.summary-label {
    font-weight: 600;
    color: #666;
}

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

/* Booking Notes */
.booking-notes {
    margin-top: 20px;
}

.booking-notes label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.booking-notes textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.booking-notes textarea:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* Cancel Warning */
.cancel-warning {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 20px;
}

.warning-icon {
    font-size: 2rem;
}

.cancel-warning p {
    margin: 0;
    font-weight: 600;
    color: #856404;
}

.cancel-note {
    padding: 16px;
    background: #e3f2fd;
    border-radius: 6px;
    margin-top: 16px;
}

.cancel-note p {
    margin: 0;
    font-size: 13px;
    color: #1565c0;
}

/* Proxy Instructions */
.proxy-instructions {
    padding: 16px;
    background: #e8f5e9;
    border-radius: 6px;
    margin-bottom: 20px;
}

.proxy-instructions p {
    margin: 0;
    color: #2e7d32;
}

.proxy-note {
    padding: 16px;
    background: #fff3e0;
    border-radius: 6px;
    margin-top: 16px;
}

.proxy-note p {
    margin: 0;
    font-size: 13px;
    color: #e65100;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

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

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 1200px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .facility-filters {
        margin-left: 0;
        justify-content: flex-start;
    }
    
    .calendar-container {
        padding: 15px;
    }
    
    .legend-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .stats-bar {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .modal-container {
        width: 95%;
    }
}
