@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Theme Light Variables */
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: rgba(79, 70, 229, 0.1);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --glass-blur: 12px;
}

[data-theme="dark"] {
    /* Theme Dark Variables */
    --bg-color: #0b132b;
    --card-bg: rgba(28, 37, 65, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.15);
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    padding: 2rem 1rem;
    min-height: 100vh;
}

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

/* Header & Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.logo-section h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    background-color: var(--accent-light);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Base Card Styles - Glassmorphism */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 1.25rem;
    padding: 2.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

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

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

input[type="number"], select {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid var(--card-border);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="number"]:focus, select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-light);
}

/* Styling for select options to prevent white-on-white text in dark mode */
select option {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

[data-theme="dark"] select option {
    background-color: #1c2541; /* Dark navy background matching card bg */
    color: #f8fafc;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: block;
    text-align: center;
    padding: 0.85rem;
    border: 1.5px solid var(--card-border);
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.02);
}

.radio-option input[type="radio"]:checked + .radio-label {
    border-color: var(--accent-color);
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.radio-label:hover {
    background-color: var(--accent-light);
}

.btn-predict {
    grid-column: span 2;
    background-color: var(--accent-color);
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .btn-predict {
        grid-column: span 1;
    }
}

.btn-predict:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-predict:active {
    transform: translateY(0);
}

/* Prediction Output Area */
.output-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
}

.placeholder-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.4;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

.results-view {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom SVG Gauge */
.gauge-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 1.5rem;
}

.gauge {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: var(--card-border);
    stroke-width: 14;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 565.48; /* 2 * PI * r (r=90) */
    stroke-dashoffset: 565.48;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-percentage {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.gauge-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.risk-level-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.risk-low {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.risk-medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.risk-high {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.recommendation-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: left;
    margin-top: 1rem;
}

.recommendation-card h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.recommendation-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* EDA / Insight Section */
.insight-section {
    margin-top: 3rem;
}

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

@media (max-width: 868px) {
    .insight-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Footer styling */
footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}
