/* Maritime Navigational Warnings — LJA vizuālā identitāte */
/* Krāsas: #003D61 (primārā), #5CABBF (akcentkrāsa), #FA3D5E (brīdinājumi), #EDE5CF (krēms), #B8B8B5 (pelēks) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --navy:       #003D61;
    --navy-light: #004f7c;
    --navy-mid:   #005f94;
    --blue:       #5CABBF;
    --blue-light: #eaf5f8;
    --red:        #FA3D5E;
    --green:      #2e7d32;
    --orange:     #D35636;
    --teal:       #5CABBF;
    --pink:       #FA3D5E;
    --cream:      #EDE5CF;
    --gray-brand: #B8B8B5;
    --text:       #003D61;
    --text-muted: #6b8599;
    --bg:         #f4f6f8;
    --card:       #ffffff;
    --border:     #d8e2e8;
    --radius:     6px;
    --shadow:     0 2px 8px rgba(0,61,97,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.header {
    background: var(--navy);
    color: #fff; padding: 0 24px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18); position: relative; z-index: 1000;
}
.header-left { display: flex; align-items: center; gap: 20px; }

/* LJA logotipa zīme */
.header-logo {
    display: flex; align-items: center; gap: 12px;
    border-left: 2px solid rgba(255,255,255,0.2);
    padding-left: 16px;
}
.logo-img {
    height: 28px; width: auto; filter: brightness(0) invert(1);
}
.logo-divider {
    width: 1px; height: 28px; background: rgba(255,255,255,0.25);
}
.logo-text-block { display: flex; flex-direction: column; }
.logo-title { font-size: 13px; font-weight: 600; color: #fff; letter-spacing: 0.2px; line-height: 1.2; }
.logo-sub { font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.6); letter-spacing: 0.3px; margin-top: 1px; }

.header-right { display: flex; align-items: center; gap: 8px; }

/* ── STAT BADGES ─────────────────────────────────────────────────────────── */
.stat-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
    background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.18); letter-spacing: 0.2px;
}
.stat-badge .num { font-size: 13px; font-weight: 700; color: #fff; }
a.pdf-badge { text-decoration: none; cursor: pointer; transition: all 0.2s; }
a.pdf-badge:hover { background: rgba(92,171,191,0.35); border-color: var(--teal); color: #fff; }
.enc-toggle { cursor: pointer; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); transition: all 0.2s; }
.enc-toggle:hover { background: rgba(92,171,191,0.3); }
.enc-toggle.active { background: rgba(92,171,191,0.45); border-color: var(--teal); }

/* ── LANGUAGE SWITCHER ───────────────────────────────────────────────────── */
.lang-switcher { display: flex; align-items: center; gap: 4px; }
.lang-btn {
    display: flex; align-items: center; gap: 5px; padding: 4px 10px;
    border: 1.5px solid rgba(255,255,255,0.2); border-radius: 4px;
    background: transparent; color: rgba(255,255,255,0.6); cursor: pointer;
    font-size: 11px; font-family: inherit; font-weight: 600;
    letter-spacing: 0.8px; transition: all 0.18s ease; line-height: 1;
}
.lang-btn:hover  { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.4); }
.lang-btn.active { background: rgba(92,171,191,0.3); color: #fff; border-color: var(--teal); }
.lang-flag { width: 18px; height: 13px; vertical-align: middle; border-radius: 1px; }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.layout { display: flex; height: calc(100vh - 60px); position: relative; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: 380px; background: var(--card); border-right: 1px solid var(--border);
    overflow-y: auto; flex-shrink: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    overflow-x: hidden;
}
.sidebar.collapsed { width: 0; opacity: 0; border-right: none; }

/* SIDEBAR TOGGLE */
.sidebar-toggle {
    position: relative; z-index: 500;
    width: 18px; flex-shrink: 0; align-self: center; height: 56px;
    background: var(--card); border: 1px solid var(--border);
    border-left: none; border-radius: 0 4px 4px 0;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
    box-shadow: 2px 0 6px rgba(0,0,0,0.06);
}
.sidebar-toggle:hover { background: var(--blue-light); color: var(--navy); }
.sidebar-toggle-icon { font-size: 16px; line-height: 1; }

.sidebar-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.sidebar-header h3 { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-search { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.sidebar-search input {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13px; outline: none; transition: border-color 0.2s; font-family: inherit;
    color: var(--text);
}
.sidebar-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(92,171,191,0.12); }

/* TYPE FILTER */
.sidebar-filter {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 5px;
}
.type-filter-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 500;
    border: 1.5px solid var(--border); background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: inherit;
}
.type-filter-btn img { width: 13px; height: 13px; }
.type-filter-btn:hover { border-color: var(--teal); color: var(--navy); background: var(--blue-light); }
.type-filter-btn.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.type-filter-btn.active img { filter: brightness(0) invert(1); }

/* NOTICE LIST */
.notice-list { padding: 8px; }
.notice-card {
    padding: 12px 14px; border-radius: var(--radius); cursor: pointer;
    border: 1px solid transparent; margin-bottom: 3px; transition: all 0.15s;
}
.notice-card:hover { background: var(--blue-light); border-color: var(--border); }
.notice-card.active { background: var(--blue-light); border-color: var(--teal); border-left: 3px solid var(--teal); }
.notice-card-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; color: var(--navy); }
.notice-card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 12px; align-items: center; }
.notice-card-type { display: inline-flex; align-items: center; gap: 4px; }
.notice-card-type img { width: 14px; height: 14px; }
.badge-new {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 10px; font-weight: 700; background: var(--pink); color: #fff;
    letter-spacing: 0.3px;
}
.notice-card-zone {
    display: inline-block; padding: 1px 5px; border-radius: 3px;
    font-size: 9px; font-weight: 700; background: #fce4ec; color: #c0392b;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.notice-card-radius {
    display: inline-block; padding: 1px 5px; border-radius: 3px;
    font-size: 9px; font-weight: 700; background: var(--blue-light); color: var(--navy);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── MAP ─────────────────────────────────────────────────────────────────── */
.map-container { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

/* Marker */
.marker-icon-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }
.marker-img { filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); }
.marker-pulse {
    position: absolute; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(250,61,94,0.2); animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Popup */
.popup-maritime { min-width: 270px; max-width: 380px; font-family: inherit; }
.popup-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid #f0f2f5; }
.popup-icon { width: 28px; height: 28px; flex-shrink: 0; margin-top: 2px; }
.popup-header-text { flex: 1; min-width: 0; }
.popup-type { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 3px; }
.popup-title { font-size: 14px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.popup-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.4px; padding: 1px 5px; border-radius: 3px; }
.popup-badge--new    { background: #fff3e0; color: var(--orange); }
.popup-badge--area   { background: #fce4ec; color: #c0392b; }
.popup-badge--radius { background: var(--blue-light); color: var(--navy); }
.popup-desc { font-size: 12px; line-height: 1.6; color: #444; background: #f8f9fa; border-left: 3px solid var(--teal); border-radius: 0 4px 4px 0; padding: 8px 10px; margin-bottom: 12px; }
.popup-meta { display: flex; flex-direction: column; gap: 6px; }
.popup-row { display: flex; align-items: baseline; gap: 8px; }
.popup-row-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; min-width: 82px; flex-shrink: 0; }
.popup-row-value { font-size: 12px; color: #2c3e50; line-height: 1.4; }
.popup-radius-m { color: var(--text-muted); font-size: 11px; }
.popup-poly-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f2f5; }
.popup-section-title { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.popup-coord-count { font-weight: 400; color: #aaa; text-transform: none; }
.popup-coord-table { border-collapse: collapse; width: 100%; }
.popup-coord-table .ptbl-num { color: #bbb; font-size: 10px; padding: 2px 6px 2px 0; width: 18px; }
.popup-coord-table .ptbl-coord { font-size: 11px; color: #2c3e50; padding: 2px 10px 2px 0; font-variant-numeric: tabular-nums; }

/* Territorial waters */
.territorial-label {
    background: none !important; border: none !important; box-shadow: none !important;
    color: rgba(92,171,191,0.6); font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* Leaflet overrides */
.leaflet-popup-content-wrapper { border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; }
.leaflet-popup-content { margin: 14px !important; }

/* ENC popup */
.enc-popup { font-size: 13px; }
.enc-popup b { color: var(--navy); }

/* Slēpj Google Translate joslu */
.goog-te-banner-frame, .skiptranslate { display: none !important; }
body { top: 0 !important; }
#google_translate_element { display: none !important; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { width: 100%; max-height: 40vh; }
    .layout { flex-direction: column; }
    .stat-badge { display: none; }
    .logo-title { font-size: 12px; }
}

/* ── KOORDINĀTU DISPLEJS ──────────────────────────────────────────────────── */
.map-coords-display {
    background: rgba(0, 61, 97, 0.85);
    color: #e8f4fc;
    border-radius: 5px;
    padding: 6px 10px;
    font-family: 'Consolas', 'SF Mono', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.55;
    min-width: 238px;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.28);
    margin-bottom: 4px;
}
.map-coord-ddm {
    font-weight: 700;
    color: #5CABBF;
    letter-spacing: 0.3px;
}
.map-coord-dd {
    font-size: 11px;
    color: rgba(232, 244, 252, 0.58);
    margin-top: 1px;
}

/* Leaflet mēroga josla — stilizācija atbilstoši LJA krāsām */
.leaflet-control-scale-line {
    border-color: var(--navy) !important;
    border-top: none !important;
    color: var(--navy) !important;
    font-size: 10px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    background: rgba(255,255,255,0.88) !important;
    padding: 1px 5px !important;
    border-radius: 0 0 3px 3px !important;
}
