:root {
    --primary-dark: #0d1117;
    --secondary-dark: #161b22;
    --accent-blue: #58a6ff;
    --accent-green: #238636;
    --accent-orange: #f0883e;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --chart-grid: #30363d;
}

body { 
    background-color: var(--primary-dark); 
    color: var(--text-primary); 
    font-family: 'Poppins', sans-serif;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

/* Header improvements for better visibility */
header h1 {
    color: var(--accent-blue) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p.text-muted {
    color: var(--text-secondary) !important;
    opacity: 0.9;
}

header #last-update {
    color: var(--accent-blue) !important;
    font-weight: 500;
    background: rgba(88, 166, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.stats-card {
    background: var(--secondary-dark);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--chart-grid);
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stats-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(88, 166, 255, 0.15);
}

.stats-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
    line-height: 1;
    margin: 0.5rem 0;
}

.stats-card .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 0.25rem;
}

.station-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.station-nakonys { background-color: var(--accent-blue); }
.station-mitosiunai { background-color: var(--accent-green); }
.station-pajuodziai { background-color: var(--accent-orange); }

/* Modern table styling */
.modern-table {
    background: var(--secondary-dark);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--chart-grid);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-table thead th {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #4a94e6 100%);
    color: white;
    font-weight: 600;
    padding: 1rem;
    border: none;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.modern-table tbody td {
    padding: 0.85rem 1rem;
    border-color: var(--chart-grid);
    vertical-align: middle;
    transition: background-color 0.2s ease;
    color: var(--text-primary) !important;
}

.modern-table tbody tr:hover td {
    background-color: rgba(88, 166, 255, 0.05);
}

.modern-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--chart-grid);
}

.section-header {
    background: rgba(88, 166, 255, 0.1);
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Chart container */
.chart-container {
    background: var(--secondary-dark);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--chart-grid);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.chart-controls {
    background: rgba(22, 27, 34, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.btn-chart {
    border-radius: 20px;
    padding: 6px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-chart.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
    border-color: var(--accent-blue);
}

.btn-chart:not(.active) {
    background: transparent;
    border: 1px solid var(--chart-grid);
    color: var(--text-secondary);
}

.btn-chart:not(.active):hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Chart period indicator */
.chart-period {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-left: 10px;
}

/* Chart canvas */
.chart-container canvas {
    max-height: 300px;
    width: 100% !important;
}

/* Smooth transitions for chart updates */
#weatherChart {
    transition: opacity 0.3s ease;
}

.chart-loading {
    opacity: 0.5;
}

/* Footer text visibility */
.text-center.mt-4 small {
    color: var(--text-secondary) !important;
    opacity: 0.9;
}

.text-center.mt-4 small #last-update-time {
    color: var(--accent-blue) !important;
    font-weight: 500;
}

/* Status indicator */
#status-indicator .badge {
    font-size: 0.75rem;
    padding: 4px 12px;
}

/* Chart legend visibility */
.station-legend {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Form labels visibility */
.form-label {
    color: var(--text-secondary) !important;
}

/* Table cell text visibility */
.modern-table tbody td.fw-semibold {
    color: var(--accent-blue) !important;
}

.modern-table tbody td {
    color: var(--text-primary) !important;
}

/* Refresh button */
#refresh-chart {
    transition: all 0.3s ease;
}

#refresh-chart:hover {
    transform: rotate(15deg);
}

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

.refreshing {
    animation: spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-card .value {
        font-size: 1.5rem;
    }
    
    .modern-table {
        font-size: 0.9rem;
    }
    
    .modern-table td, .modern-table th {
        padding: 0.75rem;
    }
    
    .station-legend {
        font-size: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .chart-controls .btn-chart {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .stats-card {
        padding: 1rem;
    }
    
    .btn-chart {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .chart-controls .row {
        gap: 10px;
    }
    
    .chart-controls .col-md-6 {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Data update animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.data-updated {
    animation: pulse 0.5s ease;
}