:root {
    /* Color Palette - Clean Tech (Light, Airy, Sunny) */
    --bg-main: #f4f7f6;
    --bg-panel: rgba(255, 255, 255, 0.85);

    --text-main: #1e293b;
    --text-muted: #64748b;

    --border-light: rgba(15, 23, 42, 0.08);

    --accent-sun: #f59e0b;
    /* Amber / Sun */
    --accent-sun-light: #fbbf24;
    --accent-eco: #10b981;
    /* Emerald / Eco */
    --accent-eco-dark: #059669;
    --accent-sky: #0ea5e9;
    /* Blue / Tech */

    --shadow-soft: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Solar Flare Background */
.sun-flare {
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    filter: blur(40px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Typography & Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-eco-dark);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-sun), var(--accent-eco));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-sun {
    background: linear-gradient(135deg, var(--accent-sun-light), #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-eco {
    color: var(--accent-eco-dark);
}

header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.15rem;
}

/* Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    animation: slideUp 0.6s ease-out 0.1s both;
}

/* Glassmorphism Light */
.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid #ffffff;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 2rem;
}

/* Form Elements */
.section-title {
    font-size: 1.1rem;
    color: var(--accent-sky);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 2rem 0;
}

.slider-container {
    margin-bottom: 1.8rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.slider-header label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.value-badge {
    background: #ffffff;
    padding: 0.25rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-sky);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.muted-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.text-right {
    text-align: right;
}

/* Custom Sliders Light Mode */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    padding: 10px 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -8px;
    border: 3px solid var(--accent-sun);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
    transition: transform 0.1s;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.15);
}

/* Results Panel */
.system-box {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(245, 158, 11, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(251, 191, 36, 0.05));
}

.system-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-details h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.2rem 0;
    line-height: 1.1;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    padding: 1.5rem;
    text-align: center;
    border-radius: 16px;
}

.kpi-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Charts */
.chart-card {
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.chart-card h3 {
    font-size: 1rem;
    color: #334155;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: center;
}

.canvas-container {
    position: relative;
    width: 100%;
}

.canvas-container.line {
    height: 260px;
}

/* Insight Box */
.ai-insight {
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
    transition: all 0.3s ease;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-eco-dark);
}

.insight-header h4 {
    font-weight: 700;
    font-size: 1rem;
}

#insight-text {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltips */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.4rem;
    cursor: help;
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.1);
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: var(--accent-eco);
    color: white;
    border-color: var(--accent-eco);
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    color: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: pre-wrap;
    width: max-content;
    max-width: 250px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-icon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 968px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.5rem;
    }
}