/* ==========================================================================
   1. GLOBAL & RESET
   ========================================================================== */
:root {
    --primary-red: #c0392b;
    --dark-red: #a93226;
    --dark-gray: #2c3e50;
    --light-gray: #f8f9fa; /* Customer BG */
    --admin-bg: #f4f6f9;   /* Admin BG */
    --white: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);

    /* STATUS COLORS */
    --status-open-bg: #e0f7e4; --status-open-text: #28a745;
    --status-tentative-bg: #fff3cd; --status-tentative-text: #856404;
    --status-booked-bg: #ffebee; --status-booked-text: #c62828;
    --status-selected-bg: #cce5ff; --status-selected-text: #004085;
    --status-blocked-bg: #e9ecef;
}

body { font-family: 'Segoe UI', sans-serif; background-color: var(--light-gray); margin: 0; padding: 0; color: #333; min-height: 100vh; display: flex; flex-direction: column;}

/* ==========================================================================
   2. CUSTOMER & SHARED HEADER
   ========================================================================== */
header { background: var(--white); padding: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.logo { height: 40px; width: auto; }
header h1 { margin: 0; font-size: 1.2rem; color: var(--dark-gray); }

/* ==========================================================================
   3. CUSTOMER PAGES (Index & Booking Grid)
   ========================================================================== */
.container { max-width: 1200px; margin: 10px auto; padding: 0 5px; padding-bottom: 40px; flex: 1; width: 100%; box-sizing: border-box; }

/* Landing Page Buttons */
.sport-selection-container { display: flex; flex-direction: column; gap: 15px; align-items: center; margin-top: 40px; }
@media (min-width: 768px) { .sport-selection-container { flex-direction: row; flex-wrap: wrap; justify-content: center; } }
.sport-card { background: white; border: 1px solid var(--border-color); border-radius: 12px; width: 100%; max-width: 300px; height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; color: var(--dark-gray); font-size: 1.5rem; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: transform 0.2s; }
@media (min-width: 768px) { .sport-card { height: 200px; font-size: 1.8rem; } }

/* Booking Grid */
.controls-bar { background: white; padding: 10px; border-radius: 8px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 0.9rem; }
.back-btn { text-decoration: none; color: var(--dark-gray); font-weight: 600; }
.table-responsive { overflow-x: auto; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); -webkit-overflow-scrolling: touch; }
.booking-grid { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.booking-grid th, .booking-grid td { padding: 4px 2px; text-align: center; border-bottom: 1px solid var(--border-color); border-right: 1px solid #f1f1f1; min-width: 65px; max-width: 80px; word-wrap: break-word; white-space: normal; }
.booking-grid th:first-child, .booking-grid td:first-child { position: sticky; left: 0; z-index: 2; background-color: #f8f9fa; border-right: 2px solid #dee2e6; width: 45px; min-width: 45px; max-width: 45px; font-weight: bold; color: #555; font-size: 0.7rem; line-height: 1.1; white-space: normal; vertical-align: middle; }
.booking-grid thead th { position: sticky; top: 0; z-index: 1; background-color: #f1f3f5; color: #333; font-size: 0.75rem; vertical-align: bottom; }
.booking-grid thead th:first-child { z-index: 3; }

/* Grid Cell Colors */
.cell-open { background-color: var(--status-open-bg); color: var(--status-open-text); cursor: pointer; }
.cell-selected { background-color: var(--status-selected-bg) !important; color: var(--status-selected-text) !important; border: 1px solid #0056b3; font-weight: bold; }
.cell-booked { background-color: var(--status-booked-bg); color: var(--status-booked-text); font-size: 0.7rem; font-weight: bold; cursor: not-allowed; }
.cell-tentative { background-color: var(--status-tentative-bg); color: var(--status-tentative-text); font-size: 0.7rem; font-weight: bold; cursor: pointer; border: 1px dashed #ffeeba; }
.cell-blocked { background-color: var(--status-blocked-bg); color: #adb5bd; }

/* Footer */
.checkout-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: white; padding: 10px 15px; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); display: flex; justify-content: space-between; align-items: center; z-index: 100; box-sizing: border-box; }
.btn-submit { background-color: var(--primary-red); color: white; border: none; padding: 8px 20px; border-radius: 4px; font-size: 0.9rem; font-weight: 600; }

/* ==========================================================================
   4. ADMIN PANEL STYLES
   ========================================================================== */
.admin-header { background: white; padding: 0.8rem 2rem; display: flex; justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.admin-brand { display: flex; align-items: center; gap: 15px; font-size: 1.2rem; font-weight: bold; color: var(--dark-gray); text-decoration: none; }
.logo-admin { height: 40px; width: auto; }
.admin-nav-link { text-decoration: none; color: var(--primary-red); font-weight: 600; font-size: 0.9rem; }

.admin-wrapper { display: flex; flex-wrap: wrap; max-width: 1200px; margin: 20px auto; padding: 0 15px; gap: 20px; align-items: flex-start; }
.admin-sidebar { flex: 1; min-width: 300px; background: white; border-radius: 8px; box-shadow: var(--shadow); padding: 20px; }
.admin-main { flex: 2; min-width: 300px; background: white; border-radius: 8px; box-shadow: var(--shadow); padding: 30px; }

.sidebar-title { margin-top: 0; font-size: 1.1rem; color: var(--dark-gray); border-bottom: 2px solid var(--primary-red); padding-bottom: 10px; margin-bottom: 15px; }
.court-list-item { display: block; background: #fff; border: 1px solid var(--border-color); border-left: 4px solid var(--dark-gray); padding: 15px; margin-bottom: 10px; text-decoration: none; color: #555; border-radius: 4px; transition: all 0.2s; }
.court-list-item:hover { transform: translateX(3px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.court-list-item.active { border-left-color: var(--primary-red); background-color: #fff5f5; }
.court-sport { font-weight: 800; color: var(--dark-gray); text-transform: uppercase; font-size: 0.9rem; }
.court-name { font-size: 1rem; margin-top: 2px; display: block; }
.court-meta { font-size: 0.8rem; color: #888; margin-top: 5px; display: block; }

.form-header { margin-top: 0; color: var(--dark-gray); margin-bottom: 20px; }
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; font-size: 0.9rem; }
input[type="text"], input[type="number"], input[type="time"], input[type="date"], select { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 1rem; box-sizing: border-box; }
input:focus, select:focus { outline: none; border-color: var(--primary-red); }

.btn { display: inline-block; padding: 12px 25px; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; font-weight: 600; text-align: center; transition: background 0.2s; }
.btn-primary { background-color: var(--primary-red); color: white; width: 100%; }
.btn-primary:hover { background-color: var(--dark-red); }
.btn-secondary { background-color: var(--dark-gray); color: white; text-decoration: none; padding: 10px 15px; border-radius: 4px; font-size: 0.9rem; display: block; text-align: center; margin-bottom: 15px; }
.btn-delete { background: none; border: none; color: #999; text-decoration: underline; cursor: pointer; margin-top: 15px; font-size: 0.9rem; display: block; width: 100%; }

/* ==========================================================================
   5. CONFIRMATION PAGE (Receipt Style)
   ========================================================================== */
.summary-page-body { background-color: #eff2f5; padding: 20px 10px; min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; }
.summary-card { background: white; width: 100%; max-width: 420px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); padding: 30px 20px; box-sizing: border-box; text-align: center; margin-top: 10px; }
.success-title { color: #d35400; font-size: 1.5rem; margin: 5px 0; }
.sport-badge { display: inline-block; background-color: var(--dark-gray); color: white; font-size: 0.8rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; margin-bottom: 5px; letter-spacing: 1px; }
.ref-id { font-size: 0.8rem; color: #999; margin: 0; text-transform: uppercase; letter-spacing: 1px;}
.ref-date { font-size: 1rem; color: #555; margin: 5px 0 0 0; font-weight: 600; }
.divider { border: 0; border-top: 1px dashed #ddd; margin: 20px 0; }
.booking-details-list { text-align: left; margin-bottom: 20px; }
.booking-group { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.group-court-name { font-size: 1rem; font-weight: 700; color: #333; margin-bottom: 4px; }
.group-times { font-size: 0.9rem; color: #666; line-height: 1.4; padding-left: 0; }
.total-section { display: flex; justify-content: space-between; align-items: center; background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.total-amount { font-size: 1.4rem; font-weight: 800; color: var(--primary-red); }
.gcash-card { background: #eef7ff; border: 1px solid #cce5ff; border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.gcash-label { font-size: 0.85rem; font-weight: 600; color: #004085; text-transform: uppercase; }
.gcash-number { font-size: 1.6rem; font-weight: 800; color: #007bff; letter-spacing: 1px; margin-top: 5px; }
.instruction-box { background: #fff8d6; border: 1px solid #ffeeba; border-left: 5px solid #ffc107; padding: 15px; border-radius: 6px; text-align: left; margin-bottom: 20px; }
.instruction-header { font-size: 0.9rem; font-weight: 800; color: #856404; margin-bottom: 8px; text-transform: uppercase; }
.urgent-note { font-size: 0.85rem; color: #c0392b; background: rgba(255, 255, 255, 0.6); padding: 8px; border-radius: 4px; margin-bottom: 10px; border: 1px dashed #c0392b; }
.instruction-step { font-size: 0.9rem; color: #555; margin-bottom: 5px; line-height: 1.4; }
.fb-btn { display: block; width: 100%; background: #1877f2; color: white; text-decoration: none; padding: 14px 0; border-radius: 8px; font-weight: 600; text-align: center; box-shadow: 0 4px 6px rgba(24, 119, 242, 0.2); transition: background 0.2s; }
.fb-btn:hover { background: #1465c1; }
.home-link { display: block; margin-top: 20px; color: #999; font-size: 0.9rem; text-decoration: none; }

/* ==========================================================================
   6. MODALS
   ========================================================================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal-box { background: white; width: 90%; max-width: 400px; padding: 25px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); text-align: center; position: relative; }
.modal-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; color: #333; }
.modal-body { font-size: 0.95rem; color: #555; margin-bottom: 20px; line-height: 1.5; }
.modal-btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 6px; font-size: 1rem; font-weight: bold; cursor: pointer; text-decoration: none; margin-top: 10px; }
.btn-fb { background: #1877f2; color: white; }
.btn-close { background: #e0e0e0; color: #333; }
.btn-confirm { background: #28a745; color: white; }
.btn-delete-modal { background: #dc3545; color: white; }

/* ==========================================================================
   7. SITE FOOTER (NEW)
   ========================================================================== */
.site-footer {
    background-color: var(--dark-gray);
    color: #bdc3c7;
    text-align: center;
    padding: 30px 20px;
    margin-top: auto; 
    border-top: 4px solid var(--primary-red);
}

.footer-content h3 {
    color: var(--white);
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: bold;
}

.footer-content p {
    margin: 5px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-content a {
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px dotted #7f8c8d;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.copyright {
    margin-top: 20px !important;
    font-size: 0.8rem !important;
    color: #7f8c8d;
    border-top: 1px solid #34495e;
    padding-top: 15px;
}