/* Zaluzie - karta se stavem a 3 tlacitky, podstranka s nakresem okna, ovladanim a nastavenim
   Spolecne prvky (.ItemIconBox, .Toggle, .Range, .TopBar, stavy .ItemOn / .ItemPending) jsou v css/style.css */

/* ===== Karta v seznamu (main.html) ===== */
.ShadowItem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}

.ShadowText {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.ShadowName {
    font-size: var(--item-name-fs);
    font-weight: var(--item-name-fw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ShadowDesc {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: var(--item-desc-fs);
    color: var(--muted);
    white-space: nowrap;
}

.ShadowDesc span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ShadowDesc b {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Barevna tecka pred popisem stavu, ma barvu textu */
.ShadowDesc i {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Mini ukazatel stazeni pod popisem, sirku ridi promenna --pos */
.ShadowBar {
    height: 4px;
    max-width: 140px;
    margin-top: 7px;
    border-radius: 2px;
    background: var(--line);
    overflow: hidden;
}

.ShadowBar span {
    display: block;
    height: 100%;
    width: var(--pos, 0%);
    border-radius: 2px;
    background: var(--muted);
    transition: width .4s;
}

/* Pohyb (ShadowMoving) a automatika (ItemOn) - popis v akcentni barve */
.ShadowMoving .ShadowDesc,
.ItemOn .ShadowDesc {
    color: var(--accent);
}

.ShadowMoving .ShadowBar span {
    background: var(--accent);
}

.ShadowMoving .ShadowDesc i,
.ShadowMoving .ShadowChipMove i {
    animation: ShadowBlink 1s infinite;
}

@keyframes ShadowBlink {
    50% { opacity: .25; }
}

/* Skupina 3 tlacitek (otevrit / stineni / zavrit) jako segment */
.ShadowBtns {
    flex: 0 0 auto;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    background: var(--line);
}

.ShadowBtn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s, color .15s, transform .1s;
}

/* Ikony tlacitek - SVG kreslene barvou textu */
.ShadowBtn svg,
.ShadowPadBtn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* ===== Podstranka (ShadowMain.html) ===== */
/* Stejna sirka jako ostatni podstranky, do 480 px roztazeni zajisti .PageContainer > div v css/style.css */
.ShadowMain {
    width: 420px;
}

.ShadowLayout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.ShadowLayout > .ItemObject {
    margin-bottom: 0;
}

/* Stav - nakres okna a hodnoty */
.ShadowHero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 14px 14px;
}

.ShadowWin {
    flex: 0 0 112px;
    width: 112px;
    height: 140px;
}

.ShadowWin svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ShadowWinSky { fill: var(--accent-soft); }
.ShadowWinSun { fill: #f5c451; opacity: .9; }
.ShadowWinMullion { stroke: var(--line); stroke-width: 2; }
.ShadowWinSlat { fill: var(--off); }
.ShadowWinRail { fill: var(--muted); }
.ShadowWinFrame { fill: none; stroke: var(--muted); stroke-opacity: .45; stroke-width: 3; }

.ShadowHeroText {
    flex: 1;
    min-width: 0;
}

.ShadowBig {
    font-size: 34px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ShadowBig small {
    margin-left: 2px;
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
}

.ShadowSub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.ShadowSub b {
    font-weight: 600;
    color: var(--text);
}

.ShadowChips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ShadowChip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--line);
    color: var(--muted);
}

.ShadowChip i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.ShadowMoving .ShadowChipMove,
.ShadowChipAuto {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Stitek automatiky jen pokud je zapnuta */
.ShadowChipAuto {
    display: none;
}

.ItemOn .ShadowChipAuto {
    display: inline-flex;
}

/* Velka tlacitka - otevrit / stineni / zavrit */
.ShadowPad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
}

.ShadowPadBtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px 10px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s, color .15s, transform .1s;
}

.ShadowPad .ShadowPadBtn svg {
    width: 24px;
    height: 24px;
}

/* Krokovani (drzi se) - dve siroka tlacitka */
.ShadowStep {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.ShadowStep .ShadowPadBtn {
    flex: 1;
    flex-direction: row;
    justify-content: center;
    padding: 10px 4px;
}

/* Drzeni tlacitka - okamzita lokalni odezva */
.ShadowBtn.ShadowBtnPressed {
    transform: scale(.9);
}

.ShadowPadBtn.ShadowBtnPressed {
    transform: scale(.95);
}

/* Aktivni funkce podle dat ze serveru (buttonFullUp, ...) */
.ShadowBtn.ShadowBtnOn,
.ShadowPadBtn.ShadowBtnOn {
    background: var(--accent);
    color: #fff;
}

/* Radky s nastavenim (zastineni, automatika) */
.ShadowRow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.ShadowRow + .ShadowSlide + .ShadowRow {
    border-top: 1px solid var(--line);
}

.ShadowRowText {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
}

.ShadowRowText span {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.ShadowRowVal {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.ShadowSlide {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 10px;
}

.ShadowLimit {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--muted);
}

/* Po pusteni posuvniku, nez server posle nova data (nepouziva ItemPending - ta by ovlivnila i .Toggle) */
.ShadowRange {
    transition: opacity .2s;
}

.ShadowPending .ShadowRange {
    opacity: .55;
}

.ShadowAutoRow {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media only screen and (hover: hover) and (pointer: fine) {
    .ShadowBtn:hover:not(.ShadowBtnOn) {
        background-color: var(--card);
    }

    .ShadowPadBtn:hover:not(.ShadowBtnOn) {
        background-color: var(--hover);
    }
}
