/* ==========================================================
   FloodPulse
   Main Styles — Dark / Rain theme
   ========================================================== */


:root {

    /* --- surfaces --- */
    --bg-deep: #0E131A;
    --bg-panel: rgba(27, 34, 43, 0.72);
    --bg-panel-solid: #1A222B;
    --bg-input: rgba(255, 255, 255, 0.04);
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* --- text --- */
    --text-primary: #E9EFF6;
    --text-muted: #8B96A6;

    /* --- accents --- */
    --accent-rain: #5AA9E6;
    --accent-rain-deep: #2E6FA3;
    --accent-teal: #2FBFA0;

    /* --- risk --- */
    --risk-high: #E5484D;
    --risk-moderate: #E8A33D;
    --risk-low: #34D399;

    --blur: blur(16px);
}


* {
    box-sizing: border-box;
}


body {

    font-family:
        "Inter",
        Arial,
        Helvetica,
        sans-serif;

    background:
        radial-gradient(
            circle at 20% -10%,
            #1B2734 0%,
            var(--bg-deep) 55%
        );

    color: var(--text-primary);

    margin: 0;

    padding: 0;

}


h1, h2, h3 {

    font-family:
        "Space Grotesk",
        "Inter",
        sans-serif;

    letter-spacing: -0.01em;

}


/* ==========================================================
   HEADER
   ========================================================== */

.header {

    position: relative;

    background:
        linear-gradient(
            180deg,
            #141B24 0%,
            #10151C 100%
        );

    border-bottom:
        1px solid var(--border-soft);

    position: sticky;

    top: 0;

    z-index: 1000;

}


/* Full-page rain background. Fixed so it stays put behind
   every section while the page scrolls; every section's
   glass panels (see the "GLASS PANEL" rule below) let it
   show through, blurred, underneath their content. */
.rain-canvas {

    position: fixed;

    top: 0;

    left: 0;

    width: 100vw;

    height: 100vh;

    z-index: 0;

    opacity: 0.4;

    pointer-events: none;

}


.header-content {

    position: relative;

    z-index: 1;

    max-width: 1200px;

    margin: auto;

    padding:
        16px 25px;

    display: flex;

    justify-content:
        space-between;

    align-items: center;

}


.brand {

    display: flex;

    align-items: center;

    gap: 12px;

}


.brand-icon {

    width: 48px;

    height: 48px;

    border-radius: 14px;

    background:
        linear-gradient(
            140deg,
            rgba(90, 169, 230, 0.25),
            rgba(47, 191, 160, 0.15)
        );

    border:
        1px solid var(--border-soft);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 25px;

}


.brand h1 {

    margin: 0;

    font-size: 24px;

    font-weight: 700;

    color: var(--text-primary);

}


.brand span {

    font-size: 13px;

    color: var(--text-muted);

}


.location-badge {

    background: var(--bg-input);

    color: var(--accent-rain);

    border:
        1px solid var(--border-soft);

    padding:
        9px 15px;

    border-radius: 20px;

    font-size: 14px;

    font-weight: bold;

    backdrop-filter: var(--blur);

}


/* ==========================================================
   MAIN
   ========================================================== */

.main-container {

    position: relative;

    z-index: 1;

    width: 92%;

    max-width: 1200px;

    margin:
        35px auto 60px;

}


/* ==========================================================
   HERO
   ========================================================== */

.hero {

    position: relative;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(90, 169, 230, 0.18),
            transparent 55%
        ),
        linear-gradient(
            135deg,
            #182129,
            #131A21
        );

    border-radius: 22px;

    padding:
        45px 50px;

    margin-bottom: 25px;

    border:
        1px solid var(--border-soft);

}


.eyebrow {

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 2px;

    color: var(--accent-rain);

}


.hero h2 {

    font-size: 38px;

    max-width: 700px;

    line-height: 1.15;

    margin:
        12px 0;

    color: var(--text-primary);

}


.hero h2 span {

    color: var(--accent-rain);

}


.hero p {

    max-width: 650px;

    font-size: 17px;

    line-height: 1.6;

    color: var(--text-muted);

    margin: 0;

}


/* ==========================================================
   GLASS PANEL (shared look for route-box / map-section /
   routeInfo / report-section / feature-card)
   ========================================================== */

.route-box,
.map-section,
#routeInfo,
.report-section,
.feature-card {

    background: var(--bg-panel);

    backdrop-filter: var(--blur);

    border:
        1px solid var(--border-soft);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.35);

}


/* ==========================================================
   ROUTE BOX
   ========================================================== */

.route-box {

    border-radius: 18px;

    padding: 28px;

    margin-bottom: 25px;

}


.section-title {

    display: flex;

    align-items: center;

    gap: 14px;

    margin-bottom: 22px;

}


.section-icon {

    width: 45px;

    height: 45px;

    background: var(--bg-input);

    border:
        1px solid var(--border-soft);

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 21px;

}


.section-title h3 {

    margin: 0 0 4px;

    font-size: 20px;

    color: var(--text-primary);

}


.section-title p {

    margin: 0;

    color: var(--text-muted);

    font-size: 14px;

}


.inputs {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 20px;

}


.input-group label {

    display: block;

    margin-bottom: 8px;

    font-weight: bold;

    font-size: 14px;

    color: var(--text-primary);

}


.input-group input {

    width: 100%;

    padding:
        14px 15px;

    background: var(--bg-input);

    border:
        1px solid var(--border-soft);

    border-radius: 10px;

    font-size: 15px;

    color: var(--text-primary);

    outline: none;

    transition: 0.2s;

}


.input-group input::placeholder {

    color: var(--text-muted);

}


.input-group input:focus {

    border-color: var(--accent-rain);

    box-shadow:
        0 0 0 3px
        rgba(90, 169, 230, 0.18);

}


/* --- buttons share a base look, differentiated by accent --- */

.find-button,
.report-button,
.submit-report-button {

    position: relative;

    overflow: hidden;

    border: none;

    border-radius: 10px;

    color: #08141F;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;

}


.find-button::before,
.report-button::before,
.submit-report-button::before {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.35),
            transparent 40%
        );

    opacity: 0;

    transition: opacity 0.2s ease;

}


.find-button:hover::before,
.report-button:hover::before,
.submit-report-button:hover::before {

    opacity: 1;

}


.find-button:hover,
.report-button:hover,
.submit-report-button:hover {

    transform: translateY(-1px);

}


.find-button {

    margin-top: 22px;

    width: 100%;

    padding: 15px;

    background:
        linear-gradient(
            135deg,
            #7FC4F2,
            var(--accent-rain)
        );

    box-shadow:
        0 8px 22px
        rgba(90, 169, 230, 0.35);

}


.find-button:hover {

    box-shadow:
        0 10px 26px
        rgba(90, 169, 230, 0.5);

}


.tip {

    text-align: center;

    color: var(--text-muted);

    font-size: 13px;

    margin:
        15px 0 0;

}


/* ==========================================================
   MAP SECTION
   ========================================================== */

.map-section {

    padding: 20px;

    border-radius: 18px;

}


.map-header {

    display: flex;

    justify-content:
        space-between;

    align-items: center;

    margin-bottom: 15px;

}


.map-header h3 {

    margin: 0 0 5px;

    color: var(--text-primary);

}


.map-header p {

    margin: 0;

    color: var(--text-muted);

    font-size: 13px;

}


.legend {

    display: flex;

    gap: 15px;

    font-size: 12px;

}


.legend span {

    display: flex;

    align-items: center;

    gap: 6px;

    background: var(--bg-input);

    border:
        1px solid var(--border-soft);

    padding:
        5px 10px;

    border-radius: 999px;

    color: var(--text-muted);

}


.legend i {

    width: 9px;

    height: 9px;

    display: inline-block;

    border-radius: 50%;

}


.legend .high {

    background: var(--risk-high);

    box-shadow:
        0 0 8px
        rgba(229, 72, 77, 0.8);

}


.legend .moderate {

    background: var(--risk-moderate);

    box-shadow:
        0 0 8px
        rgba(232, 163, 61, 0.8);

}


#map {

    height: 560px;

    width: 100%;

    border-radius: 13px;

    overflow: hidden;

    border:
        1px solid var(--border-soft);

}


/* Darken the OSM tiles so the base map matches the theme.
   Only the tile layer is filtered — flood-zone circles,
   markers, and routes sit in a different Leaflet pane and
   keep their original colors. Delete this rule to restore
   the normal (light) map. */

#map .leaflet-tile-pane {

    filter:
        invert(1)
        hue-rotate(180deg)
        brightness(0.85)
        contrast(0.95)
        saturate(0.75);

}


/* ==========================================================
   ROUTE INFORMATION
   ========================================================== */

#routeInfo {

    margin-top: 25px;

    padding: 25px;

    border-radius: 18px;

    text-align: left;

    font-size: 16px;

    color: var(--text-primary);

}


#routeInfo h2,
#routeInfo h3 {

    color: var(--text-primary);

}


#routeInfo p {

    color: var(--text-muted);

}


#routeInfo hr {

    border: none;

    border-top:
        1px solid var(--border-soft);

    margin: 18px 0;

}


.empty-state {

    text-align: center;

    padding:
        30px 20px;

}


.empty-icon {

    font-size: 45px;

    margin-bottom: 10px;

}


.empty-state h3 {

    margin:
        5px 0 8px;

    color: var(--text-primary);

}


.empty-state p {

    max-width: 550px;

    margin: auto;

    color: var(--text-muted);

    line-height: 1.6;

}


/* ==========================================================
   FEATURE CARDS
   ========================================================== */

.features {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;

    margin-top: 25px;

}


.feature-card {

    padding: 25px;

    border-radius: 16px;

}


.feature-icon {

    font-size: 30px;

    margin-bottom: 10px;

}


.feature-card h3 {

    margin:
        5px 0 8px;

    font-size: 18px;

    color: var(--text-primary);

}


.feature-card p {

    color: var(--text-muted);

    line-height: 1.5;

    font-size: 14px;

    margin: 0;

}


/* ==========================================================
   FOOTER
   ========================================================== */

footer {

    position: relative;

    z-index: 1;

    text-align: center;

    padding:
        30px 20px;

    background: #0B0F14;

    color: var(--text-primary);

    border-top:
        1px solid var(--border-soft);

}


footer p {

    margin:
        0 0 8px;

}


footer span {

    font-size: 12px;

    color: var(--text-muted);

}


/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

@media (
    max-width: 768px
) {

    .main-container {

        width: 94%;

    }


    .hero {

        padding:
            30px 25px;

    }


    .hero h2 {

        font-size: 30px;

    }


    .inputs {

        grid-template-columns:
            1fr;

    }


    .features {

        grid-template-columns:
            1fr;

    }


    .map-header {

        align-items:
            flex-start;

        flex-direction:
            column;

        gap: 12px;

    }


    .legend {

        flex-wrap:
            wrap;

    }


    #map {

        height: 450px;

    }


    .location-badge {

        display: none;

    }

}


/* Respect reduced-motion: disable the button hover sweep
   for people who've asked for less motion. The header rain
   canvas itself checks prefers-reduced-motion in JS. */

@media (prefers-reduced-motion: reduce) {

    .find-button:hover::before,
    .report-button:hover::before,
    .submit-report-button:hover::before {

        transition: none;

    }

    .find-button:hover,
    .report-button:hover,
    .submit-report-button:hover {

        transform: none;

    }

}


/* ==========================================================
   CITIZEN FLOOD REPORT
   ========================================================== */

.report-section {

    margin-top: 25px;

    padding: 25px;

    border-radius: 18px;

}


.report-button {

    width: 100%;

    padding: 14px;

    background:
        linear-gradient(
            135deg,
            #6FE0C4,
            var(--accent-teal)
        );

    box-shadow:
        0 8px 22px
        rgba(47, 191, 160, 0.3);

}


.report-button:hover {

    box-shadow:
        0 10px 26px
        rgba(47, 191, 160, 0.45);

}


.report-form {

    margin-top: 20px;

    padding-top: 20px;

    border-top:
        1px solid var(--border-soft);

}


.report-instruction {

    background:
        rgba(47, 191, 160, 0.1);

    border:
        1px solid rgba(47, 191, 160, 0.25);

    padding: 12px;

    border-radius: 8px;

    color: #9FE8D6;

    font-size: 14px;

}


.report-form label {

    display: block;

    margin-top: 15px;

    margin-bottom: 7px;

    font-weight: bold;

    font-size: 14px;

    color: var(--text-primary);

}


.report-form select,
.report-form textarea {

    width: 100%;

    padding: 12px;

    background: var(--bg-input);

    border:
        1px solid var(--border-soft);

    border-radius: 8px;

    font-family: "Inter", Arial, sans-serif;

    font-size: 14px;

    color: var(--text-primary);

}

.report-form select option {

    background: var(--bg-panel-solid);

    color: var(--text-primary);

}


.report-form textarea {

    min-height: 90px;

    resize: vertical;

}


.report-form textarea::placeholder {

    color: var(--text-muted);

}


.submit-report-button {

    width: 100%;

    margin-top: 18px;

    padding: 14px;

    background:
        linear-gradient(
            135deg,
            #7FC4F2,
            var(--accent-rain)
        );

    box-shadow:
        0 8px 22px
        rgba(90, 169, 230, 0.3);

}


.submit-report-button:hover {

    box-shadow:
        0 10px 26px
        rgba(90, 169, 230, 0.45);

}

/* ==========================================================
   ROUTE RESULT CARDS — FORCE DARK THEME
   Prevents GitHub/deployment styles from making result
   backgrounds white and text unreadable.
   ========================================================== */

#routeInfo {
    background: rgba(27, 34, 43, 0.90) !important;
    color: #E9EFF6 !important;
}

/* All dynamically generated route cards */
#routeInfo > div {
    background: #1A222B !important;
    color: #E9EFF6 !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
}

/* Recommended route card */
#routeInfo > div[style*="rgba(52, 211, 153"] {
    background: rgba(27, 65, 55, 0.90) !important;
    color: #E9EFF6 !important;
    border: 1px solid rgba(52, 211, 153, 0.55) !important;
}

/* Recommendation box at the bottom */
#routeInfo > div:last-child {
    background:
        linear-gradient(
            135deg,
            rgba(90, 169, 230, 0.18),
            rgba(52, 211, 153, 0.10)
        ) !important;

    color: #E9EFF6 !important;

    border: 1px solid rgba(90, 169, 230, 0.40) !important;
}

/* Force all result headings to remain bright */
#routeInfo h1,
#routeInfo h2,
#routeInfo h3,
#routeInfo h4 {
    color: #E9EFF6 !important;
}

/* Force result paragraphs to remain readable */
#routeInfo p {
    color: #B8C4D2 !important;
}

/* Strong/bold text */
#routeInfo strong {
    color: #E9EFF6 !important;
}

/* Horizontal separators */
#routeInfo hr {
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
}
