/* ===================================
   UK Salary Calculator - Dark Theme
   Inspired by claude.ai design
   =================================== */

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

:root {
    /* Dark theme colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #383838;
    --bg-elevated: #242424;

    /* Text colors */
    --text-primary: #e8e8e8;
    --text-secondary: #a8a8a8;
    --text-muted: #707070;

    /* Accent colors */
    --accent-primary: #cc785c;
    --accent-secondary: #d4896d;
    --accent-hover: #e09680;

    /* Status colors */
    --success: #52a689;
    --warning: #d4896d;
    --error: #d86c6c;
    --info: #6d9bd4;

    /* Border colors */
    --border-subtle: #3a3a3a;
    --border-medium: #4a4a4a;

    /* Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary);
}

/* Header */
header {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 48px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Calculator Layout */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

/* Section Styling */
section h2 {
    font-size: 1.5rem;
    margin-bottom: 28px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

section h3 {
    font-size: 1.125rem;
    margin: 28px 0 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Input Section */
.input-section {
    background: var(--bg-secondary);
    padding: 40px;
    border-right: 1px solid var(--border-subtle);
}

@media (max-width: 1024px) {
    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

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

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.15);
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: normal;
}

/* Info Box */
.info-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.info-box p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

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

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

.info-box ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info-box li {
    margin: 4px 0;
}

.info-box span {
    color: var(--accent-primary);
    font-weight: 600;
}

.bonus-info p {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Slider Group */
.slider-group {
    margin: 24px 0;
}

.slider-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-medium);
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-group input[type="range"]::-moz-range-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

#pensionSliderValue,
#esppSliderValue,
#bonusMultiplierValue {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    margin: 18px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-group label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 32px 0;
}

/* Results Section */
.results-section {
    background: var(--bg-elevated);
    padding: 40px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    text-align: center;
    transition: all 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.card.highlight {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
}

.card.highlight:hover {
    box-shadow: var(--shadow-lg);
}

.card h4 {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card.highlight h4 {
    color: rgba(255, 255, 255, 0.9);
}

.card .amount {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.card .amount.tax {
    color: var(--error);
}

.card-hint {
    display: block;
    font-size: 0.75rem;
    margin-top: 6px;
    opacity: 0.7;
}

.card.rsu-card {
    background: linear-gradient(135deg, var(--info) 0%, #5a8bc4 100%);
    color: white;
    border: none;
}

.card.rsu-card h4 {
    color: rgba(255, 255, 255, 0.9);
}

/* Breakdown Table */
.breakdown-details {
    margin-top: 32px;
}

.breakdown-table {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.breakdown-table tr {
    border-bottom: 1px solid var(--border-subtle);
}

.breakdown-table tr:last-child {
    border-bottom: none;
}

.breakdown-table td {
    padding: 16px 20px;
    font-size: 0.9rem;
}

.breakdown-table td:first-child {
    font-weight: 500;
    color: var(--text-secondary);
}

.breakdown-table .amount-cell {
    text-align: right;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-table .deduction .amount-cell {
    color: var(--error);
}

.breakdown-table .addition .amount-cell {
    color: var(--success);
}

.breakdown-table .rsu-net {
    background: rgba(82, 166, 137, 0.1);
}

.breakdown-table .rsu-net .amount-cell {
    color: var(--success);
    font-weight: 700;
}

.breakdown-table .subtotal {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.breakdown-table .subtotal td:first-child {
    color: var(--text-primary);
}

.breakdown-table .total {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
}

.breakdown-table .total td {
    color: white;
}

.breakdown-table .total .amount-cell {
    color: white;
}

/* Charts Section */
.charts-section {
    padding: 40px;
    background: var(--bg-secondary);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 32px;
}

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

.chart-container {
    background: var(--bg-elevated);
    padding: 28px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.chart-container h3 {
    margin: 0 0 24px 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.chart-container canvas {
    height: 300px !important;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 24px;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    header {
        padding: 32px 24px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .calculator-layout {
        gap: 0;
    }

    .input-section,
    .results-section {
        padding: 24px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .charts-section {
        padding: 24px;
        gap: 24px;
    }

    .chart-container {
        padding: 20px;
    }

    section h2 {
        font-size: 1.375rem;
    }

    section h3 {
        font-size: 1rem;
    }
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-medium);
}

/* Chart.js dark theme overrides */
canvas {
    filter: brightness(1);
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        box-shadow: none;
    }

    .input-section {
        display: none;
    }

    .charts-section {
        page-break-before: always;
    }
}
