/* Variabili e reset */
:root {
    --primary-color: #0ea5e9;
    --secondary-color: #0f766e;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --light-gray: #cbd5e1;
    --electric-color: #0ea5e9;
    --thermal-color: #f97316;
    --solar-color: #facc15;
    --savings-color: #22c55e;
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg), #1e1b4b);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* Layout principale */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.7);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-logo {
    display: flex;
    align-items: center;
}

.back-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    margin-right: 30px;
    font-weight: 500;
    transition: var(--transition);
}

.back-link i {
    margin-right: 8px;
}

.back-link:hover {
    color: var(--primary-color);
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.datetime {
    font-size: 1.1rem;
    color: var(--light-gray);
}

/* Cards dei valori principali */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.8rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.stat-icon.electric {
    background: rgba(14, 165, 233, 0.15);
    color: var(--electric-color);
}

.stat-icon.thermal {
    background: rgba(249, 115, 22, 0.15);
    color: var(--thermal-color);
}

.stat-icon.solar {
    background: rgba(250, 204, 21, 0.15);
    color: var(--solar-color);
}

.stat-icon.savings {
    background: rgba(34, 197, 94, 0.15);
    color: var(--savings-color);
}

.stat-info {
    flex-grow: 1;
}

.stat-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light-gray);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--light-gray);
}

.stat-trend i {
    margin-right: 5px;
}

.fa-arrow-up {
    color: var(--savings-color);
}

.fa-arrow-down {
    color: #ef4444;
}

/* Grafici */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    padding: 0 30px 30px;
}

.chart-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 90%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    margin-right: 8px;
}

.legend-color.electric {
    background: var(--electric-color);
}

.legend-color.thermal {
    background: var(--thermal-color);
}

.legend-color.solar {
    background: var(--solar-color);
}

.chart-body {
    height: 280px;
    position: relative;
}

/* Statistiche aggiuntive */
.additional-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 0 30px 30px;
}

.stats-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stats-item {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-label {
    font-size: 0.85rem;
    color: var(--light-gray);
    margin-bottom: 8px;
}

.stats-value {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Previsioni meteo */
.weather-forecast {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.forecast-day {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
    text-align: center;
}

.forecast-date {
    font-size: 0.85rem;
    color: var(--light-gray);
    margin-bottom: 10px;
}

.forecast-icon {
    font-size: 1.8rem;
    color: var(--solar-color);
    margin-bottom: 10px;
}

.forecast-temp {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-container,
    .additional-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .charts-container {
        padding: 0 20px 20px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .weather-forecast {
        flex-wrap: wrap;
    }

    .forecast-day {
        min-width: calc(50% - 10px);
    }
}

@media (max-width: 550px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .forecast-day {
        min-width: 100%;
    }
} 