/* 
=========================================
MICHIGAN ELECTRICITY DEMAND FORECAST
Modern, Attractive Color Scheme & Design
Developer: Sohel Ahmed (sohelcu06@gmail.com)
=========================================
*/

/* ==================== COLOR PALETTE ==================== */
:root {
    /* Primary Colors - Electric Blue Theme */
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-blue-light: #3b82f6;
    --primary-blue-pale: #dbeafe;
    
    /* Accent Colors */
    --accent-green: #10b981;
    --accent-green-dark: #059669;
    --accent-orange: #f59e0b;
    --accent-orange-dark: #d97706;
    --accent-red: #ef4444;
    --accent-red-dark: #dc2626;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    --gradient-success: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
    --gradient-bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    padding: 20px;
    color: var(--gray-800);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    background: var(--white);
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-primary);
}

h1 {
    font-size: 2.75em;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.emoji {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.subtitle {
    color: var(--gray-500);
    font-size: 1.15em;
    margin-top: 15px;
}

.subtitle strong {
    color: var(--primary-blue);
}

.controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

button {
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#btn-detroit {
    background: var(--gradient-primary);
}

.btn-michigan {
    background: var(--gradient-success);
}

#loading {
    display: none;
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: var(--primary-blue-pale);
    border-radius: 12px;
    color: var(--primary-blue-dark);
}

.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 35px 0;
}

.card {
    background: var(--white);
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.card h3 {
    color: var(--gray-900);
    margin-bottom: 20px;
    font-size: 1.4em;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-blue);
}

.kpi-title {
    font-size: 13px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 12px 0;
}

.kpi-unit {
    font-size: 16px;
    color: var(--gray-500);
}

.info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 24px;
    border-radius: 16px;
    border-left: 5px solid var(--primary-blue);
}

.info-box h4 {
    color: var(--primary-blue-dark);
    margin-bottom: 16px;
}

.baseline-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 5px solid var(--primary-blue);
    padding: 28px;
    margin: 25px 0;
    border-radius: 16px;
}

#chart-container {
    position: relative;
    height: 420px;
    margin-top: 25px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 12px;
}

#insight {
    padding: 24px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    margin-top: 25px;
}

#insight.high {
    background: #fee2e2;
    color: #991b1b;
    border-left: 5px solid #ef4444;
}

#insight.medium {
    background: #fef3c7;
    color: #92400e;
    border-left: 5px solid #f59e0b;
}

#insight.low {
    background: #d1fae5;
    color: #065f46;
    border-left: 5px solid #10b981;
}

#map {
    height: 550px;
    border-radius: 16px;
    margin-top: 20px;
    border: 3px solid var(--gray-200);
}

.legend {
    display: flex;
    justify-content: center;
    gap: 35px;
    margin-top: 20px;
    padding: 18px;
    background: var(--gray-50);
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-dot.low { background: #10b981; }
.legend-dot.medium { background: #f59e0b; }
.legend-dot.high { background: #ef4444; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 16px;
    font-weight: 700;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
}

tr:hover {
    background: var(--primary-blue-pale);
}

tr:nth-child(even) {
    background: var(--gray-50);
}

td strong {
    color: var(--primary-blue-dark);
}

footer {
    margin-top: 50px;
    padding: 35px;
    background: var(--white);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary-blue);
}

.developer-info a {
    color: var(--primary-blue);
    text-decoration: none;
}

.api-note {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid var(--accent-green);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.api-note code {
    background: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    color: var(--accent-green-dark);
}

@media (max-width: 768px) {
    h1 { font-size: 2em; }
    .grid { grid-template-columns: 1fr; }
    #map { height: 400px; }
}

/* Ensure Michigan button has green gradient */
#btn-michigan {
    background: var(--gradient-success) !important;
}
