* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #2d3e50;
    --secondary-color: #1abc9c;
    --accent-color: #3498db;
    --text-color: #2c3e50;
    --light-bg: #ecf0f1;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
    --border-radius: 10px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    padding: 20px;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 32px;
    color: var(--secondary-color);
}

h1 {
    color: var(--primary-color);
    font-size: 36px;
    letter-spacing: 1px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 18px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stats-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(26, 188, 156, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.stats-icon i {
    font-size: 24px;
    color: var(--secondary-color);
}

.stats-info {
    flex: 1;
}

.stats-info h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stats-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
}

.stats-subvalue {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 2px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    color: var(--primary-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h2 i {
    color: var(--secondary-color);
}

.time-selector {
    display: flex;
    gap: 8px;
}

.time-button {
    background-color: #f7f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-weight: 500;
}

.time-button:hover {
    background-color: rgba(26, 188, 156, 0.1);
    border-color: var(--secondary-color);
}

.time-button.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Square aspect ratio */
    height: 0;
}


.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: var(--border-radius);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chart-loading.active {
    opacity: 1;
    pointer-events: all;
}

.chart-loading i {
    font-size: 36px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.chart-loading span {
    font-size: 16px;
    color: var(--primary-color);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.stats-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.stats-value.updating {
    animation: pulse 1s infinite;
    color: var(--secondary-color);
}

footer p {
    transition: all 0.3s ease;
}

footer p i {
    color: var(--secondary-color);
}
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .time-selector {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 500px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}