﻿/* -----------------------------------------------------------
   FiveAlarmWeb — Global Styles with Light/Dark Themes
   - Professional typeface (Inter)
   - Tuned spacing & colors via CSS variables
   - Responsive, accessible dark mode
----------------------------------------------------------- */

/* ========== Design Tokens (Light) ========== */
:root {
    /* Typography */
    --ff-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    --fs-root: 16px;
    --radius-sm: .375rem;
    --radius-md: .5rem;
    --radius-lg: .75rem;
    /* Spacing Scale */
    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: .75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    /* Layout */
    --navbar-h: 72px;
    /* Palette (Light) */
    --bg-body: #F7F7F8;
    --bg-surface: #FFFFFF;
    --bg-elev: #FFFFFF;
    --bg-subtle: #F1F3F5;
    --text: #1F2937;
    --text-muted: #4B5563;
    --text-on-dark: #FFFFFF;
    --brand: #C02B2B; /* Fire red */
    --brand-2: #FF5C2A; /* Ember orange */
    --primary: #0D6EFD; /* Bootstrap-ish primary */
    --primary-weak: rgba(13,110,253,.08);
    --border: rgba(0,0,0,.12);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    /* Sidebar */
    --sidebar-text: #FFFFFF;
    --sidebar-border: rgba(255,255,255,.15);
    /* Buttons */
    --btn-focus-ring: #258cfb;
    /* Cards / Accents */
    --card-gradient-start: #B22222;
    --card-gradient-end: #FF4500;
    /* Payments */
    --paypal-gold: #FFC439;
    --venmo-blue: #3D95CE;
    /* Links */
    --link: #0D6EFD;
    --link-hover: #0B5ED7;
    /* Transitions */
    --trans-fast: 150ms ease;
}

    /* ========== Design Tokens (Dark) ========== */
    :root[data-theme="dark"] {
        --bg-body: #0F1216;
        --bg-surface: #12161B;
        --bg-elev: #161B22;
        --bg-subtle: #0C0F13;
        --text: #E5E7EB;
        --text-muted: #9CA3AF;
        --primary: #66A3FF;
        --primary-weak: rgba(102,163,255,.12);
        --border: rgba(255,255,255,.12);
        --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
        --shadow-md: 0 6px 16px rgba(0,0,0,.6);
        --sidebar-text: #FFFFFF;
        --sidebar-border: rgba(255,255,255,.12);
        --card-gradient-start: #A61D1D;
        --card-gradient-end: #E14B20;
        --link: #66A3FF;
        --link-hover: #8BB9FF;
    }

/* Respect OS preference on first load */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        color-scheme: light;
    }
}

/* ========== Base & Accessibility ========== */
@media (min-width: 768px) {
    html {
        font-size: var(--fs-root);
    }
}

/* ========== LINES 100-120: COMPLETE REPLACEMENT ========== */
html {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto; /* html is the scroll container */
}

body {
    min-height: 100%;
    margin: 0;
    margin-top: var(--navbar-h);
    padding-top: 0;
    display: block;
    background: var(--bg-body);
    color: var(--text);
    font-family: var(--ff-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: visible;
}


/* Navbar */
.navbar {
  border-bottom: none !important;
  box-shadow: none; /* optional: removes any shadow line too */
}
/* Use the same surface color as the sidebar */
.navbar-dark.bg-dark {
    background-color: var(--header-bg) !important;
    color: var(--header-fg) !important;
}

    /* Ensure links/brand inherit readable color on both themes */
    .navbar-dark.bg-dark .navbar-brand,
    .navbar-dark.bg-dark .nav-link,
    .navbar-dark.bg-dark .navbar-text {
        color: var(--header-fg) !important;
    }

        .navbar-dark.bg-dark .nav-link:hover,
        .navbar-dark.bg-dark .nav-link.active {
            color: #fff !important;
        }


/* ========== Sidebar ========== */
.sidebar {
    width: 240px;
    background-size: cover;
    background-blend-mode: multiply;
    background-attachment: fixed, fixed;
    font-size: 1.125rem;
    padding: var(--sp-4);
    color: var(--sidebar-text);
    position: sticky;
    top: 0;
    height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
    text-align: center;
    border-right: 1px solid var(--sidebar-border);
}

    .sidebar img {
        max-width: 96px;
        margin-bottom: var(--sp-4);
        animation: pulse 2s infinite;
        background-color: rgba(0,0,0,.3);
        padding: .5rem;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }

    .sidebar .nav-link {
        color: #fff;
        margin: .25rem 0;
        padding: .4rem .6rem;
        border-radius: var(--radius-sm);
        transition: background-color var(--trans-fast), color var(--trans-fast);
    }

        .sidebar .nav-link:hover {
            text-decoration: none;
            background: rgba(255,255,255,.12);
        }

        .sidebar .nav-link.active,
        .sidebar .nav-link[aria-current="page"] {
            color: #fff;
            background: rgba(255,255,255,.18);
            font-weight: 700;
        }

/* ========== Content ========== */
.content {
    flex-grow: 1;
    padding: 2rem;
    overflow: visible;
    background-color: #F9F7F3;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

header.banner-wrap {
    position: relative;
    block-size: 20vh;
    min-block-size: 120px;
    max-block-size: 260px;
    overflow: visible;
    margin: 0;
    padding: 0;
}

    header.banner-wrap .banner {
        position: absolute;
        inset: 0;
        inline-size: 100%;
        block-size: 100%;
        object-fit: fill;
        display: block;
        border: 0;
        box-shadow: var(--shadow-sm);
    }

/* ==== Full-bleed banner: cancel .content side padding visually ==== */
main.content.with-banner {
    /* you already set padding-top: 0 earlier; this just makes it explicit */
    padding-top: 0;
}

/* Pull the banner out to the viewport edges within the content area */
.content.with-banner > .banner-wrap {
    margin-left: -2rem; /* match .content { padding: 2rem } */
    margin-right: -2rem; /* match .content { padding: 2rem } */
}

/* Inline preview overlay matches same box */
.banner-preview-inline {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    grid-template-rows: 1fr;
    align-items: stretch;
    background: color-mix(in oklab, var(--bg-surface) 12%, transparent);
    backdrop-filter: saturate(140%) blur(2px);
    padding: 0;
}

    /* Preview image: behave exactly like live banner (stretch) */
    .banner-preview-inline img#bannerPreviewImg {
        inline-size: 100%;
        block-size: 100%;
        object-fit: fill; /* <-- stretch to fit */
        display: block;
        border: 0;
        background: transparent;
        pointer-events: none; /* clicks go to actions */
    }

    /* Confirm/Cancel pill */
    .banner-preview-inline .banner-preview-actions {
        position: absolute;
        right: .5rem;
        bottom: .5rem;
        z-index: 6;
        display: inline-flex;
        gap: .5rem;
        background: color-mix(in oklab, var(--bg-surface) 85%, transparent 15%);
        border: 1px solid var(--border);
        padding: .25rem .5rem;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }

/* Admin FAB on banner */
.banner-actions {
    position: absolute;
    right: 1rem;
    top: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: color-mix(in oklab, var(--bg-surface) 80%, transparent 20%);
    padding: .25rem .5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.banner-fab {
    position: absolute;
    right: .5rem;
    top: .5rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--bg-surface) 78%, transparent 22%);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    opacity: .8;
    transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
}

    .banner-fab:hover {
        opacity: 1;
        transform: translateY(-1px);
    }

/* Smooth banner transitions */
header.banner-wrap .banner {
    transition: opacity 240ms ease, filter 240ms ease;
}

    header.banner-wrap .banner.is-fading-out {
        opacity: .25;
        filter: blur(1px);
    }

@keyframes bannerFadeIn {
    from {
        opacity: 0;
        filter: blur(2px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

header.banner-wrap .banner.banner-fade-in {
    animation: bannerFadeIn 360ms ease-out both;
}

/* ========== Components ========== */

/* Panels & images */
.panel-image,
.panel-image-large,
.panel-image-grid-full {
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--bg-elev);
}

.panel-image {
    height: 280px;
}

.panel-image-large {
    max-height: 520px;
    object-fit: contain;
    cursor: zoom-in;
    margin-bottom: var(--sp-4);
}

.panel-image-grid-full {
    height: 100%;
    cursor: zoom-in;
}

/* Carousel slides fill viewport with internal scroll */
.carousel-item {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    background-color: var(--bg-subtle);
    padding: var(--sp-8);
}

/* Panel slide wrapper */
.panel-slide {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, var(--bg-subtle), var(--bg-elev));
    overflow: hidden;
    padding: var(--sp-8);
}

.panel-content-wrapper {
    max-width: 1400px;
    width: 100%;
}

/* Text blocks / cards */
.text-block {
    background-color: color-mix(in oklab, var(--bg-surface) 92%, transparent 8%);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-sm);
    margin-top: var(--sp-8);
    border: 1px solid var(--border);
}

    .text-block p {
        margin-bottom: .5rem;
    }

/* Utility */
.text-white {
    color: #fff !important;
}

.staggered {
    margin-top: 40px;
}

/* Cards */
.card-header {
    background-image: linear-gradient(to right, var(--card-gradient-start), var(--card-gradient-end));
    color: #fff;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: .3px;
}

.card-body p {
    font-size: .96rem;
    line-height: 1.5;
    color: var(--text);
}

/* Payments */
.btn-paypal {
    background: var(--paypal-gold);
    color: #111;
    border: none;
    font-weight: 600;
}

    .btn-paypal:hover {
        background: #FFB020;
        color: #111;
    }

.btn-venmo {
    background: var(--venmo-blue);
    color: #fff;
    border: none;
    font-weight: 700;
}

    .btn-venmo:hover {
        background: #2f77a5;
        color: #fff;
    }

.pay-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .9rem 1.1rem;
    border-radius: var(--radius-md);
}

.or-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text-muted);
}

    .or-divider::before,
    .or-divider::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: var(--border);
    }

/* Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: .9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Member Points cards ── */
.kpi-card {
    background: linear-gradient(180deg, rgba(13,110,253,.06), rgba(13,110,253,.02));
    border-radius: 1rem;
}

/* ===== BASE LAYOUT - APPLIES TO ALL SCREENS ===== */
.layout {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    isolation: isolate;
}

.layout::-webkit-scrollbar {
    display: none;
}

/* ===== MOBILE MODIFICATIONS ===== */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--sidebar-border);
        background-attachment: scroll, scroll;
    }   
}

/* ===== MOBILE / TABLET SIDEBAR ===== */
@media (max-width: 991.98px) {
    .layout {
        padding-left: 0;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--sidebar-border);
        background-attachment: scroll, scroll;
    }
}

/* ===== DESKTOP ADDITIONS ===== */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: var(--navbar-h);
        left: 0;
        width: 240px;
        min-width: 240px;
        max-width: 240px;
        height: calc(100vh - var(--navbar-h));
        overflow-y: auto;
        z-index: 1020;
    }

    .content {
        height: auto;
        min-height: calc(100vh - var(--navbar-h));
    }
}

/* ===== MOBILE SIDEBAR ADJUSTMENTS ===== */
@media (max-width: 991.98px) {
    .layout {
        padding-left: 0;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--sidebar-border);
        background-attachment: scroll, scroll;
    }
}

/* ========== Dark Mode Toggle (switch) ========== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    user-select: none;
}

    .theme-toggle .toggle {
        position: relative;
        width: 44px;
        height: 24px;
        border-radius: 999px;
        background: rgba(255,255,255,.25);
        cursor: pointer;
        transition: background var(--trans-fast);
    }

        .theme-toggle .toggle::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #fff;
            box-shadow: var(--shadow-sm);
            transition: left var(--trans-fast), transform var(--trans-fast);
        }

    .theme-toggle input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

        .theme-toggle input:checked + .toggle {
            background: var(--primary);
        }

            .theme-toggle input:checked + .toggle::after {
                left: 22px;
                transform: translateX(0);
            }

:root[data-theme="dark"] .theme-toggle {
    color: #e5e7eb;
}

:root[data-theme="dark"] .banner-actions {
    background: color-mix(in oklab, var(--bg-elev) 85%, transparent 15%);
}

:root.admin-mode-off .admin-only {
    display: none !important;
}

:root.admin-mode-on .admin-only {
    display: revert !important;
}

/* ===== Fixed top navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

/* Offset body content below the fixed navbar — margin-top instead of
   padding-top so the navbar background bleeds all the way to the top edge */
body {
    padding-top: 0;
    margin-top: var(--navbar-h);
}



