/* Import shared variables */
@import '../../../_shared/variables.css';

:root {
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: var(--sl-blue-primary);
    --border-color: #e2e8f0;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --success-bg: #ecfdf5;
}

[data-theme="dark"] {
    --bg-page: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --danger-bg: #450a0a;
    --success-bg: #064e3b;
    --primary: #60a5fa; /* Lighter blue for dark mode */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
}

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

.header__brand {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.header__title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover { color: var(--text-main); }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.btn--icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.btn--icon:hover { color: var(--primary); }

/* App Container */
.app-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Titles */
.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
}
.page-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Forms */
.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-select, .form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    box-sizing: border-box;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}
.input-with-icon .form-input {
    padding-left: 2rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Range Slider */
.form-range {
    width: 100%;
    margin: 0.5rem 0;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-card:hover { border-color: var(--sl-blue-light); }
.radio-card.selected {
    border-color: var(--primary);
    background-color: #f0f9ff;
}

.radio-card input { margin-top: 0.25rem; }

.radio-content {
    display: flex;
    flex-direction: column;
}
.radio-content strong { font-size: 0.95rem; }
.radio-content span { font-size: 0.85rem; color: var(--text-muted); }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 1rem;
    text-align: center;
    display: inline-block;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--sl-blue-dark); transform: translateY(-2px); }

.btn-secondary { background: transparent; color: var(--text-muted); }
.btn-secondary:hover { color: var(--text-main); }

.btn-outline { background: transparent; border: 2px solid var(--border-color); color: var(--text-main); box-sizing: border-box; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-lg { padding: 1rem; font-size: 1.1rem; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }

/* Results */
.hero-stat {
    font-size: 3rem;
    font-weight: 800;
    color: var(--danger);
    line-height: 1;
    margin: 1rem 0 0.5rem 0;
}
.results-header { text-align: center; margin-bottom: 2rem; }
.hero-caption { color: var(--text-muted); font-size: 1rem; }

.comparison-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}
.comparison-card h3 { margin-top: 0; margin-bottom: 0.5rem; font-size: 1.25rem; }
.comparison-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.comparison-table-wrapper { overflow-x: auto; }
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.comparison-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
}
.comparison-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.text-red { color: var(--danger); font-weight: 600; }
.text-green { color: var(--success); font-weight: 600; }
.highlight-row { background-color: var(--bg-page); }

.break-even-box {
    margin-top: 1.5rem;
    background: var(--success-bg);
    color: #065f46;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    border: 1px solid #d1fae5;
}

/* Bar Chart Visual */
.visuals-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.bar-chart { margin-top: 1rem; }
.bar-row { margin-bottom: 1rem; }
.bar-label { display: block; font-size: 0.85rem; margin-bottom: 0.25rem; color: var(--text-muted); }
.bar-track {
    background: #f1f5f9;
    height: 24px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.bar-fill.red { background: var(--danger); }
.bar-fill.green { background: var(--success); }
.bar-value {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center; align-items: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.modal__close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer;
    color: var(--text-muted);
}
.modal__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.modal__subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }
.modal-input {
    width: 100%; padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px; font-size: 1rem;
    box-sizing: border-box;
}
.privacy-note { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* Utilities */
.fade-in { animation: fadeIn 0.5s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
