:root {
    /* Premium Palette - Sage & Cream (Based on Reference) */
    --primary: #4a7c59;
    /* Sage Green */
    --primary-gradient: linear-gradient(135deg, #4a7c59 0%, #6b9c7b 100%);
    --primary-dark: #3a6346;

    --secondary: #8c8169;
    /* Warm Grey/Taupe */

    --accent: #e07a5f;
    /* Terracotta/Muted Orange for distinct actions */
    --accent-gradient: linear-gradient(135deg, #e07a5f 0%, #f2cc8f 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f4a261;
    --danger: #e76f51;

    --background: #d6d3cd;
    /* Deep Taupe / Sand */
    --bg-gradient: linear-gradient(to bottom, #d6d3cd, #c5c2bc);

    --surface: rgba(255, 255, 255, 0.60);
    --surface-hover: rgba(255, 255, 255, 0.85);
    --surface-border: rgba(74, 124, 89, 0.2);
    /* Subtle green tint border */

    --text-main: #2d3436;
    /* Soft Black */
    --text-muted: #636e72;
    --text-light: #b2bec3;

    --border: #dcd6cb;

    --shadow-sm: 0 2px 4px rgba(74, 124, 89, 0.05);
    --shadow-md: 0 4px 12px rgba(74, 124, 89, 0.08);
    --shadow-lg: 0 12px 24px rgba(74, 124, 89, 0.12);
    --shadow-glow: 0 0 15px rgba(74, 124, 89, 0.15);

    --card-glowing-edge: 0 4px 20px rgba(74, 124, 89, 0.25);
    /* Sage Green Glow */

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --glass-blur: blur(8px);

    --btn-predict: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    /* Default Blue for light mode too */
}


[data-theme="dark"] {
    /* Premium Palette - Dark Mode (Charcoal & Sage) */
    --background: #111827;
    /* Gray 900 - Neural Dark */
    --bg-gradient: radial-gradient(circle at 50% 0%, #1f2937 0%, #111827 60%);

    --surface: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.85) 100%);
    /* Deep Space Surface */
    --surface-hover: linear-gradient(180deg, rgba(51, 65, 85, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    --surface-border: rgba(139, 92, 246, 0.3);
    /* Violet tint border */

    --text-main: #f9fafb;
    --text-muted: #a1abbb;
    --text-light: #9ca3af;

    --primary: #c2b7ed;
    /* Indigo  - Galaxy Primary */
    --primary-gradient: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
    /* Blue to Purple Galaxy Gradient */

    --border: rgba(255, 255, 255, 0.15);

    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

    --shadow-glow: 0 0 25px rgba(129, 140, 248, 0.5);
    /* Indigo/Galaxy Glow */

    --accent: #c084fc;
    /* Violet Accent */
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #e879f9 100%);
    /* Purple/Pink Galaxy Accent */

    --btn-predict: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
    /* Galaxy Gradient for Predict */
}

[data-theme="dark"] .navbar {
    background: #1f2738;
    /* Solid dark for dark mode */
}

html {
    transition: background-color 0.25s, color 0.25s
}

/* Dark theme variables: applied when documentElement has data-theme="dark" */
/* Dark theme variables merged into main block above */

/* Presentation mode: larger typography, higher contrast, simplified chrome */
.present {
    font-size: 1.12rem;
    /* slightly larger body font */
}

.present .navbar {
    box-shadow: none;
}

.present .nav-links {
    gap: 1rem;
}

.present .card {
    padding: 2.25rem;
    border-width: 0;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.35);
}

.present .brand {
    font-size: 1.75rem;
}

.present .btn {
    padding: 1rem 1.5rem;
    font-size: 1.05rem
}

/* Theme control small styles */
.theme-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem
}

.theme-controls .btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer
}

.theme-controls .btn-outline:hover {
    background: rgba(255, 255, 255, 0.02)
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: #3b534d;
    /* Dark background for header */
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    /* White brand text */
    text-decoration: none;
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #e5e7eb;
    /* Light text for dark navbar */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Layout */
.content {
    flex: 1;
    padding: 2rem 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--card-glowing-edge);
    /* Color coming out from background */
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--background);
    padding-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

select,
input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    transition: border-color 0.2s;
}

[data-theme="dark"] select,
[data-theme="dark"] input {
    background: rgba(17, 24, 39, 0.6);
    /* Darker background for inputs */
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--surface);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: color-mix(in srgb, var(--primary), transparent 90%);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
}

.btn:hover {
    background-color: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary.btn:hover {
    background-color: var(--primary-dark);
}

.btn-primary,
#weather-predict {
    /* Auto-inherits from btn */
    font-weight: 600;
}

/* Specific override: "Generate Prediction" main button solid green */
#run-analysis-card .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

#run-analysis-card .btn-primary:hover {
    background: var(--primary-dark);
}

.btn-accent:hover {
    filter: brightness(110%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    /* Blue glow on hover */
}

/* Utilities */
.flashes {
    list-style: none;
    margin-bottom: 2rem;
}

.flashes li {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.gap-2 {
    gap: 0.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.kpi-card {
    padding: 1rem;
    text-align: center
}

.kpi-title {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary)
}

@media(max-width:900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:520px) {
    .kpi-grid {
        grid-template-columns: 1fr
    }
}

/* Dashboard specific styles */
/* Dashboard specific styles */
.dashboard-hero {
    text-align: center;
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-md);
}

.dashboard-hero .hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center
}

.dashboard-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-hero .lead {
    color: var(--text-muted);
    margin-bottom: 1rem
}

.hero-actions {
    display: inline-flex;
    gap: 0.75rem
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem
}

.main-card {
    grid-column: span 2
}

.wide-card {
    grid-column: span 3
}

.card-header h3 {
    margin: 0;
    font-size: 1.125rem
}

.card-header .muted {
    color: var(--text-muted);
    font-size: 0.95rem
}

.card-body {
    padding-top: 0.75rem
}

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

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

.form-actions {
    display: flex;
    justify-content: flex-end
}

.form-actions .btn {
    min-width: 220px
}

.actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem
}

.btn-block {
    width: 100%;
    display: inline-flex;
    justify-content: center
}

.pill {
    background: #ecfdf5;
    color: #05251b;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem
}

.responsive-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto
}

/* compact card variant for small widgets */
.small-card {
    padding: 1rem
}

.small-card h3 {
    font-size: 1rem
}

.compare-card .form-group {
    margin-bottom: 0.5rem
}

/* Outlines / variants */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main)
}

/* Small screens: make grid single column */
@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr
    }

    .main-card {
        grid-column: auto
    }

    .wide-card {
        grid-column: auto
    }

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

    .hero-actions {
        flex-direction: column
    }
}

/* ... existing styles ... */

/* Glassmorphism & Modern UI Extensions */
:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --gradient-primary: linear-gradient(135deg, #4a7c59 0%, #6b9c7b 100%);
    /* Sync with main Sage theme */
    --gradient-success: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    --gradient-danger: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    --gradient-card: linear-gradient(145deg, #ffffff, #f0f0f0);
}

[data-theme="dark"] {
    --glass-bg: rgba(17, 25, 40, 0.75);
    --glass-border: rgba(255, 255, 255, 0.125);
    --gradient-card: linear-gradient(145deg, #1e293b, #0f1724);
}

/* Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Result Page Specifics */
.result-header {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

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

.verdict-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease;
}

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

.verdict-badge {
    font-size: 1.5rem;
    font-weight: 800;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.verdict-suitable {
    background: linear-gradient(135deg, #81FBB8 10%, #28C76F 100%);
    color: #064e3b;
}

.verdict-unsuitable {
    background: linear-gradient(135deg, #FEB692 10%, #EA5455 100%);
    color: #7f1d1d;
}

.usi-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: var(--surface);
    border: 8px solid var(--border);
    margin: 0 auto 1rem;
    position: relative;
}

.usi-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.usi-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.action-list {
    list-style: none;
    padding: 0;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--surface);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-sm);
}

.action-icon {
    font-size: 1.25rem;
    color: var(--accent);
    flex-shrink: 0;
}

/* Authentication Pages */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    /* Subtract approx navbar height */
    padding: 2rem;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    box-shadow: 0 10px 25px rgba(2, 6, 23, 0.1);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

[data-theme="dark"] .auth-box {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.auth-box h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--primary);
    text-align: center;
    border: none;
    padding: 0;
}

.auth-box p.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    margin-top: -1.5rem;
}

.auth-box .form-group label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Animations for auth */
.auth-box {
    animation: authEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}