:root {
    /* Neon Violet / Dark Theme */
    --bg-main: #0F0720;
    --bg-panel: rgba(26, 15, 46, 0.7);
    --bg-card: rgba(43, 24, 76, 0.8);
    --border-color: rgba(168, 85, 247, 0.15);
    --border-hover: rgba(168, 85, 247, 0.4);
    
    --text-main: #F3E8FF;
    --text-muted: #A78BFA;
    
    --primary: #A855F7;
    --primary-hover: #9333EA;
    --secondary: #C084FC;
    --accent: #22D3EE;
    --danger: #F43F5E;
    
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(34, 211, 238, 0.05) 0%, transparent 40%);
}

.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; min-height: 0; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.text-center { text-align: center; }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-6 { margin-top: 24px; }
.pt-4 { padding-top: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.w-full { width: 100%; }

.border-b { border-bottom: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.uppercase { text-transform: uppercase; letter-spacing: 0.5px; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.3);
    padding: 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
}
.brand svg { color: var(--primary); }

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
    align-items: start;
}
@media (max-width: 800px) {
    .main-grid { grid-template-columns: 1fr; }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.9rem; margin-bottom: 8px; font-weight: 500; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.currency-prefix {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    pointer-events: none;
}
.input-control {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}
input.input-control.font-mono { padding-left: 48px; }
.input-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2); }
select.input-control { cursor: pointer; appearance: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23A78BFA" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>'); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
select.input-control option { background: var(--bg-main); }

/* Toggles */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.toggle-row:hover { border-color: var(--primary); }
.toggle-switch {
    appearance: none;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.toggle-switch:checked { background: var(--primary); }
.toggle-switch:checked::after { transform: translateX(20px); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--primary); background: rgba(168, 85, 247, 0.1); }

/* Results Section */
.thp-hero {
    background: linear-gradient(135deg, rgba(168,85,247,0.1) 0%, rgba(34,211,238,0.1) 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}
.thp-amount { font-size: 2.5rem; font-weight: 700; margin-top: 8px; letter-spacing: -1px; text-shadow: 0 0 20px rgba(168,85,247,0.3); }

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.row-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.row-item.highlight {
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-top: 8px;
}
.row-item.negative .val { color: var(--danger); }
.row-item.positive .val { color: var(--accent); }

/* Tax Bracket Bars */
.bracket-bar-row {
    margin-bottom: 12px;
    font-family: var(--font-mono);
}
.bracket-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--text-muted);
}
.bracket-progress {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}
.bracket-fill {
    height: 100%;
    background: var(--primary);
}

/* Print/Export PDF Adjustments */
.pdf-export-mode {
    background: #fff !important;
    color: #000 !important;
}
.pdf-export-mode .glass-panel {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #000;
}
.pdf-export-mode .text-main, 
.pdf-export-mode .text-muted, 
.pdf-export-mode .row-item.highlight { color: #000 !important; border-bottom-color: #eee !important; }
.pdf-export-mode .thp-hero { background: #f8f9fa !important; border-color: #ddd !important; }
.pdf-export-mode .pdf-footer { display: block !important; }

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
}
.toast.hidden { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
