/* ═══════════════════════════════════════════════════════════
   orla.css – branding & custom styles for orla.energy portal
   ═══════════════════════════════════════════════════════════ */

/* ── Jost font override ───────────────────────────────────── */
body, .navbar, .sidebar, .card, .btn, input, select, textarea, table {
    font-family: 'Jost', sans-serif;
}

/* ── Sidebar logo switching (full ↔ mini) with crossfade ──── */
.sidebar-brand .logo-full,
.sidebar-brand .logo-mini {
    transition: opacity 0.3s ease, max-width 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
    display: block;
}

/* Full visible, mini hidden */
.sidebar-brand .logo-full {
    opacity: 1;
    max-width: 300px;
    max-height: 260px;
}
.sidebar-brand .logo-mini {
    opacity: 0;
    max-width: 0;
    max-height: 0;
}

/* Collapsed sidebar: swap */
body.sidebar-toggled .sidebar-brand .logo-full {
    opacity: 0;
    max-width: 0;
    max-height: 0;
}
body.sidebar-toggled .sidebar-brand .logo-mini {
    opacity: 1;
    max-width: 300px;
    max-height: 210px;
}

@media (max-width: 768px) {
    .sidebar-brand .logo-full {
        opacity: 0;
        max-width: 0;
        max-height: 0;
    }
    .sidebar-brand .logo-mini {
        opacity: 1;
        max-width: 300px;
        max-height: 210px;
    }
}

/* ── Sidebar green gradient ───────────────────────────────── */
.sidebar.bg-gradient-orla {
    background: linear-gradient(180deg, #1a6b3c 0%, #0d3d22 100%);
}

.sidebar .nav-item .nav-link {
    color: rgba(255,255,255,.8);
}
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link {
    color: #fff;
}
.sidebar .nav-item .nav-link i {
    color: rgba(255,255,255,.5);
}
.sidebar .nav-item.active .nav-link i,
.sidebar .nav-item .nav-link:hover i {
    color: rgba(255,255,255,.9);
}
.sidebar .sidebar-brand {
    color: #fff;
}
.sidebar hr.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,.15);
}
.sidebar .sidebar-heading {
    color: rgba(255,255,255,.4);
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08rem;
}
.sidebar .collapse-inner a.collapse-item:hover,
.sidebar .collapse-inner a.collapse-item:focus {
    background-color: rgba(26,107,60,.15);
    color: #1a6b3c;
}
.sidebar .collapse-inner a.collapse-item.active {
    color: #1a6b3c;
    font-weight: 700;
}

/* ── Topbar accent ────────────────────────────────────────── */
.topbar .btn-primary {
    background-color: #1a6b3c !important;
    border-color: #155c33 !important;
}

/* ── Brand logo text ──────────────────────────────────────── */
.sidebar-brand-text {
    font-weight: 800;
    letter-spacing: .03rem;
}
.sidebar-brand-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* ── Status badges ────────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.online  { background: #1cc88a; }
.status-dot.offline { background: #e74a3b; }
.status-dot.warning { background: #f6c23e; }

/* ── Leaflet map container ────────────────────────────────── */
#mainMap, #meteoMap {
    height: 520px;
    border-radius: .35rem;
    z-index: 0;
}

/* ── Popup karta instalacji ───────────────────────────────── */
.inst-popup {
    min-width: 220px;
    font-size: .85rem;
}
.inst-popup h6 { font-weight: 700; margin-bottom: 6px; color: #1a6b3c; }
.inst-popup .badge-soc {
    font-size: .75rem;
    padding: 3px 7px;
    border-radius: 20px;
}

/* ── Chart containers ─────────────────────────────────────── */
.chart-wrapper {
    position: relative;
    height: 300px;
}

/* ── Controls card ────────────────────────────────────────── */
.control-card .form-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #858796;
    margin-bottom: 2px;
}

/* ── Stat circles (dashboard) ─────────────────────────────── */
.stat-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    border: 4px solid;
}
.stat-circle .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-circle .stat-label { font-size: .65rem; text-transform: uppercase; margin-top: 2px; opacity: .8; }

/* ── Meteo legend ─────────────────────────────────────────── */
.meteo-legend {
    background: rgba(255,255,255,.9);
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    font-size: .8rem;
}
.meteo-legend .legend-bar {
    height: 12px;
    border-radius: 4px;
    margin-top: 4px;
}

/* ── Loader spinner ───────────────────────────────────────── */
.orla-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
}
.orla-loader .spinner-border { color: #1a6b3c; }

/* ── Variable checkbox pills ──────────────────────────────── */
.var-pill input[type=checkbox] { display: none; }
.var-pill label {
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    border: 2px solid currentColor;
    background: transparent;
    color: #b7b9cc !important;
    border-color: #d1d3e2 !important;
    transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
    user-select: none;
    opacity: 1;
}
.var-pill input:checked + label {
    color: #fff !important;
    border-color: var(--pill-color, currentColor) !important;
    background: var(--pill-color, currentColor) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

/* ── iframe wrapper ───────────────────────────────────────── */
.iframe-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 400px;
}
.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: .35rem;
}
.iframe-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fc;
    border: 2px dashed #d1d3e2;
    border-radius: .35rem;
    color: #b7b9cc;
    font-size: 1rem;
}

/* ── Orla green btn override ──────────────────────────────── */
.btn-orla {
    background-color: #1a6b3c;
    border-color: #155c33;
    color: #fff;
}
.btn-orla:hover {
    background-color: #155c33;
    border-color: #0d3d22;
    color: #fff;
}
.btn-check:checked + .btn-outline-orla,
.btn-outline-orla.active {
    background-color: #1a6b3c;
    border-color: #1a6b3c;
    color: #fff;
}
.btn-outline-orla {
    border-color: #1a6b3c;
    color: #1a6b3c;
}
.btn-outline-orla:hover {
    background-color: #1a6b3c;
    color: #fff;
}

/* Bootstrap btn-group active state for period selector */
.btn-group .btn.active {
    background-color: #1a6b3c !important;
    border-color: #155c33 !important;
    color: #fff !important;
}

/* ── Telemetry: collapsible variable side-panel ───────────── */
.chart-flex-wrap {
    display: flex;
    align-items: stretch;
    min-height: 0;
}
.chart-main-col {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
}
.var-side-panel {
    width: 160px;
    min-width: 160px;
    max-height: 420px;
    border-left: 1px solid #e3e6f0;
    overflow: hidden;
    overflow-y: auto;
    transition: width .22s ease, min-width .22s ease, opacity .22s ease, padding .22s ease;
    padding: 8px 6px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.var-side-panel.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}
.var-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e3e6f0;
    background: #f8f9fc;
    border: none;
    padding: 0 6px;
    cursor: pointer;
    color: #858796;
    transition: background .15s;
}
.var-panel-toggle:hover { background: #eaecf4; color: #1a6b3c; }
.var-panel-toggle i { transition: transform .22s ease; }
.var-panel-toggle.collapsed i { transform: rotate(180deg); }
.var-side-panel .form-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #858796;
    margin-bottom: 4px;
}
.var-side-panel .var-pill { display: block; margin-bottom: 3px; width: 100%; }
.var-side-panel .var-pill label { width: 100%; text-align: center; }

/* ── Telemetry: dual-range zoom slider ────────────────────── */
.zoom-bar {
    border-top: 1px solid #e3e6f0;
    padding: 10px 4px 4px;
    margin-top: 8px;
}
.zoom-labels {
    display: flex;
    justify-content: space-between;
    font-size: .68rem;
    color: #858796;
    margin-bottom: 3px;
    padding: 0 2px;
}
.zoom-range-wrap {
    position: relative;
    height: 28px;
}
.zoom-range-wrap input[type=range] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
}
.zoom-range-wrap input[type=range]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: #d1d3e2;
}
.zoom-range-wrap input[type=range]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #d1d3e2;
}
.zoom-range-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a6b3c;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    pointer-events: all;
    cursor: ew-resize;
    margin-top: -6px;
}
.zoom-range-wrap input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a6b3c;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    pointer-events: all;
    cursor: ew-resize;
}
.zoom-track-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: #1a6b3c;
    border-radius: 2px;
    pointer-events: none;
}

/* ── Zoom reset hint ──────────────────────────────────────── */
.zoom-hint {
    text-align: center;
    font-size: .7rem;
    color: #858796;
    padding: 4px 0 0;
    cursor: default;
}
