/**
 * Meteo LCD Display - CSS styly
 * 
 * Styly pro LCD displej s meteorologickými daty včetně astronomických vizualizací.
 */

/* LCD Display - hlavní kontejner */
.lcd-display {
    background: radial-gradient(ellipse at center, #1a2028 0%, #0f1419 70%);
    border-radius: 20px;
    padding: 20px 40px 40px 40px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.5);
    margin-bottom: 30px;
    position: relative;
    border: 3px solid #0a0a0a;
}

.lcd-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,0.15) 0px,
            rgba(0,0,0,0.15) 2px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
    border-radius: 17px;
    /* Umístit pseudo-element nad obsah (.lcd-panel apod.) */
    z-index: 2;
}

/* Prevent horizontal overflow from large SVGs or grid/flex children: allow them to shrink
   inside flex/grid containers by ensuring min-width:0 and constraining SVG sizes. */
.lcd-display, .lcd-astro-panel {
    box-sizing: border-box;
    overflow-x: hidden; /* guard at container level */
}

.astro-item,
.astro-content,
.astro-icon,
.planets-list,
.planet-item {
    min-width: 0; /* allow flex items to shrink below their content */
}

/* Generic SVG safety: scale to container and don't exceed max-height */
svg {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
}

.planets-sky-svg,
.astro-night-svg,
.sun-svg,
.moon-phase-svg {
    width: 100% !important;
    height: auto !important;
    max-height: 160px;
}

/* Grid rozložení panelů */
.lcd-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 25px;
    position: relative;
    z-index: 1;
}

/* Jednotlivé panely */
.lcd-panel {
    background: linear-gradient(135deg, #0f1419 0%, #1a2028 100%);

    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        inset 0 2px 10px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Časová značka */
.lcd-timestamp {
    /* Unified header styling: all text inside the header should use these rules */
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #dcdcdc;
    font-weight: 700;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.28);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Left and right groups inside header */
.lcd-timestamp-left, .lcd-timestamp-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Label (e.g. "Aktuální čas:") and the timestamp itself share same font metrics
   Timestamp uses monospace for alignment */
.lcd-timestamp-label {
    font-family: 'Courier New', monospace;
    /* Sjednocená barva popisků */
    color: #888;
}
.lcd-timestamp-ts {
    font-family: 'Courier New', monospace;
}

/* Popisky panelů */
.lcd-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
    .lcd-grid--flex {
        display: flex;
        gap: 12px;
        /* Panely mají vlastní výšku podle obsahu */
        align-items: start;
    }

    /* Wrapper pro pravý panel + toggle - roztahuje se na plnou výšku */
    .right-panel-with-toggle {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* panel-flex should behave as a vertical flex container so its inner
       .lcd-info-grid can expand to fill the panel height */
    .panel-flex {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    /* Panel pro tlak/vítr - pouze potřebná výška, neroztahuje se */
    .panel-pressure {
        flex: 0 0 auto;  /* Nebere si volný prostor, jen nutnou výšku */
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    /* Make the primary info grid expand to take available vertical space
       so sibling panels become equal height */
    .panel-flex > .lcd-info-grid {
        flex: 1 1 auto;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        align-items: start;
    }

    /* Two-column helper for right panel (wind/rain/light + direction/compass) */
    .two-col {
        display: flex;
        gap: 12px;
        align-items: stretch;
    }
    .pressure-left {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .pressure-right {
        width: 140px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .clock-panel-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 8px;
    }

    .clock-panel-label {
        font-size: 0.95em;
        opacity: 0.85;
    }

    .lcd-clock-small {
        font-size: 1.0em;
        opacity: 0.75;
        font-family: monospace;
    }

    /* Původní compass-wrap - ponechat pro kompatibilitu */
    .compass-wrap {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 0;
    }

    /* Nové rozložení pravého horního panelu */
    
    /* Grid layout: 2 sloupce × 3 řádky */
    .wind-panel-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;  /* Oba sloupce stejně široké */
        grid-template-rows: auto auto auto;
        gap: 10px 20px;
    }
    
    /* Kompas - druhý sloupec, řádky 2-3 sloučené */
    .compass-wrap-right {
        grid-column: 2;
        grid-row: 2 / 4; /* Span přes řádky 2 a 3 */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Container pro toggle přepínač - uvnitř right-panel-with-toggle, zarovnaný vpravo */
    .lcd-mode-toggle-container {
        display: flex;
        justify-content: flex-end;
        margin-top: auto; /* Posune toggle na spodek wrapperu */
    }

    /* Toggle přepínač Astro/Meteo */
    .lcd-mode-toggle {
        display: flex;
        gap: 8px;
        background: rgba(10, 10, 15, 0.6);
        padding: 6px;
        border-radius: 8px;
        border: 1px solid rgba(76, 217, 100, 0.2);
    }

    .lcd-mode-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: transparent;
        border: 1px solid rgba(76, 217, 100, 0.2);
        border-radius: 6px;
        color: #9ad0f5;
        font-family: 'Courier New', monospace;
        font-size: 0.9em;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .lcd-mode-btn svg {
        width: 20px;
        height: 20px;
        stroke-width: 2;
        flex-shrink: 0;
    }

    .lcd-mode-btn:hover {
        background: rgba(76, 217, 100, 0.1);
        border-color: rgba(76, 217, 100, 0.4);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(76, 217, 100, 0.2);
    }

    .lcd-mode-btn.active {
        background: linear-gradient(135deg, rgba(76, 217, 100, 0.3), rgba(76, 217, 100, 0.2));
        border-color: #4cd964;
        color: #4cd964;
        box-shadow: 
            0 0 10px rgba(76, 217, 100, 0.3),
            inset 0 1px 2px rgba(76, 217, 100, 0.2);
    }

    .lcd-mode-btn.active svg {
        filter: drop-shadow(0 0 4px rgba(76, 217, 100, 0.6));
    }

    .lcd-mode-btn:active {
        transform: translateY(0);
    }


    .lcd-display--centered {
        text-align: center;
        padding: 60px;
    }

    .error-subtext {
        font-size: 0.6em;
        margin-top: 20px;
        opacity: 0.5;
    }

.lcd-label-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Velké číslice */
.lcd-digit {
    font-family: 'Courier New', monospace;
    font-size: 2.5em;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 
        0 0 10px rgba(0,255,136,0.8),
        0 0 20px rgba(0,255,136,0.5),
        0 0 30px rgba(0,255,136,0.3);
    line-height: 1;
    letter-spacing: -2px;
}

.lcd-digit.temperature {
    color: inherit;
    text-shadow: 
        0 0 10px rgba(255, 71, 87, 0.8),
        0 0 20px rgba(255, 71, 87, 0.5),
        0 0 30px rgba(255, 71, 87, 0.3);
}

.lcd-digit.pressure {
    color: inherit;
    text-shadow: 
        0 0 10px rgba(0, 210, 255, 0.8),
        0 0 20px rgba(0, 210, 255, 0.5),
        0 0 30px rgba(0, 210, 255, 0.3);
}

/* Meteorologické hodnoty: dva jednotné styly pro všechny meteo hodnoty */
.meteo-large {
    font-family: 'Courier New', monospace;
    font-size: 2.5em;
    font-weight: bold;
/*    color: #ff4757; /* velké číslice - červená */
    color: #fda048; /* velké číslice - červená */
    line-height: 1;
    /* červený glow pro velké meteorologické číslice */
    text-shadow:
        0 0 10px rgba(255, 145, 87, 0.85),
        0 0 20px rgba(255, 145, 87, 0.5),
        0 0 30px rgba(255, 145, 87, 0.3);
}

.meteo-small {
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    color: #17c0eb; /* menší číslice - světle modrá */
    font-weight: bold;
    line-height: 1;
    /* jemný glow pro lepší čitelnost */
    text-shadow: 
        0 0 4px rgba(23,192,235,0.7),
        0 0 8px rgba(23,192,235,0.4);
}

.lcd-unit {
    font-size: 0.35em;
    color: inherit;
    opacity: 0.7;
    margin-left: 5px;
}

/* Specifické styly jednotek v kontextu meteo-large / meteo-small
   - jednotky jsou o něco menší než číslice, a měly by dědit barvu rodiče */
.meteo-large .lcd-unit {
    font-size: 0.65em; /* relativně k meteo-large */
    margin-left: 0.25em;
    opacity: 0.95;
    color: inherit;
    vertical-align: baseline;
}

.meteo-small .lcd-unit {
    font-size: 0.70em; /* relativně k meteo-small */
    margin-left: 0.25em;
    opacity: 0.95;
    color: inherit;
    vertical-align: baseline;
}

.lcd-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    margin-left: 0.3em;
    font-size: 1em;
}

/* Trend color variants: use classes on the parent .lcd-trend or the svg itself */
.lcd-trend.lcd-trend-up,
.lcd-trend .trend-up {
    color: #4cd964; /* green */
    text-shadow: 0 0 8px rgba(76,217,100,0.65);
}
.lcd-trend.lcd-trend-down,
.lcd-trend .trend-down {
    color: #ff3b30; /* red */
    text-shadow: 0 0 8px rgba(255,59,48,0.65);
}
.lcd-trend.lcd-trend-stable,
.lcd-trend .trend-stable {
    color: #c7c7cc; /* neutral gray */
    text-shadow: 0 0 6px rgba(199,199,204,0.35);
}

.trend-icon {
    width: 1.0em;
    height: 1.0em;
    display: inline-block;
    vertical-align: middle;
}

.trend-glyph {
    font-size: 1em;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

/* Force all trend glyphs to green with a light glow/shadow */
.lcd-trend, .trend-glyph {
    color: #4cd964 !important;
    text-shadow: 0 0 8px rgba(76,217,100,0.55) !important;
}

/* Wrapper that shows value and trend side-by-side with a small gap
   Value is on the left, trend icon/sparkline on the right */
.value-with-trend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Two-column row inside each lcd-info-item: left for label+value, right for trend */
.value-trend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.value-trend-row .value-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.value-trend-row .lcd-info-label {
    text-align: left;
    width: 100%;
}
.value-trend-row .trend-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 88px;
}
.trend-label {
    font-size: 0.75em;
    color: #888;
    text-transform: none;
    opacity: 0.95;
}
.trend-right .lcd-trend {
    margin-left: 0 !important;
}

/* Small explanatory subtext used under certain info values (e.g. Min/Max 24h) */
.lcd-info-sub {
    font-size: 0.78em;
    color: #aab3bd;
    margin-top: 6px;
    line-height: 1.1;
}

/* Hodiny */
.lcd-time {
    font-family: 'Courier New', monospace;
    font-size: 4em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    text-shadow: 
        0 0 15px rgba(255,255,255,0.5),
        0 0 25px rgba(255,255,255,0.3);
    letter-spacing: 3px;
}


    /* Warning variant for meteo-large: strong red color + red glow to indicate thresholds exceeded */
    .meteo-large.alert,
    .meteo-large--alert {
        color: #ff3b30; /* vivid red */
        background: linear-gradient(180deg, rgba(255,59,48,0.03), rgba(255,59,48,0.01));
        border-radius: 4px;
        padding: 2px 6px;
        display: inline-block;
        text-shadow:
            0 0 12px rgba(255,59,48,0.95),
            0 0 24px rgba(255,59,48,0.65),
            0 0 40px rgba(255,59,48,0.35);
    }

    /* Optional subtle pulse for high-severity alerts (add class .pulse-alert to enable animation) */
    .meteo-large.alert.pulse-alert,
    .meteo-large--alert.pulse-alert {
        animation: meteo-alert-pulse 1.6s ease-in-out infinite;
    }

    @keyframes meteo-alert-pulse {
        0% { transform: translateZ(0) scale(1); opacity: 1; }
        50% { transform: translateZ(0) scale(1.08); opacity: 0.92; }
        100% { transform: translateZ(0) scale(1); opacity: 1; }
    }
.blink-separator {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.lcd-date {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    color: #ffd700;
    text-shadow: 
        0 0 8px rgba(255,215,0,0.6),
        0 0 15px rgba(255,215,0,0.3);
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 6px;
}

/* Informační položky */
.lcd-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.lcd-info-item {
    text-align: left;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.lcd-info-label {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #888;
    margin-bottom: 4px;
}

/* Dew point icon styling: make droplet more visible (stronger color, subtle glow) */
.dew-icon {
    color: #1e90ff; /* dodger blue - stands out on dark background */
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    opacity: 1;
    text-shadow: 0 0 8px rgba(30,144,255,0.35);
}

/* If dew-icon is an inline SVG, ensure it inherits color and scales nicely */
.dew-icon svg, .dew-icon {
    fill: currentColor;
}
.dew-icon[width], .dew-icon[height] {
    width: 1.05em;
    height: 1.05em;
}
.dew-icon { font-size: 1.05em; }

.lcd-info-value {
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    color: #17c0eb;
    text-shadow: 0 0 8px rgba(23,192,235,0.5);
    font-weight: bold;
}

/* Astronomická sekce */
.lcd-astro-panel {
    background: linear-gradient(135deg, #0f1419 0%, #1a2028 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        inset 0 2px 10px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
    margin-top: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.astro-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.astro-grid-2col {
    grid-template-columns: 1fr 2fr;
}

.astro-item {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.astro-icon {
    font-size: 3.5em;
    flex-shrink: 0;
}

.astro-content {
    flex: 1;
}

.astro-label {
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.astro-times {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.astro-time-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.astro-time-item > span:first-child {
    color: #ffd700;
    font-size: 1.2em;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.astro-time {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    font-weight: bold;
    white-space: nowrap;
}

.astro-phase {
    margin-top: 8px;
    font-size: 0.85em;
    color: #17c0eb;
    text-shadow: 0 0 5px rgba(23,192,235,0.4);
}

/* Seznam planet */
.planets-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.planet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    padding: 4px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.planet-name {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.6);
}

.planet-info {
    color: #17c0eb;
    text-shadow: 0 0 3px rgba(23,192,235,0.4);
    font-size: 0.85em;
}

/* Responsivní design */

/* Mobile - portrait phones */
@media (max-width: 765px) {
    .lcd-display {
        padding: 12px 12px 18px 12px;
        border-radius: 12px;
    }

    /* Stack main grid into single column */
    .lcd-grid, .lcd-grid--flex {
        display: block;
        gap: 10px;
    }

    .lcd-panel {
        padding: 12px;
        margin-bottom: 8px;
    }

    /* Make inner info grid single-column so items stack vertically */
    .panel-flex > .lcd-info-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: stretch;
    }

    /* Value/trend rows stack vertically on small screens */
    .value-trend-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .value-trend-row .trend-right {
        align-items: flex-start;
        min-width: auto;
    }

    /* Reduce font sizes for mobile */
    .meteo-large {
        font-size: 1.6em;
    }
    .meteo-small {
        font-size: 1.2em;
    }

    .lcd-label-text {
        font-size: 0.95em;
    }

    .lcd-info-label {
        font-size: 0.85em;
    }

    /* SVG visuals should scale fluidly */
    .planets-sky-svg,
    .astro-night-svg,
    .sun-svg,
    .moon-phase-svg {
        width: 100% !important;
        height: auto !important;
        max-height: 160px;
    }

    /* Smaller compass on phones */
    .lcd-compass {
        width: 72px;
        height: 72px;
    }
    .lcd-wind-arrow {
        font-size: 38px;
    }

    /* Reduce padding for info items on phones */
    .lcd-info-item {
        padding: 6px;
    }

    /* Make trend label smaller */
    .trend-label {
        font-size: 0.7em;
    }

    /* Header: stack timestamp groups vertically on narrow screens so they don't overflow
       - ensure inner groups take full width and allow their contents to wrap/justify */
    .lcd-timestamp {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .lcd-timestamp-left,
    .lcd-timestamp-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Make timestamp text a bit smaller on phones to gain space */
    .lcd-timestamp-label {
        font-size: 0.85em;
    }
    .lcd-timestamp-ts {
        font-size: 0.95em;
    }

    /* Astronomical panel: stack each astro-item vertically and scale icons/text
       so the astro section is fully usable on phones */
    .astro-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .astro-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .astro-icon {
        font-size: 2.2em;
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    .astro-content {
        width: 100%;
    }

    /* Allow astro times to wrap and not force horizontal scroll */
    .astro-time {
        white-space: normal;
        font-size: 1.05em;
    }

    /* Ensure the SVG visuals used in astro panels are constrained and responsive */
    .astro-item svg {
        max-width: 100%;
        height: auto;
    }
}

/* Mobile - landscape phones/tablets in narrow height (landscape orientation)
   Reflow elements to make better use of horizontal space while keeping
   header readable and astro items compact. Target common phone landscape widths. */
@media (max-width: 1220px) and (orientation: landscape) {
    .lcd-display {
        padding: 10px 12px;
    }

    /* Keep header on a single logical row but allow left/right groups to share space
       and wrap if necessary. Use smaller timestamp fonts to reduce overflow. */
    .lcd-timestamp {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .lcd-timestamp-left,
    .lcd-timestamp-right {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .lcd-timestamp-right {
        justify-content: flex-end;
    }

    .lcd-timestamp-label { font-size: 0.82em; }
    .lcd-timestamp-ts { font-size: 0.92em; }

    /* Bring back a two-column astro layout where possible on landscape
       so the astro panel uses horizontal space efficiently */
    .astro-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .astro-item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    /* For narrow landscape phones, ensure the special 2-column astro rows
       (used to place Sun|Planets and Moon|AstroNight side-by-side) instead
       stack vertically so each visualization sits above its descriptive text
       and Sun/Planets or Moon/AstroNight appear one below the other. */
    .astro-grid-2col {
        grid-template-columns: 1fr; /* force single column on narrow landscape */
    }

    .astro-grid-2col .astro-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* In the stacked (2col -> 1col) layout ensure planets list appears below
       the planets sky visualization and items are stacked vertically. */
    .astro-grid-2col .planets-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .astro-grid-2col .planet-item {
        flex: none;
        width: 100%;
        box-sizing: border-box;
    }

    .astro-icon {
        font-size: 2.6em;
        flex-shrink: 0;
        width: auto;
        display: block;
    }

    .astro-content {
        flex: 1 1 auto;
    }

    /* Try to keep astro times on one line in landscape if they fit */
    .astro-time { white-space: nowrap; font-size: 1.05em; }

    /* Info grid: allow two-column layout in landscape to present more values
       side-by-side without making them too cramped */
    .panel-flex > .lcd-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Value/trend: revert to row layout in landscape for compactness */
    .value-trend-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .value-trend-row .trend-right {
        align-items: flex-end;
        min-width: 72px;
    }

    /* Slightly reduce big number sizes to avoid wrapping */
    .meteo-large { font-size: 1.9em; }
    .meteo-small { font-size: 1.15em; }

    /* Constrain SVG visuals height on landscape to avoid eating vertical space */
    .planets-sky-svg,
    .astro-night-svg,
    .sun-svg,
    .moon-phase-svg {
        max-height: 140px;
    }

    /* On narrow landscape (phones) panels might not fit side-by-side.
       Stack panels vertically to avoid overlap. This makes left/center/right
       panels render one below another in narrow landscape. */
    .lcd-grid,
    .lcd-grid--flex {
        display: block;
        gap: 10px;
    }

    .lcd-panel {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
        min-width: 0;
    }

    /* Also stack internal info grid inside panels to a single column for clarity */
    .panel-flex > .lcd-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Landscape: make astronomical grid adaptive — auto-fit columns and dense packing
       so smaller landscape widths get 1-2 columns while wider phones can show 3. */
    .astro-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        grid-auto-rows: minmax(80px, auto);
        grid-auto-flow: dense;
        gap: 10px;
    }

    .astro-item {
        padding: 10px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Icon sizing: keep icons prominent but constrained so they don't force overflow */
    .astro-icon {
        /* Increase icon size in landscape to match portrait readability */
        font-size: 3.2em;
        flex-shrink: 0;
        width: auto;
        height: auto;
        min-width: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ensure any SVGs inside astro items scale and don't exceed a reasonable height */
    .astro-item svg {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 160px; /* match portrait max height */
        display: block;
    }

    /* Planets list: flow into multiple small tiles in landscape for compactness */
    .planets-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: stretch;
    }
    .planet-item {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }

    /* Ensure larger astro SVG visuals used elsewhere also scale up in landscape */
    .planets-sky-svg,
    .astro-night-svg,
    .sun-svg,
    .moon-phase-svg {
        width: 100% !important;
        height: auto !important;
        max-height: 160px;
    }

    /* Keep astro times readable: allow wrapping if necessary but prefer single line when possible */
    .astro-time {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Kompas větru */
.lcd-compass {
    position: relative;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at center, #1a2332 0%, #0a0a15 100%);
    border: 3px solid #5dade2;
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(93, 173, 226, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.lcd-compass-ring {
    position: relative;
    width: 100%;
    height: 100%;
}

.lcd-compass-label {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #5dade2;
    text-shadow: 0 0 5px rgba(93, 173, 226, 0.8);
}

.lcd-compass-label.north {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.lcd-compass-label.east {
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
}

.lcd-compass-label.south {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.lcd-compass-label.west {
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
}

.lcd-wind-arrow-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transform-origin: center center;
}

.lcd-wind-arrow {
    font-size: 48px;
    color: #ff4757;
    text-shadow: 
        0 0 10px rgba(255, 71, 87, 0.8),
        0 0 20px rgba(255, 71, 87, 0.5);
    line-height: 1;
}

/* Charts Panel Styles - pro renderLCDMeteo() */
.lcd-charts-panel {
    margin-top: 30px;
    background: linear-gradient(135deg, #0f1419 0%, #1a2028 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        inset 0 2px 10px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.charts-panel {
    position: relative;
    z-index: 1;
}

.charts-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

.chart-display-area {
    flex: 1;
    min-height: 400px;
    background: rgba(10, 10, 15, 0.6);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(76, 217, 100, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(76, 217, 100, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(76, 217, 100, 0.2);
    margin-top: 10px;
}

.chart-controls label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #9ad0f5;
    margin: 0;
    text-align: center;
}

.time-window-selector {
    padding: 8px 10px;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(76, 217, 100, 0.3);
    border-radius: 6px;
    color: #4cd964;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.time-window-selector:hover {
    border-color: #4cd964;
    background: rgba(76, 217, 100, 0.1);
}

.time-window-selector:focus {
    outline: none;
    border-color: #4cd964;
    box-shadow: 0 0 8px rgba(76, 217, 100, 0.3);
}

.chart-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.charts-list {
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-list-item {
    padding: 15px 20px;
    background: rgba(10, 10, 15, 0.6);
    border: 2px solid rgba(76, 217, 100, 0.2);
    border-radius: 8px;
    color: #9ad0f5;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-list-item:hover {
    border-color: rgba(76, 217, 100, 0.5);
    background: rgba(10, 10, 15, 0.8);
    transform: translateX(-3px);
}

.chart-list-item.active {
    border-color: #4cd964;
    background: rgba(76, 217, 100, 0.15);
    color: #4cd964;
    box-shadow: 0 0 15px rgba(76, 217, 100, 0.3);
}

.chart-list-icon {
    font-size: 20px;
    line-height: 1;
}

.chart-list-text {
    flex: 1;
}

.chart-placeholder {
    text-align: center;
    color: #9ad0f5;
    max-width: 600px;
}

.placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.placeholder-title {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    color: #4cd964;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(76, 217, 100, 0.5);
}

.placeholder-text {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    color: #9ad0f5;
    margin-bottom: 30px;
}

.placeholder-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(76, 217, 100, 0.1);
    border-radius: 8px;
    border-left: 3px solid #4cd964;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(76, 217, 100, 0.15);
    transform: translateX(5px);
}

.feature-icon {
    font-size: 24px;
}

.feature-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #9ad0f5;
    text-align: left;
}

.chart-loading {
    text-align: center;
    color: #9ad0f5;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(76, 217, 100, 0.2);
    border-top: 4px solid #4cd964;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #4cd964;
    text-shadow: 0 0 8px rgba(76, 217, 100, 0.5);
}

/* Responsive design pro charts panel */
@media (max-width: 768px) {
    .charts-container {
        flex-direction: column-reverse; /* Seznam tlačítek POD grafem */
    }
    
    .charts-list {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .chart-list-item {
        flex: 1 1 calc(50% - 8px); /* Dva sloupce tlačítek */
        min-width: 140px;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .chart-list-icon {
        font-size: 18px;
    }
    
    .chart-controls {
        margin-top: 0;
        margin-bottom: 10px; /* Mezera před tlačítky grafů */
    }
    
    .chart-display-area {
        padding: 15px;
        min-height: 350px; /* Větší prostor pro graf */
    }
    
    .placeholder-icon {
        font-size: 60px;
    }
    
    .placeholder-title {
        font-size: 20px;
    }
    
    .placeholder-text {
        font-size: 14px;
    }
}

/* Pro velmi malé displeje (mobily < 480px) - jedno tlačítko na řádek */
@media (max-width: 480px) {
    .chart-list-item {
        flex: 1 1 100%; /* Plná šířka - jedno tlačítko na řádek */
        min-width: auto;
    }
    
    .chart-display-area {
        padding: 10px;
        min-height: 300px;
    }
    
    .time-window-selector {
        font-size: 14px;
        padding: 10px;
    }
}
