/* Radar Nieba 0.1.39 — legenda mapy */

#rnLegendUi {
    position: fixed;
    z-index: 1260;
    right: 14px;
    bottom: calc(14px + var(--rn-desktop-history-timeline-offset, 0px));
    font-family: Arial, sans-serif;
    color: #eef6ff;
    transition: bottom .16s ease, right .16s ease;
}

body.rn-right-open #rnLegendUi {
    right: 394px;
}

#rnLegendToggle {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 12px;
    background: #08111a;
    color: #dce8f2;
    box-shadow: 0 8px 24px rgba(0,0,0,.30);
    font: 700 11px/1 Arial, sans-serif;
    cursor: pointer;
}

.rn-legend-toggle-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(125,166,199,.46);
    border-radius: 50%;
    color: #9fc6e4;
    font-size: 11px;
    font-weight: 800;
}

#rnLegendPanel {
    position: absolute;
    right: 0;
    bottom: 48px;
    width: min(430px, calc(100vw - 28px));
    max-height: min(72vh, 680px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 18px;
    background: #071019;
    box-shadow: 0 20px 54px rgba(0,0,0,.46);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(.99);
    transform-origin: bottom right;
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

#rnLegendUi.is-open #rnLegendPanel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.rn-legend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 5px 10px;
}

.rn-legend-title {
    color: #f8fbff;
    font-size: 14px;
    font-weight: 800;
}

.rn-legend-subtitle {
    margin-top: 3px;
    color: #71869a;
    font-size: 9.5px;
}

.rn-legend-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: 9px;
    background: rgba(148,163,184,.09);
    color: #a8bacb;
    font: 700 19px/1 Arial, sans-serif;
    cursor: pointer;
}

.rn-legend-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr;
    gap: 5px;
    margin: 0 2px 10px;
    padding: 4px;
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 12px;
    background: rgba(15,23,42,.62);
}

.rn-legend-tabs button {
    min-width: 0;
    min-height: 38px;
    padding: 6px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #7f94a8;
    font: 700 9.5px/1.2 Arial, sans-serif;
    cursor: pointer;
}

.rn-legend-tabs button[aria-selected="true"] {
    background: #14283a;
    color: #f0f7fd;
    box-shadow: inset 0 0 0 1px rgba(91,164,216,.18);
}

.rn-legend-tab-content[hidden] {
    display: none !important;
}

.rn-legend-tab-content {
    padding: 0 4px 4px;
}

.rn-legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 4px 8px;
}

.rn-legend-item {
    min-width: 0;
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 3px;
    color: #c2d0dc;
    font-size: 9.8px;
    line-height: 1.25;
}

.rn-legend-symbol {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    position: relative;
}

.rn-legend-aircraft-symbol { color: var(--rn-legend-color, #3b82f6); }
.rn-legend-aircraft-symbol svg {
    width: 25px;
    height: 25px;
    display: block;
    fill: currentColor;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.5));
}

.rn-legend-threat-symbol > .rn-neptun-marker,
.rn-legend-threat-symbol .rn-neptun-marker {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 36px !important;
    height: 36px !important;
    transform: translate(-50%,-50%) scale(.72) !important;
    transform-origin: center !important;
}

.rn-legend-threat-symbol .rn-neptun-count,
.rn-legend-threat-symbol .rn-threat-label,
.rn-legend-threat-symbol .rn-threat-distance { display: none !important; }

.rn-legend-fallback-dot {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.72);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.rn-legend-area,
.rn-legend-uncertainty {
    width: 26px;
    height: 18px;
    flex: 0 0 26px;
    display: inline-block;
    border-radius: 5px;
}

.rn-legend-area-closure { border: 2px solid #ef4444; background: rgba(239,68,68,.20); }
.rn-legend-area-restriction { border: 2px solid #f59e0b; background: rgba(245,158,11,.18); }
.rn-legend-area-approx { border: 2px dashed #f59e0b; background: rgba(245,158,11,.08); }
.rn-legend-area-rcb-air { border: 2px solid #dc3545; background: rgba(220,53,69,.25); }
.rn-legend-area-rcb-other { border: 2px solid #e7a329; background: rgba(231,163,41,.18); }
.rn-legend-area-neptun { border: 2px solid #ef4444; background: repeating-linear-gradient(135deg, rgba(239,68,68,.16) 0 4px, rgba(245,158,11,.10) 4px 8px); }
.rn-legend-uncertainty { border: 2px dashed #94a3b8; border-radius: 50%; background: rgba(148,163,184,.07); }

.rn-legend-border-line {
    width: 27px;
    height: 0;
    flex: 0 0 27px;
    display: inline-block;
    border-top: 3px solid #2f6fd6;
    border-radius: 99px;
}

.rn-legend-empty,
.rn-legend-note {
    color: #71869a;
    font-size: 9px;
    line-height: 1.4;
}

.rn-legend-empty { padding: 8px 4px; }
.rn-legend-note { margin: 8px 3px 0; padding-top: 8px; border-top: 1px solid rgba(148,163,184,.09); }

#rnLegendBackdrop { display: none; }

@media (max-width: 900px) {
    body.rn-mobile-ui #rnLegendUi,
    html.rn-mobile-boot #rnLegendUi {
        position: fixed;
        z-index: 1245;
        top: calc(56px + var(--rn-mobile-safe-top, 0px)) !important;
        right: 6px !important;
        left: auto !important;
        bottom: auto;
        width: 42px;
        margin: 0;
    }


    body.rn-mobile-ui.rn-layers-open #rnLegendUi {
        opacity: 0;
        pointer-events: none;
    }

    body.rn-mobile-ui #rnLegendToggle {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        gap: 0;
        border-radius: 13px;
        font-size: 0;
        background: #08111a;
        box-shadow: 0 7px 22px rgba(0,0,0,.30);
    }

    body.rn-mobile-ui #rnLegendToggle > span:last-child {
        display: none;
    }

    body.rn-mobile-ui .rn-legend-toggle-icon {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    body.rn-mobile-ui #rnLegendPanel {
        position: fixed;
        z-index: 1265;
        left: 8px;
        right: 8px;
        bottom: calc(var(--rn-mobile-bar-h, 58px) + var(--rn-mobile-safe-bottom, 0px) + 7px);
        width: auto;
        max-height: min(72dvh, 680px);
        padding: 10px 10px 12px;
        border-radius: 20px;
        background: #071019;
        transform: translateY(22px);
        transform-origin: bottom center;
    }

    body.rn-mobile-ui #rnLegendUi.is-open #rnLegendPanel { transform: translateY(0); }
    body.rn-mobile-ui #rnLegendUi.is-open #rnLegendToggle { opacity: 0; pointer-events: none; }

    body.rn-mobile-ui #rnLegendBackdrop {
        display: block;
        position: fixed;
        z-index: 1240;
        inset: 0;
        background: rgba(2,8,15,.30);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 0;
        pointer-events: none;
        transition: opacity .14s ease;
    }

    body.rn-mobile-ui #rnLegendBackdrop.visible { opacity: 1; pointer-events: auto; }

    body.rn-mobile-ui .rn-legend-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0,1fr));
        gap: 5px;
        overflow: visible;
    }

    body.rn-mobile-ui .rn-legend-tabs button {
        min-width: 0;
        min-height: 42px;
        padding: 7px 6px;
        font-size: 9px;
        white-space: normal;
    }

    body.rn-mobile-ui .rn-legend-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 4px 6px;
    }

    body.rn-mobile-ui .rn-legend-item {
        min-height: 42px;
        font-size: 10px;
    }
}

@media (max-width: 430px) {
    body.rn-mobile-ui .rn-legend-grid-areas { grid-template-columns: 1fr; }
}
