/* Brennan Park Recreation Centre - Styles */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Brand Colors */
    --red: #da291c;
    --teal: #3d6d73;
    --teal-dark: #115e67;
    --teal-link: #2a6a75;
    --dark: #231f20;
    --white: #fff;
    
    /* Neutrals - Improved contrast */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #6b7280;
    --gray-500: #4b5563;
    --gray-600: #374151;
    --gray-700: #1f2937;
    
    /* Status Colors */
    --status-info: #0284c7;
    --status-info-bg: #e0f2fe;
    --status-warning: #d97706;
    --status-warning-bg: #fef3c7;
    --status-error: #dc2626;
    --status-error-bg: #fee2e2;
    --status-success: #16a34a;
    --status-success-bg: #dcfce7;
    
    /* "Happening Now" indicator */
    --now-color: #16a34a;
    --now-bg: #dcfce7;
    --now-pulse: rgba(22, 163, 74, 0.4);
    
    /* "Coming Soon" indicator */
    --soon-color: #d97706;
    --soon-bg: #fef3c7;
    
    /* Focus ring */
    --focus-ring: 0 0 0 3px rgba(79, 134, 142, 0.5);
    
    /* Animation timing */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ========================================
   Dark Mode
   ======================================== */
/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Lato, Arial, sans-serif;
    font-size: 16px;
    background-color: #f0f0f0;
    color: #000;
    line-height: 1.6;
}

a {
    color: var(--teal-link);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

a:focus {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 2px;
}

/* ========================================
   Accessibility
   ======================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for all interactive elements */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--now-pulse);
    }
    50% {
        box-shadow: 0 0 0 6px transparent;
    }
}

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

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* ========================================
   Facility Status Banner
   ======================================== */
.facility-banner {
    background: var(--status-info-bg);
    border-bottom: 1px solid var(--status-info);
    animation: fadeIn 0.3s ease;
}

.facility-banner.banner-warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning);
}

.facility-banner.banner-error {
    background: var(--status-error-bg);
    border-color: var(--status-error);
}

.facility-banner.banner-success {
    background: var(--status-success-bg);
    border-color: var(--status-success);
}

.banner-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.banner-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.facility-banner .banner-icon {
    color: var(--status-info);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.facility-banner.banner-warning .banner-icon {
    color: var(--status-warning);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z'/%3E%3C/svg%3E");
}

.facility-banner.banner-error .banner-icon {
    color: var(--status-error);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.banner-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.banner-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.banner-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--gray-700);
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--white);
    border-top: 4px solid var(--teal);
    border-bottom: 1px solid var(--gray-200);
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
}

.header-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-700);
}

.header-text p {
    font-size: 14px;
    color: var(--gray-500);
}

.header-text p a {
    color: var(--gray-500);
    font-weight: 400;
}

.header-text p a:hover {
    color: var(--teal);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
    animation: fadeInUp 0.5s ease;
}

/* ========================================
   Page Title
   ======================================== */
.page-title {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.page-title h2 {
    font-size: 32px;
    font-weight: 300;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.page-title p {
    font-size: 16px;
    color: var(--gray-500);
}

/* ========================================
   Content Cards
   ======================================== */
.content-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    animation: fadeInUp 0.5s ease forwards;
}

.content-card:last-child {
    margin-bottom: 0;
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 1.25rem;
}

.card-title-note {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

/* ========================================
   Schedule Navigation
   ======================================== */
.schedule-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

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

.nav-btn svg {
    flex-shrink: 0;
}

.nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.nav-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-600);
    text-align: center;
}

.today-btn {
    padding: 0.25rem 0.625rem;
    background: var(--teal);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.today-btn:hover {
    background: var(--teal-dark);
}

.today-btn[hidden] {
    display: none;
}

/* ========================================
   Loading & Error States
   ======================================== */
.loading-state,
.error-state {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--teal);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

.loading-state p {
    color: var(--gray-500);
    font-size: 14px;
}

.error-state {
    background: var(--status-error-bg);
    border-radius: 8px;
}

.error-message {
    color: var(--status-error);
    font-weight: 500;
    margin-bottom: 1rem;
}

.retry-btn {
    padding: 0.625rem 1.25rem;
    background: var(--status-error);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ========================================
   Schedule Section
   ======================================== */
.schedule-section {
    margin-bottom: 1.25rem;
}

.schedule-section:last-of-type {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 1rem;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-700);
}

.section-note {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.schedule-content {
    animation: fadeIn 0.4s ease;
    transition: opacity 0.15s ease;
}

/* ========================================
   Desktop Schedule Table
   ======================================== */
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    table-layout: fixed;
}

.schedule-table th {
    text-align: left;
    padding: 0.75rem 0.875rem;
    background: var(--gray-100);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    transition: background-color var(--transition-fast);
}

.schedule-table th:first-child {
    border-top-left-radius: 6px;
}

.schedule-table th:last-child {
    border-top-right-radius: 6px;
}

.schedule-table th[scope="col"] {
    text-align: left;
}

.schedule-table th.today {
    background: var(--teal);
    color: #fff;
}

.schedule-table td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    border-right: 1px solid var(--gray-100);
    vertical-align: top;
    transition: background-color var(--transition-fast);
}

.schedule-table td:last-child {
    border-right: none;
}

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-table tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

.schedule-table tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

.schedule-table td:hover {
    background: var(--gray-50);
}

.schedule-table td.today {
    background: rgba(79, 134, 142, 0.06);
}

.time-slot {
    margin-bottom: 0.625rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px dashed var(--gray-200);
    transition: all var(--transition-fast);
}

.time-slot:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.slot-time {
    font-weight: 700;
    color: var(--gray-700);
    font-size: 13px;
    white-space: nowrap;
}

.slot-type {
    color: var(--gray-500);
    font-size: 13px;
}

.no-sessions {
    color: var(--gray-400);
    font-size: 14px;
}

/* ========================================
   "Happening Now" Indicator
   ======================================== */
.schedule-table td.happening-now {
    background: var(--now-bg);
}

.schedule-table td.happening-now .slot-time {
    color: var(--now-color);
}

.schedule-table td.happening-now .slot-status {
    font-weight: 700;
    color: var(--now-color);
    font-size: 12px;
    margin-top: 0.25rem;
}

.schedule-table td.coming-soon {
    background: var(--soon-bg);
}

.schedule-table td.coming-soon .slot-time {
    color: var(--soon-color);
}

.schedule-table td.coming-soon .slot-status {
    font-weight: 600;
    color: var(--soon-color);
    font-size: 12px;
    margin-top: 0.25rem;
}

/* ========================================
   Mobile Schedule
   ======================================== */
.mobile-schedule {
    display: none;
}

.mobile-card {
    background: var(--gray-50);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.mobile-card-header {
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-600);
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-sessions {
    padding: 0.5rem 1.25rem;
}

.mobile-session {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

.mobile-session:last-child {
    border-bottom: none;
}

.mobile-session-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mobile-status {
    font-size: 13px;
    margin-top: 0.125rem;
}

.mobile-session.happening-now {
    background: var(--now-bg);
    margin: 0 -1.25rem;
    padding: 0.875rem 1.25rem;
    border-bottom-color: transparent;
}

.mobile-session.happening-now .mobile-time {
    color: var(--now-color);
}

.mobile-session.happening-now .mobile-status {
    font-weight: 700;
    color: var(--now-color);
}

.mobile-session.coming-soon {
    background: var(--soon-bg);
    margin: 0 -1.25rem;
    padding: 0.875rem 1.25rem;
}

.mobile-session.coming-soon .mobile-time {
    color: var(--soon-color);
}

.mobile-session.coming-soon .mobile-status {
    font-weight: 600;
    color: var(--soon-color);
}

.mobile-time {
    font-weight: 700;
    color: var(--gray-700);
    font-size: 15px;
}

.mobile-type {
    color: var(--gray-500);
    font-size: 15px;
}

.mobile-no-sessions {
    color: var(--gray-400);
    padding: 1.5rem 0;
    text-align: center;
}

/* ========================================
   Rates Section
   ======================================== */
.rates-section {
    margin-bottom: 0;
}

.rates-section .section-header {
    margin-bottom: 1.25rem;
}

.rates-table-container {
    margin-bottom: 1.25rem;
}

.rates-table-container:last-of-type {
    margin-bottom: 0;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    table-layout: fixed;
}

.rates-table thead th:first-child,
.rates-table tbody th {
    width: 40%;
}

.rates-table thead th {
    padding: 0.75rem 0.875rem;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-600);
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.rates-table thead th:first-child {
    color: #fff;
    background: var(--teal);
}

.rates-table thead th.col-price {
    text-align: center;
}

.rates-table tbody th {
    padding: 0.75rem 0.875rem;
    text-align: left;
    font-weight: normal;
    border-bottom: 1px solid var(--gray-100);
}

.rates-table tbody td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.rates-table tbody tr:last-child th,
.rates-table tbody tr:last-child td {
    border-bottom: none;
}

.rates-table tbody tr {
    transition: background-color var(--transition-fast);
}

.rates-table tbody tr:hover {
    background: var(--gray-100);
}

.rates-table tbody td.col-price {
    text-align: center;
    font-weight: 600;
}

.rates-table .category-name {
    font-weight: 700;
    color: var(--gray-700);
}

.rates-table .category-age {
    font-size: 12px;
    color: var(--gray-500);
    display: block;
    margin-top: 2px;
}

/* Mobile rates */
@media (max-width: 900px) {
    .rates-table {
        font-size: 13px;
    }
    
    .rates-table th,
    .rates-table td {
        padding: 0.625rem 0.5rem;
    }
    
    .category-age {
        font-size: 11px;
    }
}

/* ========================================
   About Page
   ======================================== */
.about-content {
    line-height: 1.7;
}

.about-content p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

.about-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700);
    margin: 1.5rem 0 0.5rem;
}

.about-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.about-content li {
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.about-content .back-link {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 2rem;
    background: var(--white);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.footer a {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

.footer a:hover {
    color: var(--teal);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .schedule-table {
        display: none;
    }

    .mobile-schedule {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }
    
    .content-card {
        padding: 1.25rem;
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        box-shadow: none;
        border-top: 1px solid var(--gray-200);
        border-bottom: 1px solid var(--gray-200);
    }

    .page-title h2 {
        font-size: 28px;
    }
    
    .header-content {
        padding: 1rem 1.5rem;
    }
    
    .header-text h1 {
        font-size: 18px;
    }
    
    .footer {
        padding: 0.75rem 1.5rem;
    }
    
    .banner-content {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 500px) {
    .header-content {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .logo {
        height: 32px;
    }

    .header-text h1 {
        font-size: 18px;
    }

    .page-title h2 {
        font-size: 28px;
    }

    .footer {
        padding: 0.5rem 1rem;
    }
    
    .nav-btn-text {
        display: none;
    }
    
    .nav-btn {
        padding: 0.5rem;
    }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
