/* ============================================
   FOMS BMS Demo - Lighting (Oswietlenie) page
   Pozycje z PX: Oswietlenie_Workspace_P0.px
   ============================================ */

/* === Sidebar — usun niebieskie podswietlenie aktywnej zakladki === */
.sidebar-item.active {
    border-left: none;
    background: none;
}

/* Zolty pasek akcentu przy aktywnej zakladce Oswietlenie */
.si-oswietlenie.active::before {
    content: '';
    position: absolute;
    right: -4px;
    top: 0;
    width: 4px;
    height: 85px;
    background: #ffc460;
    z-index: 50;
}

.sidebar-layers {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    width: 120px;
    background: #262626;
}
.layer-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 2px;
    cursor: pointer;
}
.layer-btn:hover { background: rgba(255,255,255,0.05); }
.layer-btn.layer-active { background: rgba(79,195,247,0.12); }
.layer-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(0.7);
}
.layer-num {
    color: #b0aeae;
    font-size: 16px;
    font-weight: 300;
}

/* === Breadcrumb Oswietlenie === */
.bc-osw .breadcrumb-icon {
    filter: brightness(0) invert(0.5);
}

/* ============================================
   LEFT PANELS — Oswietlenie w hali + teren
   PX: hala(85,85, 490x435), teren(85,535, 490x325)
   +10px offset → CSS: left:95
   ============================================ */
.osw-panel {
    position: absolute;
    background: #262626;
    width: 490px;
    overflow: hidden;
}
.osw-panel-hala {
    left: 95px;
    top: 70px;
    height: 435px;
}
.osw-panel-teren {
    left: 95px;
    top: 520px;
    height: 325px;
}

/* PX: title layout="30,15,290,25" font="bold 18pt Roboto Thin" */
.osw-panel-title {
    position: absolute;
    left: 30px; top: 15px;
    width: 425px; height: 25px;
    font-size: 18px;
    font-weight: 300;
    color: #b0aeae;
    padding-left: 5px;
}

/* PX: Line #ffc460 geom=25,48→465,48 */
.osw-accent-line {
    position: absolute;
    left: 25px; top: 48px;
    width: 440px;
    height: 1px;
    background: #ffc460;
}

/* === Labels & setpoints === */
.osw-label {
    position: absolute;
    font-size: 17px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    padding-left: 5px;
}
/* PX: "Sterowanie centralne:" at (25,65) */
.osw-label-central { left: 25px; top: 65px; width: 210px; }
/* PX: "Tryb pracy:" at (80,73) */
.osw-label-tryb { left: 80px; top: 73px; width: 130px; }

.osw-setpoint {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20,20,20,0.5);
    padding: 0;
    cursor: pointer;
    box-sizing: border-box;
}
.osw-setpoint:hover { background: rgba(30,30,30,0.6); }
.osw-sp-value {
    color: #b0aeae;
    font-size: 15px;
    font-weight: 300;
    flex: 1;
    text-align: center;
}
.osw-sp-arrow {
    width: 23px;
    height: 23px;
}
/* PX: Central setpoint at (245,65, 155x25) */
.osw-setpoint-central {
    left: 245px; top: 65px;
    width: 155px; height: 25px;
}
/* PX: Tryb setpoint at (220,73, 155x25) */
.osw-setpoint-tryb {
    left: 220px; top: 73px;
    width: 155px; height: 25px;
}

/* PX: calendar icon at (410,70, 30x30) */
.osw-calendar-icon {
    position: absolute;
    left: 410px; top: 70px;
    width: 30px; height: 30px;
    filter: brightness(0) invert(0.5);
    cursor: pointer;
}
.osw-calendar-icon:hover { filter: brightness(0) invert(0.8); }

/* === Section header === */
.osw-section-header {
    position: absolute;
    font-size: 17px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    padding-left: 5px;
}
/* PX: "Sterowanie strefami oswietlenia" at (25,115) */
.osw-section-p0 { left: 25px; top: 115px; width: 310px; }

/* === Zone controls grid — 2 columns × 6 rows === */
/* PX: left col labels at x=25, controls at x=75; right col labels at x=255, controls at x=305 */
/* PX: rows y=155,190,225,260,295,330 (step 35px), control size 155x25 */
.osw-zone-grid {
    position: absolute;
    left: 25px; top: 145px;
    width: 445px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 25px;
}
.osw-zone-row {
    display: flex;
    align-items: center;
    height: 25px;
}
.osw-zone-row .osw-zone-label {
    font-size: 16px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    width: 50px;
    padding-left: 5px;
    flex-shrink: 0;
}
/* PX: Setpoint 155x25, bg #80141414, fg #b0aeae, font 15pt Roboto Thin */
.osw-zone-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 155px; height: 25px;
    background: rgba(20,20,20,0.5);
    padding: 0;
    cursor: pointer;
    box-sizing: border-box;
}
.osw-zone-control:hover { background: rgba(30,30,30,0.6); }
.osw-zone-value {
    color: #b0aeae;
    font-size: 15px;
    font-weight: 300;
    flex: 1;
    text-align: center;
}
/* PX: expand_button.svg at (130,1,23,23) */
.osw-zone-control .osw-sp-arrow,
.osw-setpoint .osw-sp-arrow {
    width: 23px; height: 23px;
    margin: auto 1px auto auto;
    flex-shrink: 0;
}

/* ============================================
   SUN TABLE (Teren zewnetrzny)
   PX: rows at y=195, 230, 265
   ============================================ */
.osw-sun-table {
    position: absolute;
    left: 20px; top: 130px;
    width: 450px;
}
.osw-sun-header {
    display: grid;
    grid-template-columns: 140px 55px 105px 75px;
    gap: 10px;
    padding-bottom: 8px;
}
.osw-sun-header span {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    text-align: center;
    background: none;
    padding: 0;
    line-height: 1.2;
}
.osw-sun-row {
    display: grid;
    grid-template-columns: 140px 55px 105px 75px;
    gap: 10px;
    height: 32px;
    align-items: center;
}
.osw-sun-col1 {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    padding-left: 5px;
}
.osw-sun-col2 {
    font-size: 15px;
    font-weight: 300;
    color: #b0aeae;
    text-align: center;
}
.osw-sun-col3 {
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Offset control — setpoint-style z arrow button */
.osw-offset-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 105px; height: 25px;
    background: rgba(20,20,20,0.5);
    cursor: pointer;
    box-sizing: border-box;
}
.osw-offset-control:hover { background: rgba(30,30,30,0.6); }
.osw-offset-value {
    font-size: 15px;
    font-weight: 300;
    color: #b0aeae;
    flex: 1;
    text-align: center;
}
.osw-offset-control .osw-sp-arrow {
    width: 23px; height: 23px;
    margin: auto 1px auto auto;
    flex-shrink: 0;
}
.osw-sun-col4 {
    font-size: 16px;
    font-weight: 300;
    color: rgba(255,255,255,0.9);
    background: rgba(20,20,20,0.5);
    text-align: center;
    padding: 2px 6px;
}

/* === Overlay blokujacy tabele (tryb != Astronomiczny) === */
/* PX: layout="265,135,210,170" bg=#bf262626 + layout="25,255,230,50" bg=#e6262626 */
.osw-teren-overlay {
    position: absolute;
    left: 233px; top: 120px;
    width: 197px; height: 195px;
    background: rgba(38,38,38,0.75);
    color: white;
    font-size: 16px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 30px;
    z-index: 5;
}
.osw-teren-overlay-bottom {
    left: 20px; top: 270px;
    width: 220px; height: 45px;
    background: rgba(38,38,38,0.90);
}
.osw-teren-overlay.hidden { display: none; }

/* ============================================
   MAP — z ProgramData DEMO station
   PX: CanvasPane 1120x785, demo.png fitRatio → 1120x609 top-aligned
   ============================================ */
.osw-map-container {
    position: absolute;
    left: 630px; top: 55px;
    width: 1120px; height: 785px;
    background: #141414;
    overflow: visible;
}
.osw-map {
    position: relative;
    width: 1120px;
    height: 785px;
}

/* Background: demo.png 1840x1000, fitRatio w 1120x785 → 1120x609, centered */
.osw-map-bg {
    position: absolute;
    top: 0; left: 0;
    width: 1120px;
    height: 785px;
    object-fit: contain;
    opacity: 0.7;
}

/* === Outdoor zone — Path wokol hali (oswietlenie zewnetrzne) === */
.osw-outdoor-zone {
    position: absolute;
    top: 0; left: 0;
    width: 1300px; height: 1000px;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}
.osw-outdoor-zone path {
}

/* === 12 zone overlays — dokladne geom z ProgramData PX === */
/* PX: pen="2.0 dash(8.0,2.0)" — obrys przerywany w kolorze wypelnienia */
.osw-zone-overlay {
    position: absolute;
    background-color: rgba(255,196,96,0);
    border: 2px dashed rgba(255,196,96,0);
    box-sizing: border-box;
    cursor: pointer;
}
.osw-zone-overlay:hover {
    outline: 2px solid white;
    outline-offset: -2px;
}

/* SVG zones (SO9, SO11) — polygon stroke zamiast CSS border */
.osw-zone-svg {
    border: none;
    background: none;
    overflow: visible;
}
.osw-zone-svg polygon {
    stroke-width: 2;
    stroke-dasharray: 8 2;
}
.osw-zone-svg:hover {
    outline: none;
}
.osw-zone-svg:hover polygon {
    stroke: white;
    stroke-dasharray: none;
}

/* Kazdy zone: border-right usuniety (sasiad z prawej daje swoj border-left),
   gorny rzad: border-bottom usuniety (dolny rzad daje swoj border-top).
   SO10,SO12 pod SVG: border-top usuniety (SVG polygon stroke zastepuje).
   Width rozszerzony o gap (1-2px) zeby fill siegnal do sasiada. */
#zone-so1  { left:  75px; top: 211px; width: 164px; height: 246px; border-right: none; border-bottom: none; }
#zone-so2  { left:  75px; top: 457px; width: 165px; height:  39px; border-right: none; }
#zone-so3  { left: 239px; top: 192px; width: 175px; height: 265px; border-right: none; border-bottom: none; }
#zone-so4  { left: 240px; top: 457px; width: 174px; height:  39px; border-right: none; }
#zone-so5  { left: 414px; top: 192px; width: 180px; height: 313px; border-right: none; border-bottom: none; }
#zone-so6  { left: 414px; top: 505px; width: 180px; height:  39px; border-right: none; }
#zone-so7  { left: 594px; top: 192px; width: 176px; height: 313px; border-right: none; border-bottom: none; }
#zone-so8  { left: 594px; top: 505px; width: 176px; height:  39px; border-right: none; }
#zone-so10 { left: 770px; top: 505px; width: 177px; height:  39px; border-right: none; border-top: none; }
#zone-so12 { left: 947px; top: 505px; width:  94px; height:  39px; border-top: none; }

/* SO9: L-shaped SVG polygon 770,193→947,505 (+1px right do SO11) */
#zone-so9  { left: 770px; top: 193px; width: 177px; height: 312px; }
/* SO11: L-shaped SVG polygon 947,204→1079,505 */
#zone-so11 { left: 947px; top: 204px; width: 132px; height: 301px; }

/* === Zone labels (StrefaOswietlenia.px, 103x80) === */
.osw-zone-label-box {
    position: absolute;
    width: 103px; height: 80px;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}
/* PX: zone name — 18pt Roboto Thin */
.zlb-name {
    font-size: 18px;
    font-weight: 300;
    color: white;
    line-height: 1.4;
    white-space: nowrap;
}
/* PX: value row — value + % inline, baseline-aligned */
.zlb-value-row {
    white-space: nowrap;
    line-height: 1;
}
/* PX: value — bold 45pt Roboto Thin */
.zlb-val {
    font-size: 45px;
    font-weight: 300;
    color: white;
}
/* PX: % — 20pt Roboto Thin, flows inline after value */
.zlb-pct {
    font-size: 20px;
    font-weight: 300;
    color: white;
    padding-left: 1px;
}

/* Label positions — dokladne z PX BoundLabel geom */
#lbl-so1  { left:  80px; top: 220px; }
#lbl-so3  { left: 246px; top: 200px; }
#lbl-so5  { left: 420px; top: 200px; }
#lbl-so7  { left: 600px; top: 200px; }
#lbl-so9  { left: 780px; top: 210px; }
#lbl-so11 { left: 960px; top: 210px; }

#lbl-so2  { left:  80px; top: 460px; }
#lbl-so4  { left: 245px; top: 460px; }
#lbl-so6  { left: 420px; top: 510px; }
#lbl-so8  { left: 600px; top: 510px; }
#lbl-so10 { left: 780px; top: 510px; }
#lbl-so12 { left: 960px; top: 510px; }

/* ============================================
   PICKER MODAL — SterowanieOswPicker.png
   ============================================ */
.osw-picker-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.osw-picker-overlay.visible { display: flex; }

.osw-picker {
    background: #1e1e1e;
    border: 1px solid #555;
    min-width: 175px;
    font-family: 'Roboto', sans-serif;
    position: relative;
}
.osw-picker-title {
    background: linear-gradient(to bottom, #6a7a9e, #3d4d70);
    color: #ddd;
    font-size: 13px;
    font-weight: 400;
    padding: 3px 8px;
}
.osw-picker-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 8px 4px;
    padding: 3px 8px;
    border: 1px solid #666;
    background: #2a2a2a;
    color: white;
    font-size: 13px;
    cursor: pointer;
}
.osw-picker-current:hover { border-color: #888; }
.osw-picker-current .osw-sp-arrow {
    width: 18px; height: 18px;
}
.osw-picker-sep {
    color: #888;
    font-size: 13px;
    padding: 0 10px 4px;
    user-select: none;
}
.osw-picker-list {
    display: none;
    position: absolute;
    left: 8px; right: 8px;
    top: 52px;
    background: #1e1e1e;
    border: 1px solid #666;
    border-top: none;
    z-index: 10;
    padding-bottom: 4px;
}
.osw-picker-list.expanded {
    display: block;
}
.osw-picker-options {
    padding-bottom: 4px;
}
.osw-picker-option {
    padding: 2px 12px;
    color: #ddd;
    font-size: 13px;
    font-weight: 300;
    cursor: pointer;
    white-space: nowrap;
}
.osw-picker-option:hover {
    background: rgba(255,255,255,0.08);
}
.osw-picker-option.selected {
    color: #fff;
    font-weight: 400;
}
/* OK / Cancel buttons — pod dropdownem, lista je przysłania */
.osw-picker-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
}
.osw-picker-btn {
    background: #3a3a3a;
    color: #ccc;
    border: 1px solid #555;
    padding: 3px 14px;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
}
.osw-picker-btn:hover { background: #4a4a4a; color: #fff; }

/* === Time Picker (opoznienie zalaczenia) === */
.osw-time-picker {
    min-width: 180px;
}
.osw-time-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 4px;
}
.osw-time-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #666;
    color: #ddd;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    padding: 4px 8px;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.osw-time-input::-webkit-inner-spin-button,
.osw-time-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.osw-time-input:focus { border-color: #888; }
.osw-time-unit {
    color: #b0aeae;
    font-size: 14px;
    font-weight: 300;
}


