:root {
    --primary: #363;
    --primary-light: #8a8;
    --warning: #f55;
    --bg: #f7f7f7;
    --card-bg: white;
    --text: #111;
    --text-muted: #6b7280;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --radius: 0.5rem;
    --radius-pill: 999px;
}
/* @media (prefers-color-scheme: dark) {
    :root {
        --primary: #4a7a4a;
        --primary-light: #2d452d;
        --warning: #ff6b6b;
        --bg: #121412;
        --card-bg: #1e211e;
        --text: #e2e8f0;
        --text-muted: #94a3b8;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    }
    input[type="number"], input[type="text"], .pill {
        border-color: #334155;
        background: #1e211e;
        color: var(--text);
    }
    .badge {
        background: #2d3748;
        color: #cbd5e1;
    }
} */

/* Base Styles */
body { font-family: system-ui,-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
header, main { max-width: 720px; margin: 0 auto; padding: 1rem; }
header { padding-top: 1.5rem; }
p { margin: 0.5rem 0; }
a { color: var(--primary); }

    /* Layout Utilities */
.row { display: flex; justify-content: space-between; align-items: start; gap: 0.75rem; }
.stack { display: flex; flex-direction: column; gap: 0.35rem; }
.subtitle { font-size: 0.9rem; color: var(--primary);}
.inline-filter-text { font-size: 1.2rem; line-height: 1.6; }

/* Navigation bar */
nav ul {
    list-style: none; margin: 0; padding: 0 1rem;
    background: var(--primary-light); border-radius: var(--radius);
    display: flex; justify-content: space-between; align-items: center;
}
nav li a { display: block; color: var(--card-bg); padding: 10px 16px; text-decoration: none; }
@media (hover: hover) {
    .nav li a:hover {
        background: var(--primary);
    }
}
nav h1 { margin: 0; color: var(--card-bg); font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; }
.burger-icon {
    display: none;
}

@media (max-width: 768px) {
    .burger-icon {
        display: block; background: none; border: none; font-size: 1.5rem;
        color: var(--card-bg); cursor: pointer; margin-top: 4px; padding: 6px;
        align-items: center; justify-content: center;
    }
    .nav-links {
        display: none; position: absolute; right: 1rem; z-index: 1000;
        flex-direction: column; background: var(--primary-light);
        border-radius: var(--radius); overflow: hidden; width: max-content;
        align-items: stretch; margin-top: 3em; margin-right: 0.5em;
    }
    .nav-links.active { display: flex; margin-right: 1em; right: 0; }
}

/* Dropdown */
.dropdown-wrapper {
    display: inline-block; position: relative;
    border-bottom: 2px dashed var(--primary);
    color: var(--primary); font-weight: 600;
}
.dropdown-wrapper select {
    appearance: none; background: transparent; border: none;
    padding-right: 18px; margin: 0; font-family: inherit;
    font-size: inherit; font-weight: 600; color: var(--primary);
    cursor: pointer; outline: none; vertical-align: baseline;
}
.dropdown-wrapper::after {
    content: '▼'; font-size: 0.7em; position: absolute;
    right: 4px; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--primary);
}

/* Cards */
.card, .card-results, .emergency-card {
    background: var(--card-bg); padding: 1rem; border-radius: var(--radius);
    margin-bottom: 0.75rem; box-shadow: var(--shadow);
}
.card-results { box-shadow: 2px 2px 3px rgba(0,0,0,0.06); }
.emergency-card {
    background: var(--warning); display: block; width: fit-content;
    max-width: 100%; box-sizing: border-box; overflow-wrap: break-word;
}
.card-empty { padding: 0.67rem; box-shadow: none; }


/* Badges */
.badge { display: inline-block; text-decoration: none; cursor: pointer; transition: 0.2s;
    border: none;font-size: 0.75rem; padding: 0.15rem 0.4rem; border-radius: var(--radius-pill);
}
.badge-blue { background: #e2e2fe; color: #1c1cb9; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-purple { background: #fee2fe; color: #b91cb9; }

/* Filter Pills */
.filter-pills { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0.75rem 0; }
.pill {
     display: inline-block; white-space: nowrap; cursor:pointer;
     padding: 8px 20px; border-radius: 50px; border: 1px solid #e2e8f0;
     background: var(--bg); font-weight: 500;
}
@media (hover: hover) {
    .pill:hover {
        background: var(--primary-light);
    }
}
.pill.active, .pill:has(input:checked) { background: var(--primary); color: var(--card-bg); }
.pill:not(:has(input:checked)) {
    background: var(--bg);
}

/* Location buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: var(--bg);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16 px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}
@media (hover: hover) {
    .btn:hover {
        background: var(--primary); color: var(--card-bg);
    }
}
.btn:active {
    transform: scale(0.98);
}
.donate-btn {
    color: var(--card-bg);
    background: var(--primary);
}
@media (hover: hover) {
    .donate-btn:hover {
        background: var(--primary-light);
    }
}

.htmx-request .inline-filter-text { opacity: 0.7; pointer-events: none; }
.medical-icon {
    font-size: 2rem;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    font-style: normal;
}
.htmx-indicator {
    display: none;
    color: var(--text);
    align-items: center;
    font-size: 1.3rem;
}
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator{
    display: flex;
}
.dots::after {
    content: '';
    animation: loading-dots 1.5s steps(1, end) infinite;
}
@keyframes loading-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
.location-notice {
    text-align: center;
    color: var(--warning);
    font-size: 1.1rem;
    padding: 1rem;
}
.location-notice a {
    color: var(--primary);
}
.hover-container {
    position: relative;
    display: inline-flex; /* Keeps the container tight around the badge */
    vertical-align: middle;
}

.hover-list {
    display: none; /* Hide the list by default */
    position: absolute;
    bottom: 125%; /* Position it above the badge */
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--card-bg);
    padding: 0;
    border-radius: 6px;
    width: 300px; /* Adjust width as needed */
    z-index: 10;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
    overflow: hidden;
}
/* Zebra striping */
.hover-list li {
    display: block;
    width: 100%;
    padding: 10px 15px; /* Spacing now lives inside the item */
    box-sizing: border-box;
}
.hover-list li:nth-child(even) {
    background: var(--primary-light);
}

/* Reveal the list on hover */
.hover-list {
    display: block;
}
@media (hover: hover) {
    .hover-container:hover {
        display: block;
    }
}

/* Optional: Basic styling for the list inside */
.hover-list ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 0.85rem;
    text-align: left;
}
.info-icon {
    margin-left: 5px;
    font-size: 0.8em;
    line-height: 1;            /* Prevents the icon from adding extra height */
    vertical-align: baseline;
}

.promo-links ul {
    list-style-type: none;
}

#map-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; align-items: center; justify-content: center; }
.modal-content { background: white; padding: 1.5rem; border-radius: 12px; width: 90%; max-width: 700px; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
#map { height: 450px; width: 100%; border-radius: 8px; margin-top: 1rem; }
.close-modal { position: absolute; top: 15px; right: 20px; cursor: pointer; font-size: 2rem; color: #666; }

.map-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 1000;
    pointer-events: none; /* ESSENTIAL: Allows clicks to pass through to the map */
    transition: transform 0.2s ease;
}

.map-moving .map-crosshair {
    transform: translate(-50%, -120%) scale(1.1);
    opacity: 0.8;
}

.recenter-btn {
    position: absolute;
    bottom: 80px; /* Above the zoom controls or confirm button */
    right: 10px;
    z-index: 1001;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
}

@media (hover: hover) {
    .recenter-btn:hover {
        background: #f4f4f4;
    }
}

.support-card {
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
}
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.s-btn {
    padding: 10px 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 133%;
    width: 40px;
    align-items: center;
}
.sig { background: #3a76f0;}
.tel { background: #0088cc;}
.wha { background: #25d366;}
.x-com { background: #000;}
.mailto { background: #ea4335;}

.title-link,
.title-link:active,
.title-link:focus {
    text-decoration: none !important;
    color: inherit !important;
    background: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    /* Keeps the mouse cursor as a pointer, but changes nothing else */
    cursor: pointer;
}

@media (hover: hover) {
    .title-link:hover {
    text-decoration: none !important;
    color: inherit !important;
    background: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    /* Keeps the mouse cursor as a pointer, but changes nothing else */
    cursor: pointer;
    }
}

/* back to top arrow */
@keyframes show-button {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: show-button linear;
    animation-timeline: scroll();
    animation-range: 0px 300px;
}
