/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Leaflet Map Overrides */
.leaflet-container {
    background: var(--bg-dark-secondary);
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-content-wrapper {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.leaflet-popup-tip {
    background: var(--panel-bg);
}

/* CSS Variables */
:root {
    --bg-dark: #0f1015;
    --bg-dark-secondary: #16181f;
    --panel-bg: rgba(26, 28, 35, 0.65);
    
    /* Typography */
    --text-primary: #ffffff;
    --text-secondary: #a1a3af;
    --text-muted: #6b6d7a;
    
    /* Accents - Aurum (Gold/Amber) */
    --aurum-light: #fbe69b;
    --aurum-main: #f5c43d;
    --aurum-dark: #cc9914;
    --aurum-glow: rgba(245, 196, 61, 0.15);
    
    /* Status Colors */
    --success: #3dd583;
    --success-glow: rgba(61, 213, 131, 0.15);
    --danger: #f55555;
    --danger-glow: rgba(245, 85, 85, 0.15);
    
    /* Layout */
    --sidebar-width: 260px;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Base Styles & Utility Classes */
.text-aurum { color: var(--aurum-main); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

h1, h2, h3, h4 { font-weight: 600; }
a { text-decoration: none; color: inherit; }

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0; /* Override glass-panel radius on sidebar */
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--aurum-main), var(--aurum-dark));
    color: var(--bg-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
    box-shadow: 0 0 15px var(--aurum-glow);
}

.brand h1 {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    color: var(--aurum-light);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item svg {
    opacity: 0.7;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--aurum-glow);
    color: var(--aurum-main);
    border-left: 3px solid var(--aurum-main);
}

.nav-item.active svg {
    opacity: 1;
    stroke: var(--aurum-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-top: auto;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--aurum-main);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    max-width: 1400px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.header-titles h2 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 204, 113, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(61, 213, 131, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(61, 213, 131, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 213, 131, 0); }
}

.status-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grid Layout */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Cards */
.card {
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(245, 196, 61, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 500;
}

.icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benzine-icon {
    background: rgba(245, 196, 61, 0.1);
    color: var(--aurum-main);
}

.diesel-icon {
    background: rgba(161, 163, 175, 0.1);
    color: var(--text-primary);
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.currency {
    color: var(--text-muted);
    font-weight: 500;
}

.trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.stats-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats-card h3 {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Charts */
.chart-section {
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.chart-controls {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    color: var(--text-primary);
}

.btn.active {
    background: var(--panel-bg);
    color: var(--aurum-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chart-container {
    height: 350px;
    width: 100%;
}

/* History Table */
.history-section {
    padding: 24px;
}

.history-section h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.table-responsive {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.history-table th, .history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table tbody tr {
    transition: var(--transition);
}

.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.history-table td {
    font-size: 0.95rem;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Station Grid Styles */
.stations-section {
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.badge {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.station-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    transition: var(--transition);
}

.station-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--aurum-main);
    transform: translateY(-2px);
}

.station-card.is-cheapest {
    border-color: rgba(61, 213, 131, 0.4);
    box-shadow: 0 4px 20px var(--success-glow);
}

.station-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.station-name {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.cheapest-badge {
    font-size: 0.7rem;
    background: var(--success);
    color: #fff;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

.station-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sp-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sp-value {
    font-weight: 600;
    font-size: 1rem;
}

.sp-benzine { color: var(--aurum-main); }
.sp-diesel { color: var(--text-primary); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 24px 12px;
    }
    
    .brand h1, .nav-item span, .user-info {
        display: none;
    }
    
    .brand-icon {
        margin: 0 auto;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* SPA View Logic & Animations */
.app-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}
.app-view.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms & Buttons */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.input-group input, .input-group select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.input-group input:focus, .input-group select:focus {
    border-color: var(--aurum-main);
}
.btn-primary {
    background: var(--aurum-main);
    color: var(--bg-dark);
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
}
.btn-primary:hover {
    background: var(--aurum-light);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--aurum-glow);
}
.btn-outline {
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
}
.btn-outline:hover {
    border-color: var(--aurum-main);
    color: var(--aurum-main);
}

/* Map Section */
.map-container-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.map-info-card {
    padding: 24px;
}

.map-card {
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

/* Slide-out Legend Drawer */
.map-legend-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 88%;
    background: rgba(15, 17, 26, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.65);
    z-index: 1000;
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}

.map-legend-drawer.open {
    transform: translateX(0);
}

.map-legend-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 14px;
}

.map-legend-drawer-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-legend-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #a1a3af;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition);
}

.map-legend-close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.legend-section-title {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--aurum-main);
    font-weight: 700;
    margin: 12px 0 8px 0;
}

.legend-brand-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s;
}

.legend-brand-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.legend-brand-left {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
}

.legend-brand-toggle input[type="checkbox"],
.legend-service-toggle input[type="checkbox"] {
    accent-color: var(--aurum-main);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.legend-brand-name {
    font-size: 0.84rem;
    color: #f1f5f9;
    font-weight: 500;
}

.legend-brand-count {
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.legend-service-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s;
}

.legend-service-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Floating button on map */
.map-floating-legend-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 900;
    background: rgba(18, 20, 29, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.map-floating-legend-btn:hover {
    background: rgba(30, 34, 48, 0.95);
    border-color: var(--aurum-main);
    color: var(--aurum-main);
}

.station-hover-tooltip {
    background: rgba(15, 17, 26, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
}

/* Analysis Section */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.compare-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 16px;
    border-radius: 12px;
}
.compare-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.compare-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.compare-val {
    font-size: 1.3rem;
    font-weight: 700;
}
.compare-divider {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}
.savings-alert {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    padding: 20px;
    border-radius: 12px;
}
.savings-icon { font-size: 2rem; }
.savings-text { font-size: 0.95rem; }
.mt-4 { margin-top: 24px; }

/* Settings Section */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
}
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.setting-item h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Price alert threshold inputs */
#price-alert-threshold-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

#price-alert-threshold-container .input-group input {
    background: rgba(0, 0, 0, 0.4);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--panel-bg);
    border: 1px solid rgba(255,255,255,0.1);
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .4s;
}
input:checked + .slider {
    background-color: var(--aurum-main);
    border-color: var(--aurum-main);
}
input:checked + .slider:before {
    transform: translateX(26px);
    background-color: var(--bg-dark);
}
input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 24px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    max-width: 320px;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--aurum-main);
}

.toast-info {
    border-left: 4px solid var(--text-secondary);
}

/* Pulse animation pro výsledky kalkulačky */
@keyframes pulse-result {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse-result {
    animation: pulse-result 0.5s ease-out;
}

/* Vypnutí animací */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Responzivní design - rozšíření */

/* Malý tablet */
@media (max-width: 640px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-cards {
        grid-template-columns: 1fr;
    }
    
    .stations-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .settings-grid {
        max-width: 100%;
    }
    
    .map-container-wrapper {
        gap: 16px;
    }
    
    .map-card #map {
        height: 400px !important;
    }
    
    .map-legend {
        flex-direction: column;
        gap: 8px !important;
    }
}

/* Mobil portrait */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .header-titles h2 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .card {
        padding: 16px;
    }
    
    .value {
        font-size: 2rem;
    }
    
    .price-display {
        flex-direction: column;
        gap: 4px;
    }
    
    .map-card #map {
        height: 300px !important;
    }
    
    .map-info-card h3 {
        font-size: 1.1rem;
    }
    
    .map-info-card p {
        font-size: 0.85rem !important;
    }
    
    /* Touch-friendly tlačítka */
    .btn, .nav-item {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .compare-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .compare-item {
        align-items: center;
        text-align: center;
    }
    
    .compare-divider {
        transform: rotate(90deg);
        margin: 8px 0;
    }
    
    .stations-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .toast-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .savings-alert {
        flex-direction: column;
        text-align: center;
    }
}

/* Touch device optimalizace */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .nav-item:hover,
    .station-card:hover,
    .btn:hover {
        transform: none;
    }
    
    .btn, .nav-item, .station-card {
        min-height: 48px;
    }
    
    /* Větší touch targety */
    .switch {
        width: 70px;
        height: 40px;
    }
    
    .slider:before {
        height: 32px;
        width: 32px;
    }
}
