:root {
    --primary-gold: #cf9e00;
    --primary-gold-hover: #b58b00;
    --secondary-accent: #1e293b;
    --accent-orange: #f28c38;
    --bg-light: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --input-bg: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Google Sans', 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 2rem;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-gold);
    letter-spacing: -0.02em;
}

h1 span {
    color: var(--text-dark);
    font-weight: 300;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

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

.section-title i {
    color: var(--primary-gold);
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

.currency-symbol,
.percent-symbol {
    position: absolute;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.currency-symbol {
    left: 1rem;
}

.percent-symbol {
    right: 1rem;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(207, 158, 0, 0.1);
}

.range-wrap {
    margin-top: 0.5rem;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-gold);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

.results-grid {
    display: grid;
    gap: 1.25rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

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

.result-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.highlight-box {
    background: var(--primary-gold);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
    color: white;
}

.highlight-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.highlight-value {
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(207, 158, 0, 0.1);
    color: var(--primary-gold);
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Tabs for Foreigner/Resident toggle */
.toggle-container {
    display: flex;
    background: var(--input-bg);
    padding: 4px;
    border-radius: 6px;
    margin-bottom: 2rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.6rem;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-muted);
}

.toggle-btn.active {
    background: white;
    color: var(--primary-gold);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Override text colors for results that were hardcoded in JS/HTML to specific classes if needed */
/* We will handle the specific green/red colors in JS via style or helper classes */

.print-btn {
    width: 100%;
    background: var(--secondary-accent);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.print-btn:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.print-btn i {
    font-size: 1.1rem;
}

.print-only {
    display: none;
}

/* Print Styles */
@media print {
    @page {
        margin: 2cm;
    }

    body {
        background: white !important;
        color: #1e293b !important;
    }

    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-only {
        display: block !important;
    }

    .report-header {
        border-bottom: 2px solid var(--primary-gold);
        padding-bottom: 1rem;
        margin-bottom: 2rem;
        display: flex !important;
        justify-content: space-between;
        align-items: baseline;
    }

    .report-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary-gold);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .report-date {
        font-size: 0.9rem;
        color: #64748b;
    }

    header {
        text-align: left !important;
        margin-bottom: 2rem !important;
    }

    header h1 {
        font-size: 2.2rem !important;
        margin: 0 !important;
    }

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

    .print-btn,
    .range-wrap,
    .toggle-container,
    .input-wrapper::after,
    .input-wrapper::before,
    .currency-symbol,
    .percent-symbol {
        display: none !important;
    }

    .calculator-grid {
        display: block !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        page-break-inside: avoid;
    }

    .section-title {
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 0.5rem;
    }

    input {
        background: transparent !important;
        border: none !important;
        padding: 0.5rem 0 !important;
        /* Restore some vertical padding for clarity */
        font-weight: 600 !important;
        color: #1e293b !important;
        font-size: 1.1rem !important;
        /* Slightly larger for visibility */
    }

    .highlight-box {
        background: var(--primary-gold) !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 1.5rem !important;
    }

    .highlight-value {
        font-size: 2.5rem !important;
    }

    .report-footer {
        margin-top: 3rem;
        border-top: 1px solid #e2e8f0;
        padding-top: 1.5rem;
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        font-size: 0.8rem;
    }

    .footer-contact {
        line-height: 1.6;
    }

    .footer-disclaimer {
        max-width: 300px;
        color: #94a3b8;
        text-align: right;
    }

    .badge {
        border: 1px solid #e2e8f0 !important;
    }
}

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

    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }
}