/* --- 1. Custom Properties & Base Reset --- */

:root {
    /* Color Palette */
    --clr-bg-dark: #0A0A10;      /* Deep background */
    --clr-bg-primary: #171725;   /* Card background */
    --clr-bg-secondary: #212133; /* Hover/Subtle element background */
    
    --clr-text-primary: #E0E0FF; /* Light text */
    --clr-text-secondary: #A0A0C0; /* Muted text */
    
    --clr-accent-primary: #6E00FF; /* Electric Purple */
    --clr-accent-secondary: #00FFFF; /* Cyan/Aqua */
    --clr-accent-gradient: linear-gradient(135deg, var(--clr-accent-primary) 0%, #B900FF 100%);
    
    /* Spacing & Radius */
    --spacing-md: 25px;
    --spacing-lg: 40px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Shadows */
    --shadow-deep: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(110, 0, 255, 0.15);
    --shadow-glow: 0 0 15px rgba(110, 0, 255, 0.7);
    --shadow-input: 0 0 0 3px rgba(0, 255, 255, 0.2);
}

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

/* --- 2. Body and Container Styling --- */

body {
    font-family: 'Space Mono', 'Inter', 'Segoe UI', monospace, sans-serif;
    background: var(--clr-bg-dark);
    min-height: 100vh;
    padding: var(--spacing-lg) 20px;
    line-height: 1.7;
    color: var(--clr-text-primary);
    background-image: radial-gradient(circle at 50% 100%, rgba(110, 0, 255, 0.05) 0%, transparent 60%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--clr-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-deep);
    border: 1px solid rgba(110, 0, 255, 0.2);
    overflow: hidden;
}

/* --- 3. Hero Section (Holographic Effect) --- */

.hero {
    background: linear-gradient(135deg, #1A004C 0%, #300060 100%);
    color: var(--clr-text-primary);
    padding: 80px var(--spacing-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--clr-accent-secondary);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Grid/Data pattern from SVG - slightly stronger */
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(0,255,255,0.08)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.6;
    animation: backgroundMove 30s linear infinite;
}

@keyframes backgroundMove {
    from { background-position: 0 0; }
    to { background-position: 400px 400px; }
}

.hero h1 {
    font-size: 3.8em;
    margin-bottom: 10px;
    font-weight: 900;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    /* Neon Text Effect */
    color: #FFF;
    text-shadow: 0 0 10px var(--clr-accent-secondary), 0 0 20px rgba(0, 255, 255, 0.4);
}

.subtitle {
    font-size: 1.4em;
    color: var(--clr-text-secondary);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 30px;
    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
}

.stat-number {
    font-size: 2.8em;
    font-weight: 900;
    line-height: 1;
    color: var(--clr-accent-secondary);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- 4. Form Sections --- */
form {
    padding: var(--spacing-lg);
}

.section {
    margin-bottom: var(--spacing-lg);
    padding: 30px;
    background: var(--clr-bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--clr-bg-secondary);
    transition: all 0.3s ease;
}

.section:hover {
    border-color: var(--clr-accent-primary);
    box-shadow: 0 0 20px rgba(110, 0, 255, 0.3);
}

.section-title {
    font-size: 1.6em;
    color: var(--clr-text-primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--clr-accent-primary);
    font-weight: 700;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.form-grid.full-width {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: var(--clr-text-secondary);
    margin-bottom: 10px;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="number"],
input[type="text"],
select {
    padding: 14px 16px;
    border: 2px solid var(--clr-bg-secondary);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: var(--clr-bg-primary);
    color: var(--clr-text-primary);
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--clr-accent-primary);
    box-shadow: var(--shadow-input), 0 0 0 3px rgba(110, 0, 255, 0.3);
    transform: none; /* Removed Y-axis shift for consistency */
}

select {
    cursor: pointer;
    appearance: none;
    /* Custom SVG for dark theme */
    background-image: url('data:image/svg+xml,<svg width="12" height="8" xmlns="http://www.w3.org/2000/svg"><path d="M1 1l5 5 5-5" stroke="%2300FFFF" stroke-width="2" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

small {
    color: var(--clr-text-secondary);
    font-size: 0.85em;
    margin-top: 6px;
    font-style: italic;
    opacity: 0.7;
}

/* Checkbox Grid - Tiled Selection */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--clr-bg-primary);
    border: 2px solid var(--clr-bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--clr-text-secondary);
}

.checkbox-label:hover {
    border-color: var(--clr-accent-secondary);
    background: var(--clr-bg-secondary);
    color: var(--clr-text-primary);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--clr-accent-primary);
}

.checkbox-label input[type="checkbox"]:checked {
    border-color: var(--clr-accent-secondary);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--clr-accent-secondary);
    font-weight: 600;
}

/* --- 5. Submit Button (Glow Effect) --- */
.btn-predict {
    width: 100%;
    padding: 22px;
    background: var(--clr-accent-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.4em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(110, 0, 255, 0.4), var(--shadow-glow);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-predict::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: transform 0.5s ease-in-out;
    transform: skewX(-30deg);
}

.btn-predict:hover::before {
    transform: translate(200%, 0) skewX(-30deg);
}

.btn-predict:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(110, 0, 255, 0.6), 0 0 20px var(--clr-accent-secondary);
}

/* ... (Loader, disabled styles remain similar) ... */

/* --- 6. Results Section --- */
.results {
    padding: var(--spacing-lg);
    animation: fadeIn 0.8s ease;
    background: var(--clr-bg-primary);
    border-top: 1px solid var(--clr-bg-secondary);
}

/* ... (Keyframes remain) ... */

.results h2 {
    color: var(--clr-text-primary);
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.2em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.prediction-card {
    background: linear-gradient(135deg, #00504A 0%, #00998B 100%); /* New gradient for results */
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 15px 40px rgba(0, 153, 139, 0.4), 0 0 20px rgba(0, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    border: 2px solid var(--clr-accent-secondary);
}

.prediction-card::before {
    content: '⚡'; /* Changed emoji for futuristic vibe */
    position: absolute;
    font-size: 15em;
    opacity: 0.1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(15deg);
}

.prediction-value .label {
    font-size: 1.3em;
    display: block;
    margin-bottom: 15px;
    opacity: 1;
    color: var(--clr-text-primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.prediction-value .amount {
    font-size: 4em;
    font-weight: 900;
    color: var(--clr-accent-secondary);
    display: block;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8), 0 0 5px rgba(0, 0, 0, 0.5);
}

/* ... (Impact list and Chart section styles adjusted to use vars) ... */

.impact-item {
    background: var(--clr-bg-primary);
    border-left: 5px solid var(--clr-accent-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    border-radius: 12px;
}

.impact-item:hover {
    transform: translateX(5px);
    border-color: var(--clr-accent-secondary);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.2);
}

.impact-value {
    color: var(--clr-accent-secondary);
}

.impact-percentage {
    background: var(--clr-accent-primary);
    color: white;
}

/* Reset button (Emergency System button look) */
.btn-reset {
    width: 100%;
    padding: 18px;
    background: #FF416C; /* Emergency Red */
    color: white;
    border: 2px solid #FF8E9A;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 5px 20px rgba(255, 65, 108, 0.4);
}

.btn-reset:hover {
    background: #E33860;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 65, 108, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Error */
.error {
    background: linear-gradient(135deg, #CC0000 0%, #FF6B6B 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px var(--spacing-lg);
    text-align: center;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(204, 0, 0, 0.6);
    border: 1px solid white;
}

/* ... (Responsive media queries remain relevant) ... */
/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2em;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .prediction-value .amount {
        font-size: 2.5em;
    }

    form, .results {
        padding: 20px;
    }
}
