:root {
    /* Color Palette - Premium Real Estate (Dark Muted Navy + Emerald) */
    --bg-dark: #0a0e17;
    --bg-panel: rgba(16, 23, 38, 0.7);
    --border-light: rgba(255, 255, 255, 0.08);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --accent-emerald: #10b981;
    --accent-emerald-light: #34d399;
    --accent-blue: #3b82f6;
    --accent-warning: #f59e0b;
    --accent-glow: rgba(16, 185, 129, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Gradients */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    filter: blur(120px);
    opacity: 0.4;
    border-radius: 50%;
}

.glow-1 {
    top: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2), transparent 70%);
}

.glow-2 {
    bottom: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Typography & Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-emerald-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-success {
    background: linear-gradient(135deg, var(--accent-emerald-light), #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    animation: slideUp 0.8s ease-out 0.2s both;
}

.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
}

.panel {
    padding: 2rem;
}

/* Form Elements */
.section-title {
    font-size: 1.1rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 2rem 0;
}

.slider-container {
    margin-bottom: 1.5rem;
}

.slider-row {
    display: flex;
    gap: 1rem;
}

.flex-1 {
    flex: 1;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-header label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.value-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
}

.muted-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mt-2 {
    margin-top: 0.5rem;
}

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: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -7px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transition: transform 0.1s;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

/* Results Panel */
.kpi-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.kpi-card {
    padding: 1.5rem;
    text-align: center;
    border-radius: 16px;
}

.hero-card {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(10, 14, 23, 0) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.kpi-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.hero-card .kpi-value {
    font-size: 3rem;
}

.warning-accent {
    border-top: 2px solid var(--accent-warning);
}

.success-accent {
    border-top: 2px solid var(--accent-emerald);
}

.info-accent {
    border-top: 2px solid var(--accent-blue);
}

.warning-text {
    color: var(--accent-warning);
}

.success-text {
    color: var(--accent-emerald-light);
}

.info-text {
    color: var(--accent-blue);
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    padding: 1.5rem;
    border-radius: 16px;
}

.chart-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.canvas-container {
    position: relative;
    width: 100%;
}

.canvas-container.doughnut {
    height: 200px;
}

.canvas-container.bar {
    height: 200px;
}

/* Insight Box */
.ai-insight {
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    transition: all 0.3s ease;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-blue);
}

.insight-header h4 {
    font-weight: 600;
    font-size: 0.95rem;
}

#insight-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    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(255, 255, 255, 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(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.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.5);
    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;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.2rem;
    }
}