/* ==========================================================================
   OFFICIAL COLOR PALETTE & CSS VARIABLES
   ========================================================================== */
:root {
    --dark-blue: #003F87;
    --blue: #007AC8;
    --white: #FFFFFF;
    --light-green: #BAD80A;
    --dark-green: #006B3F;
    --yellow: #FFC61E;
    --red: #CC2D30;
    
    --black: #1C2023;
    --gray: #52606D;
    --gray-light: #F4F6F8;
    --gray-border: #E1E6EB;

    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: 'Fira Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ==========================================================================
   Accessibility base layer
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 10px 18px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    z-index: 3000;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 12px;
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--black);
    background-color: var(--gray-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

/* ==========================================================================
   1. NAVIGATION BAR
   ========================================================================== */
.navbar {
    background-color: var(--dark-blue);
    color: var(--white);
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    position: relative;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-start;
}

.nav-btn {
    font-family: var(--font-heading);
    color: var(--white);
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-btn.active {
    background-color: var(--blue);
    color: var(--white);
}




#report-issue-nav-btn:hover,
.nav-btn.btn-accent:hover {
    background-color: #a4be07;
    transform: translateY(-1px);
}

.nav-btn-admin {
    font-family: var(--font-heading);
    color: var(--white);
    text-decoration: none;
    background-color: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-btn-admin:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--white);
}

.nav-btn-admin i {
    font-size: 11px;
}

.nav-center {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    flex: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.school-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* ==========================================================================
   2. MAIN SPLIT INTERFACE
   ========================================================================== */
.map-page-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 64px);
    overflow: hidden;
}

.mobile-view-toggle {
    display: none;
}

.sidebar {
    width: 380px;
    background-color: var(--gray-light);
    border-right: 1px solid var(--gray-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    height: 100%;
}

.sidebar-header {
    background-color: var(--white);
    padding: 16px;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 14px;
}

.search-bar {
    font-family: var(--font-body);
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--black);
    outline: none;
    transition: border-color 0.2s ease;
}

.search-bar:focus {
    border-color: var(--blue);
}

.filter-row {
    display: flex;
    gap: 8px;
}

.filter-dropdown {
    font-family: var(--font-body);
    flex: 1;
    padding: 8px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    background-color: var(--white);
    color: var(--black);
    font-size: 13px;
    outline: none;
}

.accessibility-layers {
    background-color: var(--white);
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-border);
}

.accessibility-layers-title {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray);
    cursor: pointer;
    list-style: none;
}

.accessibility-layers-title::-webkit-details-marker {
    display: none;
}

.accessibility-layers-title::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.15s ease;
}

.accessibility-layers[open] .accessibility-layers-title::before {
    transform: rotate(90deg);
}

.layer-toggle-group {
    margin-top: 12px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--black);
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
    min-height: 24px;
}

.layer-toggle:last-child {
    margin-bottom: 0;
}

.layer-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.layer-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ==========================================================================
   REPORTS LIST & CIVIC CARD LAYOUT (SEECLICKFIX STYLE)
   ========================================================================== */
.reports-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-card {
    background-color: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.sidebar-card-photo {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-card h3.sidebar-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue);
    margin: 0 0 2px 0;
    line-height: 1.35;
}

.sidebar-card-location {
    font-size: 13px;
    color: var(--gray);
    font-weight: 400;
    margin-bottom: 6px;
    line-height: 1.35;
}

.sidebar-card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--gray);
}

.sidebar-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.sidebar-card-dot.low { background-color: var(--dark-green); }
.sidebar-card-dot.medium { background-color: var(--yellow); }
.sidebar-card-dot.critical { background-color: var(--red); }

.sidebar-card-severity-label {
    font-weight: 600;
    color: var(--black);
    text-transform: capitalize;
    margin-right: 8px;
}

.sidebar-card-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gray);
}

.report-card p.sidebar-card-desc {
    font-size: 13px;
    color: var(--black);
    line-height: 1.45;
    margin: 2px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   MAP WRAPPER & CONTROLS
   ========================================================================== */
.map-wrapper {
    position: relative;
    flex: 1;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   3. MODAL OVERLAY
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(28, 32, 35, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.close-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
}

/* ==========================================================================
   4. MOBILE & RESPONSIVE LAYOUT (Max Width 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
        height: 56px;
    }

    .nav-center {
        display: none;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .map-page-container {
        flex-direction: column;
        position: relative;
    }

    .mobile-view-toggle {
        display: flex;
        border-bottom: 1px solid var(--gray-border);
        background-color: var(--white);
    }

    .view-toggle-btn {
        flex: 1;
        padding: 12px;
        border: none;
        background: none;
        font-family: var(--font-heading);
        font-size: 13px;
        font-weight: 700;
        color: var(--gray);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        border-bottom: 3px solid transparent;
    }

    .view-toggle-btn.active {
        color: var(--dark-blue);
        border-bottom-color: var(--blue);
    }

    .sidebar {
        display: none;
        width: 100%;
        height: auto;
        flex: 1;
        border-right: none;
        border-top: none;
        overflow-y: auto;
    }

    .map-wrapper {
        flex: 1;
    }

    .map-page-container.showing-list .sidebar {
        display: flex;
    }

    .map-page-container.showing-list .map-wrapper {
        display: none;
    }
}

.floating-report-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-blue);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 13px 24px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: background-color 0.15s ease, transform 0.15s ease;
    z-index: 400;
}

.floating-report-btn:hover {
    background-color: var(--blue);
    transform: translateX(-50%) translateY(-2px);
}