/* =============================================
   HVAC — Pomieszczenia techniczne
   PX source: Hvac_Tech_WS.px (1762×955)
   ============================================= */

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

/* === HVAC Submenu (Side_menu_HVAC.px 65×320) === */
.hvac-submenu {
    position: absolute;
    left: 124px;
    top: 170px; /* 3rd sidebar item: 2 × 85px */
    width: 65px;
    height: 320px;
    background: #262626;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    z-index: 50;
}

/* Cyan accent bar — left edge of submenu panel, aligned with sidebar HVAC item */
.hvac-submenu::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 4px;
    height: 85px;
    background: #03dac5;
}

.hvac-submenu .submenu-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 41px;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
}

.hvac-submenu .submenu-icon {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.hvac-submenu .submenu-num {
    position: absolute;
    bottom: -4px;
    right: -2px;
    font: 300 10px 'Roboto', sans-serif;
    color: #b0aeae;
    line-height: 1;
    z-index: 5;
}
.hvac-submenu .submenu-num.num-short {
    bottom: -4px;
    right: 4px;
}
.hvac-submenu .submenu-item.active .submenu-num {
    color: white;
}

.hvac-submenu .submenu-item.active .submenu-icon {
    filter: brightness(0) invert(1);
}

.submenu-alarm-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #ef4141;
    color: white;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 9px;
    line-height: 14px;
    text-align: center;
    z-index: 60;
    animation: alarm-pulse 1.5s ease-in-out infinite;
}

/* === Scrollable content area === */
.hvac-scroll {
    position: absolute;
    left: 0;
    top: 35px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.hvac-scroll::-webkit-scrollbar { width: 8px; }
.hvac-scroll::-webkit-scrollbar-track { background: #1a1a1a; }
.hvac-scroll::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* === Dark panel container (common) === */
.hvac-panel {
    position: absolute;
    background: #262626;
}

.hvac-panel-title {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 18px;
    color: #b0aeae;
}

.hvac-panel-line {
    position: absolute;
    height: 1px;
    background: #03dac5;
}

/* === Panel 1: Zarządzanie pracą wentylatorów (85,85, 490×285) === */
.hvac-panel-vent {
    left: 85px;
    top: 35px;
    width: 490px;
    height: 285px;
}

.hvac-panel-vent .hvac-panel-title {
    left: 30px;
    top: 15px;
}

.hvac-panel-vent .hvac-panel-line {
    left: 25px;
    top: 48px;
    width: 440px;
}

/* Row label (left text) */
.hvac-label {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #b0aeae;
    white-space: nowrap;
}

/* Setpoint component (155×25 dark input box) */
.hvac-setpoint {
    position: absolute;
    width: 155px;
    height: 25px;
    background: rgba(20, 20, 20, 0.5);
    border: none;
    display: flex;
    align-items: center;
}

.hvac-sp-value {
    flex: 1;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: #b0aeae;
    text-align: center;
    padding-left: 0;
}

.hvac-sp-btn {
    width: 25px;
    height: 25px;
    cursor: pointer;
    opacity: 0.7;
    flex-shrink: 0;
}

.hvac-sp-btn:hover {
    opacity: 1;
}

/* Setpoint with pen icon (numeric) */
.hvac-setpoint-num .hvac-sp-btn {
    width: 17px;
    height: 17px;
    margin-right: 3px;
}

/* Section sublabel (e.g., "RG2:", "TR2:") */
.hvac-section-label {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #b0aeae;
    white-space: nowrap;
}

/* Small sublabel (e.g., "Temp. graniczna:") */
.hvac-sublabel {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: #b0aeae;
    white-space: nowrap;
}

/* === Panel 2: Monitorowanie temperatury transformatorów (85,385, 490×175) === */
.hvac-panel-temp {
    left: 85px;
    top: 335px;
    width: 490px;
    height: 175px;
}

.hvac-panel-temp .hvac-panel-title {
    left: 30px;
    top: 15px;
}

.hvac-panel-temp .hvac-panel-line {
    left: 25px;
    top: 48px;
    width: 440px;
}

/* Temperature readouts row */
.hvac-temp-row {
    position: absolute;
    left: 30px;
    right: 30px;
    top: 105px;
    display: flex;
    justify-content: space-between;
}

.hvac-temp-group {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.hvac-temp-label {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #b0aeae;
    margin-right: 2px;
}

.hvac-temp-value {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 32px;
    color: white;
    white-space: nowrap;
}

.hvac-temp-unit {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: white;
    margin-left: 1px;
}

.hvac-temp-chart {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    cursor: pointer;
    margin-left: 4px;
    align-self: center;
}

.hvac-temp-chart:hover { opacity: 1; }

/* === Panel 3: Stan systemu SZR (85,575, 490×280) === */
.hvac-panel-szr {
    left: 85px;
    top: 525px;
    width: 490px;
    height: 280px;
}

.hvac-panel-szr .hvac-panel-title {
    left: 30px;
    top: 15px;
}

.hvac-panel-szr .hvac-panel-line {
    left: 25px;
    top: 48px;
    width: 440px;
}

/* SZR Circuit diagram */
.szr-diagram {
    position: absolute;
    left: 20px;
    top: 60px;
    width: 450px;
    height: 200px;
}

.szr-node {
    position: absolute;
    width: 60px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #b0aeae;
}

.szr-node-active {
    color: #03dac5;
}

.szr-dot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #b0aeae;
    margin: 4px auto;
}

.szr-dot-active {
    background: #03dac5;
}

.szr-line {
    position: absolute;
    background: #b0aeae;
}

.szr-line-active {
    background: #03dac5;
}

.szr-label {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #b0aeae;
    white-space: nowrap;
}

/* === Aggregate section (780,285) === */
.hvac-aggregate {
    position: absolute;
    left: 695px;
    top: 235px;
    width: 200px;
    height: 120px;
    background: rgba(38, 38, 38, 0.8);
}

.hvac-aggr-title {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: white;
    background: rgba(38, 38, 38, 0.8);
    padding: 2px 8px 0 8px;
}

.hvac-aggr-state {
    position: absolute;
    left: 10px;
    top: 50px;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: white;
}

.hvac-aggr-icons {
    position: absolute;
    right: 10px;
    top: 8px;
    display: flex;
    gap: 6px;
}

.hvac-aggr-icons img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    cursor: pointer;
}

/* === Map container (590,70, 1180×785) === */
.hvac-map {
    position: absolute;
    left: 630px;
    top: 5px;
    width: 1120px;
    height: 785px;
    overflow: visible;
    background: #141414;
}

.hvac-map-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    opacity: 0.7;
}

/* Highlighted zone polygon — dashed cyan border */
.hvac-map-zone {
    position: absolute;
    border: 2px dashed rgba(3, 218, 197, 0.4);
    background: rgba(20, 20, 20, 0.85);
}

/* Map photos overlaid */
.hvac-map-photo {
    position: absolute;
    object-fit: contain;
}

/* Map pin marker */
.hvac-map-pin {
    position: absolute;
    width: 30px;
    height: 30px;
}

/* Vertical divider on map */
.hvac-map-divider {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: rgba(128, 128, 128, 0.6);
    border-left: 1px dashed rgba(128, 128, 128, 0.4);
}

/* === Ventilation readout boxes (odczyty_went_temp.px 130×126) === */
.hvac-readout {
    position: absolute;
    width: 130px;
    height: 126px;
    background: transparent;
}

.hvac-readout-title {
    position: absolute;
    left: 0;
    top: 0;
    width: 130px;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 19px;
    color: white;
    text-align: center;
    white-space: nowrap;
    background: rgba(38, 38, 38, 0.8);
    padding: 2px 8px 0 8px;
    box-sizing: border-box;
}

.hvac-readout-line {
    position: absolute;
    left: 0;
    top: 30px;
    width: 130px;
    height: 1px;
    background: #03dac5;
}

.hvac-readout-fan {
    position: absolute;
    left: 77px;
    top: 38px;
    width: 30px;
    height: 30px;
}

.hvac-readout-thermo {
    position: absolute;
    left: 22px;
    top: 42px;
    width: 28px;
    height: 28px;
}

.hvac-readout-temp {
    position: absolute;
    left: 5px;
    top: 75px;
    width: 65px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: white;
}

.hvac-readout-status {
    position: absolute;
    left: 62px;
    top: 75px;
    width: 60px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: white;
}

.hvac-readout-chart {
    position: absolute;
    right: 5px;
    top: 6px;
    width: 19px;
    height: 19px;
    opacity: 0.7;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
}
.hvac-readout-chart:hover { opacity: 1; }

/* Connector lines from readouts to map */
.hvac-connector {
    position: absolute;
    height: 2px;
    background: #03dac5;
}

/* === Setpoint Picker Modal === */
.hvac-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;
}
.hvac-picker-overlay.visible { display: flex; }

.hvac-picker {
    background: #1e1e1e;
    border: 1px solid #555;
    min-width: 180px;
    font-family: 'Roboto', sans-serif;
    position: relative;
}
.hvac-picker-title {
    background: linear-gradient(to bottom, #6a7a9e, #3d4d70);
    color: #ddd;
    font-size: 13px;
    font-weight: 400;
    padding: 3px 8px;
}
.hvac-picker-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 4px;
}
.hvac-picker-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;
}
.hvac-picker-input::-webkit-inner-spin-button,
.hvac-picker-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hvac-picker-input:focus { border-color: #888; }
.hvac-picker-unit {
    color: #b0aeae;
    font-size: 14px;
    font-weight: 300;
}
.hvac-picker-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
}
.hvac-picker-btn {
    background: #3a3a3a;
    color: #ccc;
    border: 1px solid #555;
    padding: 3px 14px;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
}
.hvac-picker-btn:hover { background: #4a4a4a; color: #fff; }

/* Dropdown picker (mode selection) */
.hvac-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;
}
.hvac-picker-current:hover { border-color: #888; }
.hvac-picker-arrow { color: #999; font-size: 10px; }
.hvac-picker-sep {
    color: #888;
    font-size: 13px;
    padding: 0 10px 4px;
    user-select: none;
}
.hvac-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;
}
.hvac-picker-list.expanded { display: block; }
.hvac-picker-options { padding-bottom: 4px; }
.hvac-picker-option {
    padding: 2px 12px;
    color: #ddd;
    font-size: 13px;
    font-weight: 300;
    cursor: pointer;
    white-space: nowrap;
}
.hvac-picker-option:hover { background: rgba(255,255,255,0.08); }
.hvac-picker-option.selected { color: #fff; font-weight: 400; }

/* === Fan animation & states === */
@keyframes fan-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.hvac-readout-fan {
    /* Hub SVG at (11.807, 13.103) in viewBox 24×24 → 49.2% 54.6% */
    transform-origin: 49.2% 54.6%;
}
.hvac-readout-fan.fan-on {
    animation: fan-spin-reverse 3s linear infinite;
    transform-origin: 49.2% 54.6%;
}
.hvac-readout-status.status-off {
    color: white;
}

/* === Wentylatory map elements === */
.went-zone-label {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 18px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    white-space: nowrap;
    pointer-events: none;
}

/* Centered text in wentylatory setpoint dropdowns */
.went-sp-center {
    text-align: center;
    padding-left: 0 !important;
}

.went-fan {
    position: absolute;
    width: 33px;
    height: 33px;
}
.went-fan-inner {
    position: absolute;
    top: 4px; left: 4px;
    width: 25px; height: 25px;
    background: #262626;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.went-fan-inner img {
    width: 21px;
    height: 21px;
    display: block;
    margin-bottom: 1px;
}

/* Map fan active states — spin only the img inside tile */
.went-fan.fan-active .went-fan-inner img {
    animation: fan-spin-reverse linear infinite;
    transform-origin: 49% 55%;
}
@keyframes fan-spin-reverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}
.went-fan.fan-speed-25 .went-fan-inner img { animation-duration: 8s; }
.went-fan.fan-speed-50 .went-fan-inner img { animation-duration: 5s; }
.went-fan.fan-speed-75 .went-fan-inner img { animation-duration: 3s; }
.went-fan.fan-speed-100 .went-fan-inner img { animation-duration: 1.5s; }

.went-destr {
    position: absolute;
    width: 33px;
    height: 33px;
    transition: filter 0.3s;
}

/* Map destratifier active — src swap via window.__SVG in JS */

/* === Hover areas (same as pomiar) === */
.went-hover-area {
    position: absolute;
    cursor: pointer;
    z-index: 5;
    border: 2px solid transparent;
    transition: border-color 0.15s ease;
}
.went-hover-area:hover {
    border-color: rgba(255,255,255,0.5);
}
#went-hover-1 { left: 57px; top: 140px; width: 358px; height: 228px; }
#went-hover-2 { left: 57px; top: 368px; width: 358px; height: 228px; }
#went-hover-3 { left: 415px; top: 140px; width: 355px; height: 228px; }
#went-hover-4 { left: 415px; top: 368px; width: 355px; height: 228px; }
#went-hover-5 { left: 770px; top: 140px; width: 359px; height: 228px; }
#went-hover-6 { left: 770px; top: 368px; width: 359px; height: 228px; }

/* === Mini-mapa (prawy gorny rog podstron) === */
.went-minimap {
    position: absolute;
    right: 10px;
    top: 5px;
    width: 460px;
    height: 322px;
    background: #141414;
    border: 5px solid #2f2f2f;
    box-sizing: border-box;
    z-index: 20;
    overflow: hidden;
}
.went-minimap-svg {
    width: 100%;
    height: 100%;
}
.went-mm-zone {
    fill: transparent;
    stroke: transparent;
    stroke-width: 2;
    cursor: pointer;
    transition: stroke 0.15s ease;
}
.went-mm-zone:hover {
    stroke: rgba(255, 255, 255, 0.5);
}
.went-mm-zone-active {
    fill: rgba(3, 218, 197, 0.22);
    stroke: rgba(3, 218, 197, 0.4);
    stroke-width: 2;
    stroke-dasharray: 8 2;
    stroke-linecap: square;
    pointer-events: none;
}

/* === Sub-page map background === */
.went-sub-map { position: absolute; object-fit: contain; opacity: 0.85; pointer-events: none; }

/* Skalowanie podstron wentylatorów żeby mieściły się bez scrollowania */
.hvac-scroll.went-sub-scaled {
    transform: scale(0.88);
    transform-origin: top left;
    overflow: hidden;
}

/* === Sub-page readout: Fan (160×120, PX odczyty_wentylatorow.px) === */
.went-sub-rd { position: absolute; width: 160px; height: 120px; }
.went-sub-rd-fan {
    position: absolute; left: 0; top: 1px; width: 33px; height: 33px;
}
.went-sub-fan-tile {
    position: absolute;
    top: 4px; left: 4px;
    width: 25px; height: 25px;
    background: #262626;
    border-radius: 5px;
    overflow: hidden;
}
.went-sub-fan-inner {
    width: 100%; height: 100%;
    display: block;
}
.went-sub-rd-fan.fan-on .went-sub-fan-inner {
    animation: fan-spin-reverse 3s linear infinite;
    transform-origin: 49% 55%;
}
.went-sub-rd-fan.fan-speed-25 .went-sub-fan-inner { animation-duration: 8s; }
.went-sub-rd-fan.fan-speed-50 .went-sub-fan-inner { animation-duration: 5s; }
.went-sub-rd-fan.fan-speed-75 .went-sub-fan-inner { animation-duration: 3s; }
.went-sub-rd-fan.fan-speed-100 .went-sub-fan-inner { animation-duration: 1.5s; }
.went-sub-rd-fan.fan-speed-25 { animation-duration: 8s; }
.went-sub-rd-fan.fan-speed-50 { animation-duration: 5s; }
.went-sub-rd-fan.fan-speed-75 { animation-duration: 3s; }
.went-sub-rd-fan.fan-speed-100 { animation-duration: 1.5s; }
.went-sub-rd-namebg { position: absolute; left: 35px; top: 5px; width: 125px; height: 25px; background: rgba(38,38,38,0.8); }
.went-sub-rd-name { position: absolute; left: 39px; top: 5px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 16px; color: white; white-space: nowrap; z-index: 1; }
.went-sub-rd-chart { position: absolute; left: 137px; top: 7px; width: 20px; height: 20px; opacity: 0.7; cursor: pointer; z-index: 2; }
.went-sub-rd-chart:hover { opacity: 1; }
.went-sub-rd-statusbg { position: absolute; left: 0; top: 35px; width: 160px; height: 40px; background: rgba(38,38,38,0.8); }
.went-sub-rd-statlbl { position: absolute; left: 5px; top: 37px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 14px; color: #b0aeae; z-index: 1; }
.went-sub-rd-val { position: absolute; left: 0; top: 55px; width: 160px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 14px; color: white; text-align: center; z-index: 1; }
.went-sub-rd-pwrbg { position: absolute; left: 0; top: 80px; width: 160px; height: 40px; background: rgba(38,38,38,0.8); }
.went-sub-rd-pwrlbl { position: absolute; left: 5px; top: 82px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 14px; color: #b0aeae; z-index: 1; }
.went-sub-rd-pwr { position: absolute; left: 0; top: 100px; width: 160px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 14px; color: white; text-align: center; z-index: 1; }

/* === Sub-page readout: Destratifier (160×75, PX odczyty_destr.px) === */
.went-sub-destr { position: absolute; width: 160px; height: 75px; }
.went-sub-destr-icon { position: absolute; left: 0; top: 1px; width: 33px; height: 33px; }
.went-sub-destr-namebg { position: absolute; left: 35px; top: 5px; width: 125px; height: 25px; background: rgba(38,38,38,0.8); }
.went-sub-destr-name { position: absolute; left: 39px; top: 5px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 16px; color: white; white-space: nowrap; z-index: 1; }
.went-sub-destr-chart { position: absolute; left: 137px; top: 7px; width: 20px; height: 20px; opacity: 0.7; cursor: pointer; z-index: 2; }
.went-sub-destr-chart:hover { opacity: 1; }
.went-sub-destr-statusbg { position: absolute; left: 0; top: 35px; width: 160px; height: 40px; background: rgba(38,38,38,0.8); }
.went-sub-destr-statlbl { position: absolute; left: 5px; top: 37px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 14px; color: #b0aeae; z-index: 1; }
.went-sub-destr-val { position: absolute; left: 0; top: 55px; width: 160px; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 14px; color: white; text-align: center; z-index: 1; }

/* === Sub-page connector lines & dividers === */
.went-sub-conn { stroke: rgba(3,218,197,0.2); stroke-width: 4; }
.went-sub-conn-pt { fill: #262626; stroke: #03dac5; stroke-width: 2; }
.went-sub-divider { position: absolute; width: 3px; background: rgba(128,128,128,0.6); border-left: 1px dashed rgba(128,128,128,0.4); }

.went-fan-label {
    position: absolute;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: white;
    background: rgba(38, 38, 38, 0.8);
    padding: 0 4px;
    height: 25px;
    line-height: 25px;
    white-space: nowrap;
    pointer-events: none;
}
