/* ===== Sports Reservation — Page-specific Styles =====
   Extends the main website styles.css
   Uses the same CSS variables from :root
*/

/* ===== Navbar (Photos-style) ===== */
#main-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 1000;
    background: var(--primary-red);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

#main-header.scrolled {
    top: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    background: var(--primary-red);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

#main-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    text-decoration: none;
}

#main-header .logo-icon {
    width: 32px;
    height: 32px;
}

#main-header .nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

#main-header .nav-links li a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

#main-header .nav-links li a:hover {
    background: rgba(255, 255, 255, 0.15);
}

#main-header .nav-links li a.active-link {
    background: rgba(255, 255, 255, 0.2);
}

#main-header .nav-user {
    font-weight: 600 !important;
    cursor: default;
}

#main-header .nav-logout {
    opacity: 0.8;
    padding: 0.5rem !important;
}

#main-header .nav-logout:hover {
    opacity: 1;
}

#main-header .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

#main-header .hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Sports Page Layout ===== */
.sports-page {
    padding: 140px 5% 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.sports-header {
    text-align: center;
    margin-bottom: 2rem;
}

.sports-header h1 {
    font-size: 2.5rem;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.sports-header p {
    color: var(--secondary-text);
    font-size: 1.05rem;
}

/* ===== Login Card (matches Photos login) ===== */
#login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--primary-red);
    border-radius: var(--border-radius);
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(159, 66, 66, 0.3);
    text-align: center;
}

.login-logo {
    width: 72px;
    height: auto;
    margin-bottom: 1.5rem;
}

.login-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: white;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.login-form .form-label {
    color: white;
}

.login-form .form-input {
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: var(--neutral-text);
}

.login-form .form-input:focus {
    border-color: white;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.login-form .form-input::placeholder {
    color: #bbb;
}

.login-card .cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    background: white;
    color: var(--primary-red);
    border: none;
    border-radius: var(--border-radius-sm, 10px);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.login-card .cta-button:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.login-card .error-banner {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.login-footer-text {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Date Picker ===== */
.date-picker {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.date-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--neutral-text);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 100px;
    box-shadow: var(--shadow-sm);
}

.date-btn:hover {
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

.date-btn.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    box-shadow: 0 6px 20px rgba(159, 66, 66, 0.25);
}

.date-btn .day-name {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.date-btn .day-num {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* ===== Slots Grid ===== */
.slots-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-text);
}

.empty-state svg {
    margin-bottom: 1rem;
    color: var(--secondary-text);
    opacity: 0.4;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Slot Row */
.slot-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.slot-time {
    width: 110px;
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-text);
    background: white;
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-sm);
}

.slot-courts {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.court-slot {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.04);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.court-slot .court-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--secondary-text);
}

.court-slot .court-status {
    font-size: 0.75rem;
    color: #3db87a;
    font-weight: 500;
}

.court-slot:hover {
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.court-slot.booked {
    background: var(--bg-light);
    border-color: transparent;
    cursor: default;
    opacity: 0.6;
    box-shadow: none;
}

.court-slot.booked:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.court-slot.booked .court-status {
    color: var(--secondary-red);
}

.court-slot.own-booking {
    background: rgba(159, 66, 66, 0.06);
    border-color: var(--primary-red);
    opacity: 1;
}

.court-slot.own-booking .court-status {
    color: var(--primary-red);
}

/* Court type labels at top */
.courts-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.courts-header .header-spacer {
    width: 110px;
    min-width: 110px;
}

.courts-header .header-labels {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.courts-header .court-label {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-text);
    padding: 0.5rem;
}

.court-label.padel-label {
    color: var(--primary-blue);
}

.court-label.pickleball-label {
    color: var(--primary-yellow);
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-text);
    padding: 4px;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-light);
}

.modal-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    color: var(--secondary-text);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===== Forms ===== */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-red);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--secondary-text);
    margin-bottom: 0.75rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: var(--secondary-text);
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    color: var(--neutral-text);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(159, 66, 66, 0.1);
}

.player-info {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

/* ===== Buttons ===== */
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: 0 6px 20px rgba(159, 66, 66, 0.2);
}

.submit-btn:hover {
    background: var(--secondary-red);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 0.7rem 1.5rem;
    background: var(--bg-light);
    color: var(--neutral-text);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.btn-secondary:hover {
    border-color: var(--primary-red);
}

.btn-danger {
    padding: 0.7rem 1.5rem;
    background: var(--secondary-red);
    color: white;
    border: none;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.btn-danger:hover {
    background: var(--primary-red);
}

/* ===== Error / Success ===== */
.error-banner {
    background: rgba(222, 89, 89, 0.08);
    color: var(--secondary-red);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.success-content {
    text-align: center;
}

.success-icon {
    color: #3db87a;
    margin-bottom: 1rem;
}

.success-content h3 {
    margin-bottom: 0.5rem;
}

.success-content p {
    color: var(--secondary-text);
    margin-bottom: 1.5rem;
}

/* ===== Reservation Cards (My Reservations) ===== */
.reservation-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.reservation-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.reservation-card + .reservation-card {
    margin-top: 0.75rem;
}

.reservation-info {
    flex: 1;
}

.reservation-info .res-court {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-red);
}

.reservation-info .res-datetime {
    font-size: 0.95rem;
    color: var(--secondary-text);
    margin-top: 0.15rem;
}

.reservation-info .res-players {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin-top: 0.5rem;
    opacity: 0.7;
}

.cancel-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: 2px solid var(--secondary-red);
    color: var(--secondary-red);
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.cancel-btn:hover {
    background: var(--secondary-red);
    color: white;
}

.invited-badge {
    padding: 0.4rem 0.9rem;
    background: var(--accent-blue);
    color: white;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.reservation-card.past {
    opacity: 0.5;
}

.reservation-card.past:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
}

.past-badge {
    padding: 0.4rem 0.9rem;
    background: var(--secondary-text);
    color: white;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== Pricing Panel ===== */
.pricing-panel {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.pricing-title {
    margin: 0;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid #eee;
}

.pricing-note {
    margin: 0;
    padding: 0.6rem 1.25rem 1rem;
    font-size: 0.85rem;
    color: var(--secondary-text);
    font-style: italic;
    text-align: center;
}

.pricing-table-wrap {
    overflow-x: auto;
    padding: 0.5rem 1.25rem 0.5rem;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pricing-table th,
.pricing-table td {
    padding: 0.65rem 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.pricing-table thead th {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #eee;
}

.pricing-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.pricing-table .row-label {
    text-align: left;
    font-weight: 600;
    color: #333;
}

.pricing-table tbody td:not(.row-label) {
    font-weight: 600;
    color: var(--primary-red);
}

/* ===== Closure Banner ===== */
.closure-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(159, 66, 66, 0.06);
    border: 2px solid var(--primary-red);
    border-radius: 16px;
    margin-bottom: 2rem;
    color: var(--neutral-text);
}

.closure-banner i {
    color: var(--primary-red);
    margin-top: 2px;
}

.closure-banner strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: var(--primary-red);
}

.closure-banner p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary-text);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    #main-header {
        top: 10px;
        width: 95%;
        border-radius: 20px;
    }

    #main-header nav {
        padding: 0.6rem 1.2rem;
    }

    #main-header .hamburger {
        display: flex;
    }

    #main-header .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-red);
        border-radius: 0 0 20px 20px;
        padding: 1rem;
        flex-direction: column;
        gap: 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    #main-header .nav-links.active {
        display: flex;
    }

    #main-header .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    #main-header .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    #main-header .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .sports-page {
        padding-top: 100px;
    }

    .sports-header h1 {
        font-size: 1.8rem;
    }

    .date-btn {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
    }

    .date-btn .day-num {
        font-size: 1rem;
    }

    .slot-row {
        flex-direction: column;
    }

    .slot-time {
        width: 100%;
        min-width: auto;
        padding: 0.5rem;
        justify-content: flex-start;
        font-weight: 700;
        background: var(--primary-red);
        color: white;
        border: none;
        box-shadow: none;
    }

    .slot-courts {
        flex-wrap: wrap;
    }

    .court-slot {
        min-width: calc(50% - 0.25rem);
        flex: 0 0 calc(50% - 0.25rem);
    }

    .courts-header {
        display: none;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .reservation-card {
        flex-direction: column;
        align-items: stretch;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* ===== Admin Panel ===== */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.25rem;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-text);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.admin-tab:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.admin-tab.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.export-tab {
    background: var(--bg-light);
}

/* Admin Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: white;
}

.admin-table th {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-text);
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

.admin-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: top;
}

.admin-table tbody tr:hover {
    background: rgba(159, 66, 66, 0.02);
}

.admin-table .meta {
    font-size: 0.78rem;
    color: var(--secondary-text);
    opacity: 0.7;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-padel {
    background: rgba(52, 120, 246, 0.1);
    color: var(--primary-blue);
}

.badge-pickleball {
    background: rgba(255, 186, 0, 0.12);
    color: #c8920a;
}

.badge-cat {
    background: rgba(159, 66, 66, 0.08);
    color: var(--primary-red);
}

/* Day Reservations */
.day-res-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 0, 0, 0.06);
}

.day-res-title {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 1rem;
    color: var(--neutral-text);
}

.date-btn .day-count {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .admin-table {
        font-size: 0.8rem;
    }
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.6rem;
    }
}
