/* Basic responsive styles */
body {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    background-attachment: fixed;
    color: #f8fafc;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: auto;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.header-title {
    margin: 0;
    font-size: 2rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    margin: 5px 0 0 0;
    color: #94a3b8;
    font-size: 1rem;
}

.last-update {
    text-align: right;
    color: #94a3b8;
    font-size: 0.9rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Controls Styles */
.controls {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.control-item-flex {
    flex: 1;
}

.control-item-fixed {
    flex: 0 0 200px;
}

select {
    width: 100%;
    /* Changed to 100% to fill container */
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: white;
    font-size: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    align-items: stretch;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.stat-card h4 {
    margin: 0 0 15px 0;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
    margin-top: auto;
    margin-bottom: auto;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.full {
    grid-column: 1 / -1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #334155;
    text-align: left;
}

th {
    background: #1e293b;
    color: #94a3b8;
    font-weight: 500;
}

.up {
    color: #22c55e;
    font-weight: bold;
}

.down {
    color: #f43f5e;
    font-weight: bold;
}

.chart-container {
    position: relative;
    height: 350px;
}

h3 {
    margin-top: 0;
    color: #f1f5f9;
    font-weight: 600;
    border-left: 4px solid #3b82f6;
    padding-left: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-title-container {
        flex-direction: column;
        /* Stack icon and text on very small screens? or keep row */
        align-items: flex-start;
        gap: 15px;
    }

    .header-icon {
        font-size: 2.5rem;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .last-update {
        align-self: flex-start;
        text-align: left;
        margin-top: 10px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        /* Full width controls */
    }

    .control-item-fixed,
    .control-item-flex {
        flex: auto;
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
        /* Single column layout */
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* Single column stats or 2 per row? 1fr is safer for small screens */
    }
}