/* ═══════════════════════════════════════════════════════════════
   EŽERŲ ŽEMĖLAPIS – map.css
   Naudoja pagrindinio style.css spalvų/tarpų kintamuosius.
═══════════════════════════════════════════════════════════════ */

.map-hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: calc(var(--header-height) + var(--space-10)) 0 var(--space-10);
    border-bottom: 1px solid var(--border-color);
}
.map-hero h1 {
    font-size: var(--text-4xl); font-weight: var(--weight-bold);
    color: var(--text-primary); line-height: 1.2;
    margin: var(--space-4) 0;
}
.map-hero .lead {
    font-size: var(--text-lg); color: var(--text-secondary); line-height: 1.7;
}
.breadcrumb {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--text-sm); color: var(--text-muted); padding-bottom: var(--space-2);
}
.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: 0.4; }

.map-page {
    padding-top: var(--space-10);
    padding-bottom: var(--space-16);
}

.lake-map {
    width: 100%;
    height: 640px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--bg-secondary);
}
@media (max-width: 640px) {
    .lake-map { height: 480px; }
}

.map-note {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Ežero pasiūlymo mygtukas – rodomas tiesiai ant žemėlapio (viršuje dešinėje) */
.suggest-lake-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 10px var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    font-family: inherit;
    color: #fff;
    background: var(--diary-accent);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    white-space: nowrap;
    transition: opacity 0.15s ease;
}
.suggest-lake-toggle:hover {
    opacity: 0.9;
}

/* Ežerų paieška – viršuje kairėje, pilno pločio "piliulės" laukas (zoom mygtukai pašalinti) */
.lake-search-control {
    position: relative;
    width: 260px;
}
.lake-search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 16px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.lake-search-icon {
    flex-shrink: 0;
    font-size: 15px;
    line-height: 1;
    opacity: 0.55;
}
.lake-search-input {
    flex: 1;
    min-width: 0;
    padding: 0;
    font-size: var(--text-sm);
    font-family: inherit;
    color: #333;
    background: transparent;
    border: none;
    box-shadow: none;
}
.lake-search-input::placeholder { color: #888; }
.lake-search-input:focus { outline: none; }
.lake-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    z-index: 1000;
    padding: var(--space-1);
}
.lake-search-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: #222;
    border-radius: 10px;
    cursor: pointer;
}
.lake-search-option:hover { background: #f0f4f8; }
.lake-search-option-name { flex: 1; }
.lake-search-option-region {
    font-size: var(--text-xs);
    color: #888;
    white-space: nowrap;
}
.lake-search-empty {
    padding: 8px 12px;
    font-size: var(--text-sm);
    color: #888;
}
@media (max-width: 640px) {
    /* Siauresnis, kad nesusidurtų su "Pasiūlyti ežerą" mygtuku (topright), kuris tame pačiame plotyje */
    .lake-search-control { width: 150px; }
}
@media (max-width: 400px) {
    .lake-search-control { width: 120px; }
}

/* Ežero pasiūlymo forma – langas virš viso puslapio (fixed, nepriklauso nuo žemėlapio overflow) */
.suggest-lake-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}
.suggest-lake-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2001;
    width: 340px;
    max-width: calc(100vw - 2 * var(--space-4));
    max-height: calc(100vh - 2 * var(--space-4));
    overflow-y: auto;
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.suggest-lake-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}
.suggest-lake-header h3 {
    font-size: var(--text-base);
    font-weight: var(--weight-semi);
    color: var(--text-primary);
    margin: 0;
}
.suggest-lake-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
}
.suggest-lake-close:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}
.suggest-lake-intro {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 var(--space-4);
    line-height: 1.5;
}
.form-row {
    margin-bottom: var(--space-3);
}
.form-row label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}
.form-row input,
.form-row textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}
.form-row--honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.form-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    margin-top: var(--space-4);
}
.suggest-lake-submit {
    width: 100%;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}
.suggest-lake-status {
    font-size: var(--text-sm);
    text-align: center;
}
.suggest-lake-status.ok { color: #22c55e; }
.suggest-lake-status.err { color: #ef4444; }

/* Tamsi tema: apverčiame OSM plytelių spalvas, kad žemėlapis derėtų su svetainės tema */
:root[data-theme="dark"] .lake-map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9) saturate(0.8);
}

/* Ežero žymeklis – "ašaros lašo" formos smeigtukas */
.lake-marker-icon { background: none; border: none; }

.lake-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, var(--color-primary), #0369a1);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.lake-pin:hover {
    transform: rotate(-45deg) scale(1.12);
}
.lake-pin-icon {
    transform: rotate(45deg);
    font-size: 15px;
    line-height: 1;
}

/* Cluster žymeklis (Leaflet.markercluster) – kai keli ežerai arti vienas kito
   mažame zoom lygyje susilieja į vieną tašką su skaičiumi. Perstilizuota nuo
   plugino numatytosios pilkos/geltonos į svetainės mėlyną paletę. */
.marker-cluster {
    background: none;
}
.marker-cluster div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #0369a1);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
    color: #fff;
    font-weight: var(--weight-bold);
    font-size: var(--text-sm);
}
.marker-cluster-large div { width: 44px; height: 44px; font-size: var(--text-base); }
.marker-cluster span { line-height: 1; }

/* Popup */
.lake-map .leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.lake-map .leaflet-popup-tip {
    background: var(--bg-secondary);
}
.lake-map .leaflet-popup-content {
    margin: var(--space-3) var(--space-4);
    min-width: 200px;
}

.lake-popup h3 {
    font-size: var(--text-base);
    font-weight: var(--weight-semi);
    color: var(--text-primary);
    margin: 0 0 var(--space-2);
}
.lake-popup .lake-popup-region {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: -6px 0 var(--space-3);
}
.lake-popup .lake-popup-status {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.lake-popup .lake-popup-scores {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-2);
}
.lake-popup .lake-popup-score {
    flex: 1;
    text-align: center;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
}
.lake-popup .lake-popup-score .val {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
}
.lake-popup .lake-popup-score .lbl {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.lake-popup .lake-popup-score.white .val { color: var(--color-primary); }
.lake-popup .lake-popup-score.pred .val { color: var(--color-orange); }
.lake-popup .lake-popup-link {
    display: block;
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-primary);
    text-decoration: none;
}
.lake-popup .lake-popup-link:hover { text-decoration: underline; }
