/* --- PREMENNÉ A MODY --- */
:root { 
    --bg: #f8fafc; 
    --card: #ffffff; 
    --border: #e2e8f0; 
    --text: #1e293b; 
    --text-muted: #64748b; 
    --accent: #0ea5e9; 
    --nav-bg: #ffffff; 
}

[data-theme="dark"] { 
    --bg: #0f172a; 
    --card: #1e293b; 
    --border: #334155; 
    --text: #f1f5f9; 
    --text-muted: #94a3b8; 
    --accent: #38bdf8; 
    --nav-bg: #1e293b; 
}

/* --- ZÁKLADNÝ RESET --- */
body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    transition: background 0.3s, color 0.3s; 
    padding-top: 100px; 
    line-height: 1.5;
}

.container { 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0 20px; 
    box-sizing: border-box;
}

/* --- NAVIGÁCIA (HEADER) --- */
header { 
    position: fixed; 
    top: 0; left: 0; right: 0; 
    height: 70px; 
    background: var(--nav-bg); 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    z-index: 1000; 
}

.nav-container { 
    max-width: 1000px; 
    margin: auto; 
    width: 100%; 
    padding: 0 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { 
    font-weight: 600; 
    font-size: 1.4rem; 
    color: var(--accent); 
    text-decoration: none; 
    letter-spacing: 1px; 
}

nav ul { 
    display: flex; 
    list-style: none; 
    gap: 20px; 
    margin: 0; 
    padding: 0; 
}

nav ul li a { 
    text-decoration: none; 
    color: var(--text); 
    font-size: 0.85rem; 
    opacity: 0.7; 
    transition: 0.2s; 
}

nav ul li a:hover, nav ul li a.active { 
    color: var(--accent); 
    opacity: 1; 
    font-weight: 600; 
}

.theme-switch { 
    cursor: pointer; 
    font-size: 1.2rem; 
    user-select: none;
}

/* Štýl pre Admin odkaz v navigácii */
nav ul li a.admin-link {
    color: #00d4ff;
    font-weight: 600;
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

nav ul li a.admin-link:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    color: #00d4ff;
}

/* Úprava pre Dark Mode (ak máš v CSS špecifické selektory pre tému) */
[data-theme='dark'] nav ul li a.admin-link {
    color: #00d4ff;
    border-color: rgba(0, 212, 255, 0.3);
}

/* --- STATUS LIŠTA A VÝBER STANICE --- */
.status { 
    text-align: center; 
    font-size: 0.8rem; 
    margin-bottom: 25px; 
    padding: 12px; 
    background: var(--card); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    color: var(--text-muted); 
}

.station-selector-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
    gap: 15px;
    flex-wrap: wrap;
    transition: background-color 0.3s, border-color 0.3s;
}

.station-select-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 260px;
}

.station-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}

.station-dropdown {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 36px 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.station-dropdown:hover {
    border-color: var(--accent);
}

.station-dropdown:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.select-arrow {
    position: absolute;
    right: 12px;
    pointer-events: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.station-dropdown:hover ~ .select-arrow {
    color: var(--accent);
}

.station-status-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dot { 
    height: 8px; 
    width: 8px; 
    background: #4ade80; 
    border-radius: 50%; 
    display: inline-block; 
    margin-right: 4px; 
    flex-shrink: 0;
}

.dot-online {
    background: #4ade80 !important;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.dot-offline {
    background: #f87171 !important;
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

/* --- HLAVNÉ KARTY (INDEX) --- */
.cards { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
}

.card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    padding: 25px; 
    border-radius: 20px; 
    text-align: center; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
}

.card .label { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 10px; 
    font-weight: 600; 
}

.card .value { 
    font-size: 3.5rem; 
    margin: 5px 0; 
    font-weight: 300; 
    line-height: 1; 
}

/* --- DNEŠNÉ REKORDY --- */
.today-stats { 
    margin-bottom: 35px; 
    width: 100%; 
}

.stats-title { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: var(--text-muted); 
    margin-bottom: 15px; 
    font-weight: 600; 
    text-align: center; 
    letter-spacing: 1px; 
}

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

.stat-card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    padding: 20px; 
    border-radius: 20px; 
    text-align: center; 
}

.stat-label { 
    font-size: 0.65rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-weight: 600; 
    margin-bottom: 12px; 
    display: block; 
}

.stat-val-container { 
    display: flex; 
    justify-content: center; 
    align-items: baseline; 
    gap: 10px; 
    font-size: 1.1rem; 
}

.stat-val-container .unit {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 2px;
}

.stat-box { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.stat-box .time { 
    font-size: 0.6rem; 
    color: var(--text-muted); 
    margin-top: 2px; 
}

.minmax-badge {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 3px;
    opacity: 0.7;
}

.sep { opacity: 0.2; }
.low { color: #3b82f6; } 
.high { color: #ef4444; }

/* --- MAPA A GRAFY LAYOUT --- */
#map { 
    height: 400px; 
    width: 100%; 
    border-radius: 20px; 
    border: 1px solid var(--border); 
    margin-bottom: 30px; 
    z-index: 1; 
}

/* Skrytie mriežky (okrajov dlaždíc) na Leaflet mape */
.leaflet-tile {
    outline: none !important;
    border: none !important;
}

/* --- MRIEŽKA PRE ANALYTIKU (GRAFY.PHP) --- */
.charts-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 25px; 
    margin-bottom: 50px; 
    width: 100%;
}

.chart-card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    padding: 25px; 
    border-radius: 20px; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-card.full-width { 
    grid-column: span 2; 
}

.chart-title { 
    font-size: 0.75rem; 
    font-weight: 600; 
    margin-bottom: 20px; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    text-align: center;
}

.chart-container { 
    width: 100%; 
    height: 300px; 
    position: relative; 
}

.chart-section { 
    background: var(--card); 
    border: 1px solid var(--border); 
    padding: 30px; 
    border-radius: 20px; 
    margin-bottom: 40px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.chart-controls { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 25px; 
}

/* --- TLAČIDLÁ --- */
.btn { 
    background: var(--bg); 
    border: 1px solid var(--border); 
    color: var(--text); 
    padding: 8px 18px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 0.8rem; 
    transition: 0.2s; 
}

.btn.active { 
    background: var(--accent); 
    color: white; 
    border-color: var(--accent); 
}


/* --- FOOTER STYLES --- */
footer {
    margin-top: 60px;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.dev-badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 25px 0 30px 0;
}

.footer-email {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    color: var(--accent) !important;
    padding: 11px 24px;
    border-radius: 14px;
    border: 1px solid var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    transition: background 0.2s, box-shadow 0.25s, transform 0.2s, color 0.2s;
    position: relative;
    overflow: hidden;
}

.support-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.25s;
    border-radius: inherit;
}

.support-btn:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

.support-btn:hover::before {
    opacity: 1;
}

.support-btn span {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .support-btn:hover {
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 20px;
}

/* --- Responsivita Atmosy --- */
#map { 
    height: 400px; 
    border-radius: 20px; 
    margin-bottom: 25px; 
    border: 1px solid var(--border); 
    z-index: 1; 
}

.cards { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    margin-bottom: 30px; 
}

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

/* Mobilné zariadenia */
@media (max-width: 768px) {
    .cards { 
        grid-template-columns: 1fr; 
        gap: 10px; 
    }
    .stats-grid { 
        grid-template-columns: 1fr; 
        gap: 10px; 
    }
    #map { 
        height: 300px; 
    }
    .value { 
        font-size: 2.2rem !important; 
    }
    .status { 
        font-size: 0.8rem; 
        text-align: center; 
    }
    .chart-controls { 
        display: flex; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 5px; 
    }
    .station-selector-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }
    .station-select-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .select-wrapper {
        max-width: 100%;
    }
    .station-status-info {
        justify-content: center;
        border-top: 1px solid var(--border);
        padding-top: 10px;
    }
}

/* Štýly pre bublinky (temp-label) */
.temp-label {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

[data-theme="dark"] .temp-label {
    background: rgba(30, 41, 59, 0.9);
    border-color: #475569;
    color: #f1f5f9;
}