:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary-color: #10b981;
    --accent-color: #8b5cf6;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --chart-past: rgba(148, 163, 184, 0.5);
    --chart-future: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    padding: 0;
    margin: 0;
}

.glass-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2rem;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    max-width: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 2rem;
}

main#dashboard {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

header {
    text-align: center;
    flex-shrink: 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.025em;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--glass-border);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-top: 2rem;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    flex-shrink: 0;
}

.stat-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.stat-card.primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.unit {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.2rem;
    padding-right: 0.2rem;
}

.time {
    color: var(--primary-color);
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
    height: auto;
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.chart-wrapper {
    position: relative;
    flex-grow: 1;
    min-height: 0;
    width: 100%;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.error {
    text-align: center;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 1rem;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .glass-container {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .price {
        font-size: 2rem;
    }
}

@media (max-height: 750px) {
    .glass-container {
        padding: 1rem;
        gap: 1rem;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 0.25rem;
    }

    header p {
        font-size: 1rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.25rem;
    }

    .price {
        font-size: 1.8rem;
    }

    .chart-container {
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .chart-header {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .glass-container {
        padding: 1rem;
        border-radius: 0;
        height: auto;
        overflow: visible;
        display: block;
    }

    h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        margin-bottom: 1rem;
    }

    .chart-container {
        height: 350px;
        padding: 1rem;
        margin-top: 0;
        display: block;
    }
    
    .chart-wrapper {
        height: 280px;
    }
}