/* CSS Design System for Opa & Oma's Vermogensplan */

:root {
    /* Color Palette (Dark Theme Default) */
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-card-hover: #1c263c;
    --bg-glass: rgba(21, 28, 44, 0.85);
    
    --border-color: rgba(255, 255, 255, 0.12);
    --border-color-light: rgba(255, 255, 255, 0.06);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.3);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);

    --info: #06b6d4;

    /* Spacing & Layout */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
body.light-theme {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.9);

    --border-color: #cbd5e1;
    --border-color-light: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.1);
}

/* Reset & Core Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    word-break: break-word;
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

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

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color-light);
    padding: 12px 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    background: rgba(59, 130, 246, 0.15);
    padding: 6px 10px;
    border-radius: 12px;
}

.logo-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    display: block;
    line-height: 1.2;
}

.logo-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

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

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    transform: scale(1.08);
}

/* Mobile Nav Bar Scrollable Pill Bar */
@media (max-width: 860px) {
    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 6px 0;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    .nav-links a {
        background: var(--bg-card);
        padding: 6px 14px;
        border-radius: 20px;
        border: 1px solid var(--border-color);
        font-size: 0.8rem;
    }
    .header-container {
        flex-wrap: wrap;
    }
}

/* Buttons & Badges */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: auto;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Hero Section */
.hero-section {
    padding: 48px 0 36px;
    text-align: center;
    background: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.14) 0%, transparent 65%);
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    max-width: 920px;
    margin: 16px auto;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 780px;
    margin: 0 auto 32px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    transition: var(--transition);
}

.stat-card.highlight {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.08) 100%);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--text-primary);
}

.stat-card.highlight .stat-value {
    color: var(--success);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Owner Banner */
.owner-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 32px;
}

.owner-icon {
    font-size: 2.2rem;
    background: var(--bg-card);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.owner-text h3 {
    font-size: 1.15rem;
    color: var(--success);
    margin-bottom: 6px;
}

.owner-text p {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Sections */
.section {
    padding: 56px 0;
}

.bg-card {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color-light);
    border-bottom: 1px solid var(--border-color-light);
}

.section-header {
    margin-bottom: 36px;
}

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

.section-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    margin-top: 8px;
    margin-bottom: 10px;
}

.section-lead {
    font-size: clamp(0.92rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 750px;
    margin: 0 auto;
}

/* Cards & Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.card-danger {
    border-top: 4px solid var(--danger);
}

.card-success {
    border-top: 4px solid var(--success);
}

.card-header {
    margin-bottom: 18px;
}

.card-header h3 {
    font-size: 1.25rem;
    margin-top: 8px;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.check-list li {
    position: relative;
    padding-left: 26px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.check-list li strong {
    color: var(--text-primary);
}

.list-danger li::before {
    content: "❌";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.85rem;
}

.list-success li::before {
    content: "✅";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.85rem;
}

/* Diagram Section */
.diagram-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 36px 0;
    flex-wrap: wrap;
}

.diagram-step {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.step-num {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.step-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 18px;
    border-radius: var(--radius-md);
    text-align: center;
}

.step-card h4 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.step-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.diagram-arrow {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: bold;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 32px;
}

.benefit-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.benefit-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: inline-block;
}

.benefit-box h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.benefit-box p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-group strong {
    font-size: 1.1rem;
    color: var(--primary);
    white-space: nowrap;
}

/* Improved Touch Sliders */
input[type="range"] {
    width: 100%;
    height: 10px;
    border-radius: 6px;
    background: var(--border-color);
    outline: none;
    accent-color: var(--primary);
    cursor: pointer;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color-light);
    margin: 20px 0;
}

.input-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Status Box */
.status-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    margin-bottom: 20px;
    transition: var(--transition);
}

.status-box.status-ok {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.status-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.status-text h4 {
    font-size: 0.98rem;
}

.status-text p {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

/* Results Display */
.results-comparison {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 14px;
    margin-bottom: 20px;
    text-align: center;
}

.res-col {
    flex: 1;
}

.res-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.res-amount {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.3rem, 3.5vw, 1.7rem);
    font-weight: 800;
}

.res-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.res-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-color-light);
    gap: 10px;
}

.callout {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
}

.callout-tip {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
}

/* Portfolio Section */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

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

.portfolio-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.border-danger {
    border-top: 4px solid var(--danger);
}

.border-success {
    border-top: 4px solid var(--success);
}

.highlight-card {
    background: linear-gradient(180deg, var(--bg-main) 0%, rgba(16, 185, 129, 0.05) 100%);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.15);
}

.p-header {
    margin-bottom: 16px;
}

.p-header h3 {
    font-size: 1.15rem;
    margin-top: 6px;
}

.chart-wrapper {
    position: relative;
    height: 240px;
    margin-bottom: 20px;
}

.p-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.p-feature-item {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.p-feature-item.danger strong {
    color: var(--danger);
}

.p-feature-item.success strong {
    color: var(--success);
}

/* Crash Simulator Box */
.crash-simulator-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 32px;
}

.crash-simulator-box h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.crash-simulator-box p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.sim-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 768px) {
    .sim-comparison {
        grid-template-columns: 1fr;
    }
}

.sim-col {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.danger-bg {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.success-bg {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.sim-col h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.sim-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px !important;
}

.sim-loss {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.sim-remain {
    font-size: 0.84rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Timeline / Action plan */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 32px auto 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 18px;
    border-radius: var(--radius-md);
    flex: 1;
}

.timeline-content h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.timeline-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.action-footer {
    text-align: center;
    margin-top: 32px;
}

/* Text Utility Classes */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Footer */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border-color-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Specific Mobile Responsive Fixes (< 640px) */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .owner-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .owner-icon {
        margin: 0 auto;
    }
    .diagram-container {
        flex-direction: column;
    }
    .diagram-arrow {
        transform: rotate(90deg);
        margin: 4px 0;
    }
    .results-comparison {
        flex-direction: column;
        gap: 8px;
    }
    .res-arrow {
        transform: rotate(90deg);
    }
    .timeline-item {
        gap: 12px;
    }
    .timeline-marker {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
}

/* Print Styles */
@media print {
    header, .hero-actions, #themeToggleBtn, .action-footer {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .card, .calc-card, .portfolio-card, .step-card, .timeline-content, .owner-banner {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: white !important;
        color: black !important;
    }
    .text-secondary, .text-muted {
        color: #444 !important;
    }
}
