/* Import Google Fonts - Outfit for a more tech/modern feel */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    /* Core Deep Theme */
    --bg-dark: #0a0e12;
    --bg-card: rgba(22, 27, 34, 0.7);
    --bg-card-hover: rgba(30, 36, 46, 0.8);

    /* Accents & Glass */
    --accent-primary: #FFC107;
    /* Yellow Warning/Primary */
    --accent-secondary: #FF8F00;
    /* Amber Secondary */
    --accent-glow: rgba(255, 193, 7, 0.4);

    --text-primary: #ffffff;
    --text-secondary: #8b949e;

    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 12px;
}

/* Base Styles */
body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 15%, rgba(255, 193, 7, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(255, 143, 0, 0.08) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 193, 7, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 143, 0, 0.03) 0%, transparent 40%);
}

.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Config */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 40px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 30px;
}

.logo-section h1 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    background: rgba(255, 193, 7, 0.1);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 193, 7, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
}

select {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover {
    border-color: var(--text-secondary);
}

.toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.toggle-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.toggle-btn.active {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.h-divider {
    width: 1px;
    background: var(--glass-border);
    height: 24px;
    align-self: center;
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
}

/* Glass Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 24px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hero Widget (Inside Temp) */
.hero-widget {
    grid-column: span 2;
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.9), rgba(13, 17, 23, 0.95));
    position: relative;
    overflow: hidden;
}

/* Subtle glow background for hero */
.hero-widget::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--accent-primary);
    filter: blur(100px);
    opacity: 0.1;
}

.temp-large {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(to bottom, #fff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.temp-unit {
    font-size: 2rem;
    vertical-align: super;
    opacity: 0.6;
    -webkit-text-fill-color: initial;
    /* Override parent gradient */
    color: var(--text-primary);
}

.meta-stats {
    margin-top: auto;
    display: flex;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-val {
    font-size: 1.1rem;
    font-weight: 600;
}

.status-good {
    color: #00e676;
}

.status-warning {
    color: #ffab40;
}

.status-alert {
    color: #ff1744;
}

/* Regular Widgets */
.small-widget {
    grid-column: span 1;
}

.value-medium {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.val-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

/* Chart Section */
.chart-section {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
}

.chart-container {
    position: relative;
    height: 100%;
    width: 100%;
}

/* Extremes Grid */
.ex-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
}

.ex-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ex-vals {
    font-size: 0.95rem;
    font-weight: 500;
}

.val-min {
    color: #90caf9;
}

.val-max {
    color: #ef9a9a;
}

.sep {
    color: var(--glass-border);
    margin: 0 2px;
}

/* Responsive */
@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-widget {
        grid-column: span 2;
    }

    .chart-section {
        grid-column: span 2;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .hero-widget,
    .chart-section,
    .small-widget {
        grid-column: span 1;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        /* Full width */
        gap: 16px;
    }

    .controls {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        /* Space for scrollbar if needed */
        justify-content: flex-start;
        /* Start from left */
        /* Hide scrollbar for cleaner look but keep functionality */
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .controls::-webkit-scrollbar {
        display: none;
    }

    /* Smaller controls on mobile */
    .toggle-btn,
    select {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
        /* Prevent text wrapping */
    }
}