/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B0000;
    --primary-hover: #660000;
    --success-color: #dc2626;
    --background: #1a1a1a;
    --card-background: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --border-color: #404040;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2020 50%, #1a1a1a 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #660000 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

header .container {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header .subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 0.25rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

header .source {
    font-size: 0.875rem;
    opacity: 0.85;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

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

/* Main Content */
main {
    padding: 2rem 0;
}

/* Calculator Wrapper */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

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

/* Sections */
.input-section,
.results-section {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.input-section h2,
.results-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #1a1a1a;
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.3);
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix .prefix {
    position: absolute;
    left: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-with-prefix input {
    padding-left: 2rem;
}

/* Checkbox */
.checkbox-group {
    padding: 1rem;
    background: var(--background);
    border-radius: 0.375rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    cursor: pointer;
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

/* Result Cards */
.result-card {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.result-card.highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid var(--primary-color);
}

.result-card h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.result-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-breakdown strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Comparison Section */
.comparison-section {
    background: #fefce8;
    padding: 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #fde047;
}

.comparison-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

.comparison-item:last-child {
    margin-bottom: 0;
}

.comparison-label {
    font-weight: 600;
}

.comparison-value {
    color: var(--success-color);
    font-weight: 700;
}

.comparison-difference {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.comparison-difference.positive {
    color: #059669;
}

.comparison-difference.negative {
    color: #dc2626;
}

/* Info Section */
.info-section {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.info-section h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Info Content */
.info-content {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.info-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.info-content h3 {
    font-size: 1.375rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-content h4 {
    font-size: 1.125rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-content li strong {
    color: var(--text-primary);
}

/* Disclaimer */
.disclaimer {
    background: #fef2f2;
    padding: 1.5rem;
    border-radius: 0.375rem;
    margin-top: 2rem;
    border-left: 4px solid #dc2626;
}

.disclaimer h4 {
    color: #dc2626;
    margin-bottom: 0.75rem;
}

.disclaimer p {
    color: #7f1d1d;
    font-size: 0.875rem;
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .result-value {
        font-size: 2rem;
    }

    .info-content h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Centered Calculator Layout */
.centered-calculator {
    max-width: 1400px;
    margin: 0 auto;
}

/* Slider Section */
.slider-section {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    text-align: center;
}

.slider-section h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

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

.income-slider {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, #404040 0%, var(--primary-color) 100%);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 1.5rem;
}

.income-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    transition: transform 0.2s;
}

.income-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.income-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    border: none;
    transition: transform 0.2s;
}

.income-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.slider-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Controls Section */
.controls-section {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.control-group h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    gap: 0;
    background: #1a1a1a;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.3);
}

.toggle-btn:hover:not(.active) {
    background: rgba(139, 0, 0, 0.2);
}

/* Results Comparison */
.results-comparison {
    margin-bottom: 2rem;
}

.results-comparison h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.scenario-card {
    background: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.scenario-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.scenario-card.highlight {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.1) 0%, var(--card-background) 100%);
}

.scenario-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.scenario-header h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.scenario-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-main {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.result-breakdown {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

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

.breakdown-item span {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.breakdown-item strong {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Comparison Section */
.comparison-section {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--primary-color);
}

.comparison-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #1a1a1a;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.comparison-label {
    font-weight: 600;
    color: var(--text-primary);
}

.comparison-value {
    color: var(--success-color);
    font-weight: 700;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .slider-value {
        font-size: 2rem;
    }
    
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-section {
        grid-template-columns: 1fr;
    }
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}
