/* Ireland's River & Wetland Birds — map page styles */

:root {
    --brand: #1f5f3f;
    --status-red: #c62828;
    --status-amber: #e68a00;
    --status-green: #2e7d32;
    --spa-fill: #2e7d32;
    --river: #1f6fb4;
    --highlight: #f9a825;
    --sidebar-width: 360px;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.app-navbar {
    background: var(--brand);
    flex: 0 0 auto;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    z-index: 2000;
    background: #fff;
    padding: 0.5rem 0.75rem;
}

/* Login page */
.auth-page {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f1f5f2;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.app-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0; /* lets the map and sidebar scroll within the window */
}

/* Sidebar: fixed width on large screens; Bootstrap turns it into an offcanvas below lg */
@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-width);
        flex: 0 0 var(--sidebar-width);
        overflow-y: auto;
        border-right: 1px solid #dee2e6;
        background: #f8f9fa;
    }
    .sidebar .offcanvas-body {
        display: flex;
        padding: 1rem;
    }
}

.panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.species-filters .form-check {
    margin-bottom: 0.15rem;
}

.tool-modes .btn {
    font-size: 0.8rem;
}

.map-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

#map {
    position: absolute;
    inset: 0;
}

#map.tool-active {
    cursor: crosshair;
}

/* Visible keyboard focus everywhere, including Leaflet controls */
:focus-visible {
    outline: 3px solid var(--highlight) !important;
    outline-offset: 2px;
}

.loading {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #fff;
    border-radius: 2rem;
    padding: 0.35rem 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

/* Banner shown while choosing a sighting location */
.placing-banner {
    position: absolute;
    top: 3.25rem;  /* below the loading indicator, so both stay visible */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: var(--brand);
    color: #fff;
    border-radius: 2rem;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.popup-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

/* Sighting verification */
.verify-badge {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.verify-verified { background: #d1e7dd; color: #0f5132; }
.verify-unverified { background: #fff3cd; color: #664d03; }
.verify-rejected { background: #e2e3e5; color: #41464b; }

/* Results list */
.results-list {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.results-list li {
    border-top: 1px solid #eee;
}

.results-list button {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0.35rem 0.25rem;
    font-size: 0.85rem;
}

.results-list button:hover {
    background: #f1f8f4;
}

/* Conservation status dots (legend, popups, lists) */
.status-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.status-RED { background: var(--status-red); }
.status-AMBER { background: var(--status-amber); }
.status-GREEN { background: var(--status-green); }

/* Map legend */
.legend {
    background: #fff;
    padding: 0.5rem 0.65rem;
    border-radius: 0.4rem;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    font-size: 0.8rem;
    line-height: 1.5;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.legend-swatch {
    display: inline-block;
    width: 1rem;
    height: 0.7rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.legend-spa {
    background: rgba(46, 125, 50, 0.25);
    border: 2px solid var(--spa-fill);
}

.legend-river {
    height: 3px;
    background: var(--river);
}

/* Neutral cluster bubbles, so they aren't confused with Red/Amber/Green status */
.sighting-cluster {
    background: rgba(31, 95, 63, 0.25);
    border-radius: 50%;
}

.sighting-cluster div {
    width: 30px;
    height: 30px;
    margin: 5px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popups */
.popup h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.popup .meta {
    color: #555;
    font-size: 0.8rem;
}

.popup dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.6rem;
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
}

.popup dt {
    font-weight: 600;
}

.popup dd {
    margin: 0;
}

/* --- Offline (PWA) ------------------------------------------------------- */

.offline-banner {
    flex: 0 0 auto;
    background: #5c4400;
    color: #fff;
    font-size: 0.875rem;
    padding: 0.35rem 1rem;
    text-align: center;
}

/* Sightings recorded offline, waiting to upload: hollow, dashed markers */
.queued-sighting-note {
    font-style: italic;
    color: #5c4400;
}

/* --- Field mode ------------------------------------------------------------ */

.field-status {
    background: #eef5fb;
    border-left: 3px solid var(--river);
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
}

.simulate-controls {
    border-top: 1px dashed #ccc;
    padding-top: 0.75rem;
}

/* Alerts stack at the top of the map, newest first */
.field-alerts {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    width: min(92%, 26rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;     /* the map underneath stays usable between alerts */
}

.field-alert {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    animation: field-alert-in 0.25s ease-out;
}

.field-alert-enter { background: var(--brand); }
.field-alert-leave { background: #4b5563; }
.field-alert-red { background: var(--status-red); }
.field-alert-amber { background: #a86400; }   /* darker than the marker amber, for white text */

@keyframes field-alert-in {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .field-alert { animation: none; }
}
