﻿/* ======================================================
   site.css
   Design tokens, shared admin shell, and the Super Admin
   sidebar theme, plus the public marketing (home) page.

   File map for this app:
     site.css             -> tokens, admin shell, Super Admin theme, home page
     official-sidebar.css -> Official role theme (loads after site.css)
     navbar.css            -> public navbar (Voter / Candidate / Auditor / guest)
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    /* -- base palette -- */
    --votex-navy-900: #0f1a38;
    --votex-navy-800: #16295a;
    --votex-amber: #f5a623;
    --votex-paper: #f7f5f0;
    --votex-ink: #12172a;
    --votex-green: #2f9e6e;
    /* -- one accent per role, used across sidebar + navbar so a
          role reads consistently everywhere it appears -- */
    --votex-role-superadmin: var(--votex-amber);
    --votex-role-official: var(--votex-green);
    --votex-role-auditor: #6c63b5;
    --votex-role-candidate: #c1553d;
    --votex-role-voter: #2f7dd8;
    /* -- type -- */
    --votex-font-display: 'Fraunces', serif;
    --votex-font-body: 'Inter', sans-serif;
    --votex-font-mono: 'IBM Plex Mono', monospace;
}

/* ==========================================
   SHARED ADMIN SHELL
   Used by both Super Admin and Official layouts.
   Role-specific colour is layered on via
   .admin-sidebar--superadmin / .admin-sidebar--official
   ========================================== */

.admin-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}
/* ─── DESKTOP SIDEBAR ─── */
.admin-sidebar {
    --sidebar-accent: var(--votex-amber);
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1050; /* Higher than topbar to sit cleanly on top if needed */
    background: #111e3c;
    font-family: var(--votex-font-body);
    transition: width 0.22s ease, transform 0.25s ease, box-shadow 0.22s ease;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

    /* The nav list (<ul class="nav flex-column flex-grow-1 overflow-y-auto">)
   is a flex child inside this sidebar's own flex-column layout, meant to
   fill the space between the brand/user-chip above and the footer below,
   then scroll internally if the link list runs long. But flex items
   default to min-height:auto, which refuses to shrink below their own
   content's height — so instead of scrolling within its slot, the list
   was forcing the WHOLE sidebar taller than 100vh, and overflow-y:auto
   on .admin-sidebar never got the chance to do anything. min-height:0
   removes that floor so the intended internal scroll actually happens. */
    .admin-sidebar > ul.nav {
        min-height: 0;
    }

    /* Bootstrap's base .nav class is display:flex + flex-wrap:wrap in a ROW
   direction — the .flex-column utility class on this <ul> is meant to
   override that, but something in the current stylesheet load order is
   letting the row+wrap behavior win, so nav items wrap into a second
   "column" instead of stacking in one list (visible as a horizontal
   scrollbar at the bottom of the sidebar). Forcing it here directly,
   scoped only to sidebar nav lists, guarantees correct stacking
   regardless of what else is fighting it. */
    .admin-sidebar ul.nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        overflow-x: hidden !important;
    }

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%); /* Hide completely off-screen to the left by default */
        box-shadow: none;
    }

        /* When toggled open on mobile */
        .admin-sidebar.mobile-open {
            transform: translateX(0);
            box-shadow: 15px 0 40px rgba(0, 0, 0, 0.4);
        }
}

/* Collapsed rail on desktop */
.admin-sidebar.collapsed {
    width: 70px;
}

    .admin-sidebar.collapsed .brand-text,
    .admin-sidebar.collapsed .sidebar-user-info,
    .admin-sidebar.collapsed .sidebar-section-label,
    .admin-sidebar.collapsed .nav-link span,
    .admin-sidebar.collapsed .fa-chevron-down {
        display: none !important;
    }

    .admin-sidebar.collapsed .nav-link {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

        .admin-sidebar.collapsed .nav-link i {
            margin-right: 0 !important;
            font-size: 1.2rem;
        }

    .admin-sidebar.collapsed .collapse {
        display: none !important;
    }

    /* Hover-expand: the collapsed rail temporarily widens */
    .admin-sidebar.collapsed.sidebar-hover-expanded {
        width: 260px;
        box-shadow: 10px 0 32px rgba(0, 0, 0, 0.35);
    }

        .admin-sidebar.collapsed.sidebar-hover-expanded .brand-text,
        .admin-sidebar.collapsed.sidebar-hover-expanded .sidebar-user-info,
        .admin-sidebar.collapsed.sidebar-hover-expanded .sidebar-section-label,
        .admin-sidebar.collapsed.sidebar-hover-expanded .nav-link span,
        .admin-sidebar.collapsed.sidebar-hover-expanded .fa-chevron-down {
            display: revert !important;
        }

        .admin-sidebar.collapsed.sidebar-hover-expanded .nav-link {
            justify-content: flex-start !important;
            padding-left: 0.75rem !important;
            padding-right: 0.75rem !important;
        }

            .admin-sidebar.collapsed.sidebar-hover-expanded .nav-link i {
                margin-right: 0.5rem !important;
                font-size: 1rem;
            }

        .admin-sidebar.collapsed.sidebar-hover-expanded .collapse.show {
            display: block !important;
        }

/* ─── MAIN BODY AREA ─── */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ─── ADMIN TOPBAR ─── */
.admin-topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e8eaf0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 90;
}

/* ─── MAIN CONTENT ─── */
.admin-content {
    min-height: calc(100vh - 60px);
    background: #f0f2f8;
    padding: 1.5rem;
}

/* ─── MOBILE BACKDROP OVERLAY ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
}

    .sidebar-overlay.show {
        display: block;
    }

/* ─── FLOATING SIDEBAR TOGGLE (MOBILE) ─── */
.sidebar-floating-toggle {
    display: flex;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1060;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: #111e3c;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

    .sidebar-floating-toggle:hover {
        background: var(--votex-navy-800, #1d3363);
    }

/* Hide toggle on desktop screens */
@media (min-width: 992px) {
    .sidebar-floating-toggle {
        display: none;
    }
}

/* ─── SIDEBAR BRAND & DECORATION ─── */
.sidebar-brand .brand-text span {
    font-family: var(--votex-font-display);
    letter-spacing: 0.01em;
}

.sidebar-punch-rule {
    position: relative;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0 1rem;
}

    .sidebar-punch-rule::before,
    .sidebar-punch-rule::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #111e3c;
        transform: translateY(-50%);
    }

    .sidebar-punch-rule::before {
        left: -0.75rem;
    }

    .sidebar-punch-rule::after {
        right: -0.75rem;
    }

.admin-sidebar.collapsed .sidebar-punch-rule::before,
.admin-sidebar.collapsed .sidebar-punch-rule::after {
    display: none;
}
/* ─── SIDEBAR UI COMPONENTS (shared shape, role colours below) ─── */
.sidebar-section-label {
    font-family: var(--votex-font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.38);
    margin-top: 1.1rem;
    margin-bottom: 0.4rem;
    padding-left: 0.75rem;
}

.sidebar-user {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}

.sidebar-role-badge {
    display: inline-block;
    font-family: var(--votex-font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.15rem;
}

/* Nav links: quiet by default, a left accent bar + tinted fill when
   active — replaces the flat bootstrap-blue highlight with each
   role's own colour (set by --sidebar-accent). */
/* ─── COMPACT SIDEBAR OVERRIDES ─── */
.admin-sidebar .nav-link {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
}

.admin-sidebar .sidebar-section-label {
    margin-top: 0.5rem !important;
    margin-bottom: 0.15rem !important;
}

.admin-sidebar .nav {
    gap: 1px !important;
}

.admin-sidebar .dropdown-menu {
    font-size: 0.8rem !important;
}

.admin-sidebar .dropdown-item {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.8rem !important;
}

/* Hover effect for better UX */
.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.12) !important;
    border-left: 3px solid var(--sidebar-accent, #f5a623);
}
/* Brand icon */
.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--sidebar-accent, var(--votex-amber));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--votex-navy-900);
    flex-shrink: 0;
}

/* Avatar (circle) */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--votex-navy-900);
    background: var(--sidebar-accent, var(--votex-amber)); /* fallback for browsers without color-mix() */
    background: linear-gradient(135deg, var(--sidebar-accent, var(--votex-amber)), color-mix(in srgb, var(--sidebar-accent, var(--votex-amber)) 70%, black));
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── SUPER ADMIN THEME ─── */
.admin-sidebar--superadmin {
    --sidebar-accent: var(--votex-role-superadmin);
}

/* ─── RESPONSIVE BREAKPOINTS (SIDEBAR DRAWER) ─── */

@media (max-width: 991.98px) {
    .admin-shell {
        display: block;
        height: auto;
    }

    /* Completely hide sidebar off-screen by default */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        z-index: 1050;
        transition: transform 0.25s ease-in-out;
    }

        /* Slides sidebar into view when toggled */
        .admin-sidebar.mobile-open {
            transform: translateX(0) !important;
        }

    .admin-content {
        min-height: 100vh;
    }
}

@media (max-width: 767.98px) {
    .admin-sidebar {
        width: 240px;
    }

    .admin-topbar {
        height: 55px;
    }

    .admin-content {
        min-height: calc(100vh - 55px);
        padding: 0.75rem !important;
    }
}

@media (max-width: 479.98px) {
    .admin-sidebar {
        width: 85vw;
        max-width: 260px;
    }

    .admin-topbar {
        height: 50px;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .admin-content {
        min-height: calc(100vh - 50px);
        padding: 0.5rem !important;
    }
}

/* ======================================================
   HOW IT WORKS STEPS STYLES
   ====================================================== */
.home-steps {
    padding: 5rem 0;
    background: #ffffff;
}

.home-section-title {
    font-family: var(--votex-font-display);
    font-weight: 600;
    font-size: 2.25rem;
    color: var(--votex-navy-900);
    text-align: center;
    margin-bottom: 3.5rem;
}

.home-steps-list {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

    .home-steps-list li {
        display: flex;
        gap: 1.5rem;
        flex: 1;
        align-items: flex-start;
    }

.home-step-no {
    font-family: var(--votex-font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--votex-amber);
    line-height: 1;
    opacity: 0.85;
}

.home-steps-list h3 {
    font-family: var(--votex-font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--votex-navy-900);
    margin-bottom: 0.5rem;
}

.home-steps-list p {
    font-family: var(--votex-font-body);
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
}

/* ======================================================
   HOME TRUST STYLES
   ====================================================== */
.home-trust {
    padding: 4.5rem 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.home-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    text-align: center;
}

    .home-trust-grid h4 {
        font-family: var(--votex-font-display);
        font-weight: 600;
        font-size: 1.2rem;
        color: var(--votex-navy-900);
        margin-bottom: 0.75rem;
    }

    .home-trust-grid p {
        font-family: var(--votex-font-body);
        font-size: 0.95rem;
        color: #64748b;
        line-height: 1.5;
    }

@media (max-width: 991.98px) {
    .home-steps-list {
        flex-direction: column;
        gap: 2.5rem;
        max-width: 32rem;
        margin: 0 auto;
    }

    .home-trust-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 32rem;
        margin: 0 auto;
    }
}

/* ======================================================
   HOME PAGE STYLES
   ====================================================== */

.home-hero {
    background: var(--votex-navy-900);
    color: #fff;
    padding: 4.5rem 0 5rem;
}

.home-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.home-eyebrow {
    display: inline-block;
    font-family: var(--votex-font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--votex-amber);
    margin-bottom: 1rem;
}

.home-headline {
    font-family: var(--votex-font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 4vw, 3.25rem);
    line-height: 1.12;
    margin-bottom: 1.25rem;
}

.home-sub {
    font-family: var(--votex-font-body);
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    max-width: 34rem;
    margin-bottom: 2rem;
}

.home-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: center;
}

.home-btn-primary {
    background: var(--votex-amber);
    border-color: var(--votex-amber);
    color: var(--votex-navy-900);
    font-weight: 600;
    padding: 0.7rem 1.5rem;
}

    .home-btn-primary:hover {
        background: #e0951c;
        border-color: #e0951c;
        color: var(--votex-navy-900);
    }

.home-btn-ghost {
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-weight: 500;
    padding: 0.7rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .home-btn-ghost:hover {
        border-color: var(--votex-amber);
        color: var(--votex-amber);
    }

/* Ballot Stub */
.ballot-stub {
    background: var(--votex-paper);
    color: var(--votex-ink);
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.35);
    max-width: 380px;
    margin-left: auto;
    overflow: hidden;
}

.ballot-stub-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.25rem 1.5rem;
    font-family: var(--votex-font-mono);
}

.ballot-stub-tear {
    position: relative;
    height: 0;
    border-top: 2px dashed rgba(18,23,42,0.2);
}

    .ballot-stub-tear::before,
    .ballot-stub-tear::after {
        content: '';
        position: absolute;
        top: -8px;
        width: 16px;
        height: 16px;
        background: var(--votex-navy-900);
        border-radius: 50%;
    }

    .ballot-stub-tear::before {
        left: -8px;
    }

    .ballot-stub-tear::after {
        right: -8px;
    }

.ballot-stub-bottom {
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
}

.ballot-stat-value {
    font-family: var(--votex-font-mono);
    font-weight: 600;
    font-size: 1.6rem;
    color: var(--votex-navy-900);
    line-height: 1;
}

.ballot-stat-label {
    font-family: var(--votex-font-body);
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.35rem;
}

@media (max-width: 991.98px) {
    .home-hero-grid {
        grid-template-columns: 1fr;
    }

    .ballot-stub {
        margin: 2.5rem auto 0;
    }
}
/* Custom styling for sleek horizontal slider track */
.election-slider-container::-webkit-scrollbar {
    height: 6px;
}

.election-slider-container::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.election-slider-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.03);
}
/* ─── Push the right-side container to the extreme right ─── */
.navbar .ms-auto {
    margin-left: auto !important;
}

/* ─── Fix dropdown positioning and prevent cut-off ─── */
.dropdown-menu-mobile-fix {
    right: 0 !important;
    left: auto !important;
    max-width: calc(100vw - 2rem) !important;
    transform: none !important;
}

/* On very small screens, allow more flexibility */
@media (max-width: 576px) {
    .dropdown-menu-mobile-fix {
        max-width: calc(100vw - 1rem) !important;
        min-width: 180px !important;
    }
}

/* Ensure parent containers don't clip the dropdown */
.navbar,
.navbar .container,
.navbar .container-fluid,
.navbar-collapse {
    overflow: visible !important;
}

/* Optional: make the toggle button background more subtle */
.user-menu-btn {
    background-color: rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

    .user-menu-btn:hover {
        background-color: rgba(255, 255, 255, 0.12);
    }