/* ==========================================================
   La Salle School Homa Bay — Swimming Pool System
   Palette sampled directly from real screenshots of the
   school's live homepage, staff login, and teacher dashboard:
     - Maroon gradient #2a0f07 → #6b2410  — header/sidebar/hero bg
     - Gold #e29120                       — "best." accent, badges
     - Orange→Red gradient #db821f→#c04b1d — primary buttons
     - Rust #b93b1d                        — secondary accent (Enroll pill)
     - Navy #27346b                        — logo wordmark only
     - Stat icon colors: blue #0070fc, green #008959,
       gold #ffbe00, cyan #00cdf2 (from the real dashboard cards)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

:root {
    --maroon-dark: #2a0f07;
    --maroon: #4a170b;
    --maroon-light: #6b2410;
    --gold: #e29120;
    --gold-icon: #ffbe00;
    --orange: #db821f;
    --red-orange: #c04b1d;
    --rust: #b93b1d;
    --navy: #27346b;
    --text: #2b1c14;
    --muted: #8a7a6f;
    --danger: #c04b1d;
    --success: #008959;
    --blue: #0070fc;
    --cyan: #00cdf2;
    --bg: #faf7f4;
    --border: #ece3da;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--maroon-dark), var(--maroon-light));
    padding: 12px 24px;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; }
.site-header .brand img {
    height: 40px;
    width: auto;
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 4px 8px;
}
.site-header .brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.site-header nav a {
    color: #f3e4d8;
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.site-header nav a:hover { color: var(--gold-icon); }

.container { max-width: 980px; margin: 0 auto; padding: 28px 24px; }

h1 { color: var(--maroon-light); font-weight: 800; }
h1 em, h1 .accent { color: var(--gold); font-style: italic; }
h2 { color: var(--maroon-light); font-weight: 700; margin-top: 32px; }

.muted { color: var(--muted); font-size: 0.9rem; }

.btn {
    display: inline-block;
    background: linear-gradient(90deg, var(--orange), var(--red-orange));
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-family: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: var(--gold); color: #3a2400; }
.btn-primary:hover { background: var(--gold-icon); }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--maroon-light);
}
.form input, .form select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: #fdfbf9;
}
.form input:focus, .form select:focus {
    outline: none;
    border-color: var(--orange);
    background: #fff;
}

.alert { padding: 11px 16px; border-radius: 8px; margin: 12px 0; font-size: 0.92rem; }
.alert-error { background: #fbe9e3; color: var(--red-orange); border: 1px solid #f0c7b6; }
.alert-success { background: #e2f3ea; color: var(--success); border: 1px solid #b9dcc5; }

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.sessions-table th, .sessions-table td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.sessions-table th {
    background: var(--maroon-light);
    color: #fdf3ea;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f1e7dd;
    color: var(--maroon-light);
}
.badge-confirmed, .badge-completed, .badge-open, .badge-public { background: #e2f3ea; color: var(--success); }
.badge-pending_payment, .badge-lesson { background: #fdf0da; color: #a8710f; }
.badge-cancelled, .badge-closed, .badge-maintenance { background: #fbe9e3; color: var(--red-orange); }
.badge-checked_in, .badge-school, .badge-training, .badge-event { background: #e5eefd; color: var(--blue); }

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    padding-left: 62px;
    flex: 1 1 170px;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 16px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--blue);
}
.stat-card:nth-child(1)::before { background: var(--blue); }
.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--gold-icon); }
.stat-card:nth-child(4)::before { background: var(--cyan); }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--muted); }

.admin-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

.ticket {
    background: #fff;
    border: 2px dashed var(--gold);
    border-radius: 14px;
    padding: 22px;
    max-width: 360px;
    text-align: center;
    margin: 16px 0;
}
.ticket h2 { margin-top: 0; }
.qr-code { margin: 14px 0; border-radius: 8px; }

.site-footer {
    text-align: center;
    padding: 22px;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ---------- Pool landing page ---------- */
.hero {
    background: linear-gradient(160deg, var(--maroon-dark), var(--maroon-light));
    border-radius: 18px;
    padding: 48px 40px;
    color: #fdf3ea;
    margin-bottom: 32px;
}
.hero-badge {
    display: inline-block;
    background: #ffeed4;
    color: var(--rust);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}
.hero-title {
    color: #fff;
    font-size: 2.2rem;
    line-height: 1.15;
    margin: 0 0 16px;
}
.hero-title .accent { color: var(--gold-icon); font-style: normal; }
.hero-sub {
    color: #e7d3c5;
    font-size: 1rem;
    max-width: 640px;
    line-height: 1.6;
    margin: 0 0 26px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); filter: none; }

.feature-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 36px;
}
.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    flex: 1 1 220px;
}
.feature-card h3 { margin: 14px 0 8px; color: var(--maroon-light); font-size: 1.02rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.3rem;
}
.feature-icon-blue { background: #e5eefd; }
.feature-icon-green { background: #dff3e8; }
.feature-icon-gold { background: #fdf0da; }
.feature-icon-cyan { background: #dcf7fc; }

.how-it-works { margin-bottom: 36px; }
.steps-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.step {
    flex: 1 1 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    position: relative;
}
.step strong { display: block; color: var(--maroon-light); margin: 10px 0 6px; font-size: 0.95rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--orange), var(--red-orange));
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

/* ==========================================================
   Landing page enhancements — hero video, gallery, motion
   All classes below are additive and scoped to public/index.php.
   Built entirely from the existing palette above; no new colors.
   ========================================================== */

/* ---- Hero: video background + scrim + floating bubbles ---- */
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.hero-media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -2;
}
.hero-media video,
.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}
.hero-scrim {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background:
        linear-gradient(160deg, rgba(42,15,7,0.93), rgba(74,23,11,0.88) 45%, rgba(107,36,16,0.72) 75%, rgba(219,130,31,0.35));
}
.hero-bubbles {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.hero-bubbles .bubble {
    position: absolute;
    bottom: -60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), rgba(255,255,255,0.03) 70%);
    animation: bubble-rise linear infinite;
}
@keyframes bubble-rise {
    0%   { transform: translateY(0) scale(1); opacity: 0; }
    12%  { opacity: 0.7; }
    100% { transform: translateY(-540px) scale(1.2); opacity: 0; }
}

/* ---- 3D tilt on feature cards (interaction-driven, JS-assisted) ---- */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    will-change: transform;
}
.tilt-card:hover {
    box-shadow: 0 18px 30px -12px rgba(74, 23, 11, 0.28);
}

/* ---- Continuously scrolling highlight strip ---- */
.highlight-marquee {
    overflow: hidden;
    background: linear-gradient(90deg, var(--maroon-dark), var(--maroon-light));
    border-radius: 999px;
    padding: 14px 0;
    margin: 0 0 36px;
}
.highlight-track {
    display: flex;
    gap: 48px;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}
.highlight-track span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fdf3ea;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}
.highlight-track span::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-icon);
    flex-shrink: 0;
}
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---- Gallery ---- */
.gallery-intro { max-width: 640px; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin: 20px 0 40px;
}
.gallery-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    aspect-ratio: 4 / 3;
}
.gallery-item.has-photo { cursor: zoom-in; }
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.gallery-item.has-photo:hover img { transform: scale(1.08); }
.gallery-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 10px 12px;
    background: linear-gradient(180deg, transparent, rgba(42,15,7,0.85));
    color: #fdf3ea;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(6px);
    transition: 0.25s ease;
}
.gallery-item.has-photo:hover .gallery-caption,
.gallery-item.has-photo:focus-visible .gallery-caption { opacity: 1; transform: translateY(0); }

.gallery-item.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    border: 2px dashed var(--border);
    background: #fdfbf9;
    color: var(--muted);
    text-align: center;
    padding: 16px;
}
.gallery-item.placeholder .placeholder-icon { font-size: 1.8rem; }
.gallery-item.placeholder span { font-size: 0.82rem; line-height: 1.4; }

/* ---- Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(20, 8, 4, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
}
.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-overlay figure { margin: 0; text-align: center; }
.lightbox-overlay img {
    max-width: min(90vw, 900px);
    max-height: 78vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: block;
}
.lightbox-caption { color: #fdf3ea; margin-top: 14px; font-size: 0.9rem; }
.lightbox-close {
    position: absolute;
    top: 22px;
    right: 26px;
    color: #fff;
    font-size: 1.9rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
}

/* ---- Video tour placeholder slots ---- */
.video-tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 20px 0 40px;
}
.video-slot {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f1e7dd;
}
.video-slot.filled video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-slot-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 10px 14px;
    background: linear-gradient(180deg, transparent, rgba(42,15,7,0.85));
    color: #fdf3ea;
    font-size: 0.85rem;
    font-weight: 600;
}
.video-slot.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed var(--border);
    color: var(--muted);
    text-align: center;
    padding: 20px;
}
.play-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--maroon-light);
}

/* ---- Reduced motion: turn off ambient/continuous animation ---- */
@media (prefers-reduced-motion: reduce) {
    .hero-bubbles .bubble,
    .highlight-track,
    .gallery-item img,
    .video-slot img {
        animation: none !important;
        transition: none !important;
    }
    .tilt-card { transition: none; }
}

/* ---- Small screens ---- */
@media (max-width: 640px) {
    .hero { padding: 36px 24px; }
    .hero-title { font-size: 1.7rem; }
    .highlight-track { gap: 28px; animation-duration: 20s; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ==========================================================
   App shell — sidebar + topbar layout for staff pages
   (admin, instructor, teacher, lifeguard). Customer-facing
   public/ pages keep the simpler top-nav layout above.
   ========================================================== */

.app-body { margin: 0; background: var(--bg); }

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--maroon-dark), var(--maroon-light));
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    color: #f3e4d8;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
}
.app-sidebar-brand img {
    height: 34px;
    background: #fff;
    border-radius: 8px;
    padding: 3px 6px;
}
.app-sidebar-brand strong { display: block; color: #fff; font-size: 0.95rem; }
.app-sidebar-brand span { display: block; color: #d9b79f; font-size: 0.72rem; }

.app-profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 18px;
}
.app-profile-card strong { display: block; color: #fff; font-size: 0.88rem; }
.app-profile-card span { display: flex; align-items: center; gap: 5px; color: #d9b79f; font-size: 0.75rem; margin-top: 2px; }

.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--orange), var(--red-orange));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.app-avatar-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 0.72rem; }

.app-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

.app-nav { flex: 1; overflow-y: auto; }
.app-nav-heading {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: #c99a7c;
    font-weight: 700;
    margin: 16px 10px 6px;
}
.app-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #f3e4d8;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.app-nav-link:hover { background: rgba(255,255,255,0.08); }
.app-nav-link.active { background: rgba(255,255,255,0.16); color: #fff; }
.app-nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.app-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.app-sidebar-footer a {
    color: #d9b79f;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 6px 10px;
}
.app-sidebar-footer a:hover { color: #fff; }

.app-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.app-search { flex: 1; max-width: 420px; }
.app-search input {
    width: 100%;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.85rem;
}
.app-topbar-actions { display: flex; align-items: center; gap: 10px; }
.app-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.app-alert-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red-orange);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.3;
}
.app-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--maroon-light);
}

.app-main { flex: 1; padding: 28px; max-width: 1100px; width: 100%; }
.app-footer { text-align: center; padding: 18px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--border); }

/* Welcome banner used on each role's landing/dashboard page */
.welcome-banner {
    background: linear-gradient(135deg, var(--maroon-dark), var(--maroon-light));
    border-radius: 16px;
    padding: 28px 32px;
    color: #fdf3ea;
    margin-bottom: 24px;
}
.welcome-banner h1 { color: #fff; margin: 0 0 6px; font-size: 1.5rem; }
.welcome-banner h1 .accent { color: var(--gold-icon); }
.welcome-banner p { color: #e7d3c5; margin: 0; font-size: 0.9rem; }
.welcome-banner .banner-datetime {
    display: inline-block;
    margin-top: 14px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: #ffe6cf;
}

/* Colored top-border stat cards, used on the 4 role dashboards */
.stat-card-v2 {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--blue);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.stat-card-v2:nth-child(4n+1) { border-top-color: var(--blue); }
.stat-card-v2:nth-child(4n+2) { border-top-color: var(--gold-icon); }
.stat-card-v2:nth-child(4n+3) { border-top-color: var(--rust); }
.stat-card-v2:nth-child(4n+4) { border-top-color: var(--success); }
.stat-card-v2 .stat-label-v2 {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}
.stat-card-v2 .stat-value-v2 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.stat-card-v2 .stat-icon-v2 { font-size: 1.4rem; }

@media (max-width: 800px) {
    .app-sidebar { position: fixed; z-index: 50; height: 100vh; transform: translateX(-100%); transition: transform 0.2s; }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { padding: 18px; }
    .app-search { display: none; }
}
