/* ===================================
   Zurich Wealth Engine - Dashboard UI
   Swiss Alpine palette (Sky Blue + Purple)
   =================================== */

:root {
    /* Primary Colors - Sky Blue (Rent scenario) */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;

    /* Accent - Purple (Buy scenario) */
    --accent-50: #faf5ff;
    --accent-100: #f3e8ff;
    --accent-200: #e9d5ff;
    --accent-300: #d8b4fe;
    --accent-400: #c084fc;
    --accent-500: #a855f7;
    --accent-600: #9333ea;
    --accent-700: #7c3aed;

    /* Invest - Green (Investment scenario) */
    --invest-50: #f0fdf4;
    --invest-100: #dcfce7;
    --invest-200: #bbf7d0;
    --invest-300: #86efac;
    --invest-400: #4ade80;
    --invest-500: #22c55e;
    --invest-600: #16a34a;
    --invest-700: #15803d;

    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-gradient: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Base Styles
   =================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--gray-800);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}

/* Swiss Alps & Lake Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://images.unsplash.com/photo-1527668752968-14dc70a27c95?auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(1px) brightness(1.05);
    opacity: 0.30;
    z-index: -1;
    transform: scale(1.02);
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin: 0;
}

/* ===================================
   Navigation - Compact
   =================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    height: 52px;
    padding: 0 1rem;
}

.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-900);
    text-decoration: none;
}

.navbar-brand .icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-github {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-github:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.btn-outline:hover {
    border-color: var(--primary-300);
    color: var(--primary-600);
    background: var(--primary-50);
}

/* ===================================
   Hero - Compact Landing
   =================================== */

.hero {
    padding: 4rem 1rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-50) 0%, transparent 100%);
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.5rem;
}

.highlight-rent {
    color: var(--primary-500);
}

.highlight-buy {
    color: var(--accent-500);
}

.hero-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin: 0;
}

.hero-subtitle strong {
    color: var(--gray-700);
}

/* Example Scenario */
.example-scenario {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    max-width: 640px;
    text-align: left;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.example-header i {
    color: var(--warning);
}

.example-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

.example-text strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* ===================================
   Dashboard Layout - Side by Side
   =================================== */

.dashboard {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - 180px);
}

/* ===================================
   Panel Base
   =================================== */

.panel {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.panel-header h2 {
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h2 i {
    color: var(--gray-400);
}

/* ===================================
   Input Panel - Left Side
   =================================== */

.panel-inputs {
    height: fit-content;
    position: sticky;
    top: 60px;
}

.input-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.input-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 0.875rem;
}

.section-title.buy {
    color: var(--accent-600);
}

.section-title.rent {
    color: var(--primary-600);
}

.section-title.invest {
    color: var(--invest-600);
}

/* Input Rows */
.input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

.input-row label {
    font-size: 0.8125rem;
    color: var(--gray-600);
    flex-shrink: 0;
    white-space: nowrap;
}

.input-row label.has-tooltip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.input-row label.has-tooltip .tooltip-trigger {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.input-field {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.input-field .prefix,
.input-field .suffix {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.input-field input {
    width: 110px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
    background: var(--gray-50);
    color: var(--gray-800);
}

.input-field input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px var(--primary-100);
}

/* Slider */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    cursor: pointer;
    margin: 0.375rem 0 0.75rem;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-500);
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-500);
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.slider.buy::-webkit-slider-thumb {
    background: var(--accent-500);
}

.slider.buy::-moz-range-thumb {
    background: var(--accent-500);
}

.slider.rent::-webkit-slider-thumb {
    background: var(--primary-500);
}

.slider.rent::-moz-range-thumb {
    background: var(--primary-500);
}

.slider.invest::-webkit-slider-thumb {
    background: var(--invest-500);
}

.slider.invest::-moz-range-thumb {
    background: var(--invest-500);
}

/* Time Pills */
.input-compact {
    margin-bottom: 0.5rem;
}

.input-compact label {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.time-pills {
    display: flex;
    gap: 0.375rem;
}

.pill {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--gray-200);
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pill:hover {
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.pill.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

/* Currency Pills */
.currency-pills {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.currency-pill {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--gray-200);
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.currency-pill:hover {
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.currency-pill.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.exchange-rate-info {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: var(--gray-400);
    font-style: italic;
}

/* Tax System Pills */
.tax-system-pills {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.tax-pill {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-200);
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tax-pill:hover {
    border-color: var(--accent-300);
    color: var(--accent-600);
}

.tax-pill.active {
    background: var(--accent-500);
    border-color: var(--accent-500);
    color: white;
}

/* Derived Value Display (e.g., Max Home Price) */
.derived-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--gray-700);
}

.derived-value i {
    color: var(--primary-500);
    font-size: 0.875rem;
}

.derived-value strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* Calculate Button Section */
.calculate-section {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--gray-100);
    margin-top: 0.5rem;
}

.btn-calculate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.btn-calculate:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-calculate i {
    font-size: 1.25rem;
}

.btn-calculate.hidden {
    display: none;
}

.calculate-hint {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.calculate-hint.hidden {
    display: none;
}

/* Presets */
.presets {
    display: flex;
    gap: 0.375rem;
    margin: 0.5rem 0;
}

.preset {
    flex: 1;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--gray-200);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset:hover {
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.preset.active {
    background: var(--primary-100);
    border-color: var(--primary-300);
    color: var(--primary-700);
}

/* ===================================
   Results Panel - Right Side
   =================================== */

.panel-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    box-shadow: none;
}

/* Winner Card */
.winner-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.winner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
}

.winner-card.rent-wins::before {
    background: var(--primary-500);
}

.winner-card.buy-wins::before {
    background: var(--accent-500);
}

.winner-content {
    flex: 1;
    min-width: 200px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.badge.rent {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge.buy {
    background: var(--accent-100);
    color: var(--accent-700);
}

.winner-amount {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.winner-amount.rent {
    color: var(--primary-600);
}

.winner-amount.buy {
    color: var(--accent-600);
}

.winner-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: 0;
}

/* Comparison Mini */
.comparison-mini {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

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

.compare-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.compare-label.buy { color: var(--accent-500); }
.compare-label.rent { color: var(--primary-500); }

.compare-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.compare-value.buy { color: var(--accent-600); }
.compare-value.rent { color: var(--primary-600); }

.vs {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-400);
}

/* ===================================
   Charts Stack - Vertical Layout
   =================================== */

.charts-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.toggle {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle.active {
    background: var(--primary-500);
}

.toggle-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.toggle.active .toggle-handle {
    transform: translateX(16px);
}

.chart-mode-toggle {
    display: flex;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.mode-btn {
    padding: 0.25rem 0.625rem;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn.active {
    background: var(--gray-800);
    color: white;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.legend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
}

.legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend.buy .dot { background: var(--accent-500); }
.legend.rent .dot { background: var(--primary-500); }
.legend.bum .dot { background: #f97316; }

.chart-container {
    height: 280px;
}

.chart-container.large {
    height: 320px;
}

/* ===================================
   Tooltips
   =================================== */

.has-tooltip {
    position: relative;
}

.tooltip-trigger {
    font-size: 0.75rem;
    color: var(--gray-400);
    cursor: help;
    transition: color var(--transition-fast);
}

.tooltip-trigger:hover {
    color: var(--primary-500);
}

.tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    width: 280px;
    padding: 0.875rem 1rem;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    pointer-events: none;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    width: 12px;
    height: 12px;
    background: var(--gray-900);
    transform: rotate(45deg);
}

.tooltip-up {
    top: auto;
    bottom: calc(100% + 8px);
}

.tooltip-up::before {
    top: auto;
    bottom: -6px;
}

.has-tooltip:hover .tooltip,
.tooltip-trigger:hover + .tooltip,
.has-tooltip .tooltip-trigger:hover ~ .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip p {
    margin: 0 0 0.5rem;
}

.tooltip p:last-child {
    margin-bottom: 0;
}

.tooltip strong {
    color: #bae6fd;
}

.tooltip a {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--primary-300);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.tooltip a:hover {
    color: var(--primary-200);
    text-decoration: underline;
}

/* ===================================
   Info Strip
   =================================== */

.info-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.info-item {
    flex: 1;
    min-width: 180px;
    font-size: 0.75rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item i {
    color: var(--gray-400);
}

.info-item strong {
    color: var(--gray-700);
}

/* ===================================
   Footer
   =================================== */

.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--gray-500);
    font-size: 0.75rem;
}

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

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

/* ===================================
   Utilities
   =================================== */

.hidden {
    display: none !important;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===================================
   Responsive Design
   =================================== */

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

    .panel-inputs {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .panel-inputs .panel-header {
        grid-column: 1 / -1;
    }

    .input-section {
        border-bottom: none;
        border-right: 1px solid var(--gray-100);
    }

    .input-section:last-child {
        border-right: none;
    }

    .winner-card {
        flex-direction: column;
        text-align: center;
    }

    .comparison-mini {
        width: 100%;
        justify-content: center;
    }

    .tooltip {
        left: -50px;
        width: 260px;
    }

    .tooltip::before {
        left: 60px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 3.5rem 1rem 1rem;
    }

    .hero-title {
        font-size: 1.375rem;
    }

    .dashboard {
        padding: 0.75rem;
        gap: 1rem;
    }

    .panel-inputs {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--gray-100);
    }

    .time-pills {
        flex-wrap: wrap;
    }

    .pill {
        flex: 0 0 auto;
    }

    .chart-container,
    .chart-container.large {
        height: 240px;
    }

    .info-strip {
        flex-direction: column;
    }

    .info-item {
        min-width: 100%;
    }

    .tooltip {
        left: -20px;
        width: 240px;
    }

    .tooltip::before {
        left: 30px;
    }
}

/* ===================================
   Empty State Styles
   =================================== */

.winner-card.empty-state {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 2px dashed var(--gray-300);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.empty-state-content {
    text-align: center;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-content i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    display: block;
}

.empty-state-content h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-state-content p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.5;
    max-width: 280px;
}

/* Chart Placeholder */
.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-md);
    text-align: center;
    padding: 2rem;
}

.chart-placeholder i {
    font-size: 2rem;
    color: var(--gray-300);
    margin-bottom: 0.75rem;
}

.chart-placeholder p {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin: 0;
}

/* ===================================
   Input Validation Styles
   =================================== */

/* Input wrapper for validation states */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper .input-row {
    margin-bottom: 0;
}

/* Error state for inputs */
.input-field.has-error input,
.input-field input.has-error {
    border-color: var(--error);
    background: #fef2f2;
    color: var(--error);
}

.input-field.has-error input:focus,
.input-field input.has-error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Warning state for inputs */
.input-field.has-warning input,
.input-field input.has-warning {
    border-color: var(--warning);
    background: #fffbeb;
}

.input-field.has-warning input:focus,
.input-field input.has-warning:focus {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Validation message */
.validation-message {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin-top: 0.375rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.4;
    animation: slideInMessage 0.2s ease-out;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.validation-message.warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.validation-message.info {
    background: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
}

.validation-message i {
    flex-shrink: 0;
    margin-top: 0.125rem;
    font-size: 0.75rem;
}

.validation-message span {
    flex: 1;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.input-field.shake input {
    animation: shake 0.3s ease-in-out;
}

/* Toast Notifications for Validation */
.validation-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.validation-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.validation-toast.error {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    border-left: 4px solid #fee2e2;
}

.validation-toast.warning {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    border-left: 4px solid #fef3c7;
}

.validation-toast.success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-left: 4px solid #d1fae5;
}

.validation-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.validation-toast-content {
    flex: 1;
}

.validation-toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.validation-toast-message {
    font-size: 0.8125rem;
    opacity: 0.9;
    line-height: 1.4;
}

.validation-toast-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: opacity var(--transition-fast);
}

.validation-toast-close:hover {
    opacity: 1;
}

/* Validation Summary Panel */
.validation-summary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 0.5rem 0 1rem;
    animation: slideInMessage 0.3s ease-out;
}

.validation-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #b91c1c;
    margin-bottom: 0.75rem;
}

.validation-summary-header i {
    font-size: 1rem;
}

.validation-summary-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.validation-summary-list li {
    font-size: 0.8125rem;
    color: #991b1b;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.validation-summary-list li:last-child {
    margin-bottom: 0;
}

/* Field focus indicator for validation */
.input-row.validation-focus label {
    color: var(--error);
    font-weight: 600;
}

/* Disabled calculate button state */
.btn-calculate.disabled,
.btn-calculate:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-calculate.disabled:hover,
.btn-calculate:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Input status indicator */
.input-status {
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
}

.input-status.valid {
    color: var(--success);
}

.input-status.error {
    color: var(--error);
}

.input-status.warning {
    color: var(--warning);
}
