/* 
 * Indonesian Tax Calculator Styles
 * Theme: Premium Dark Mode (#0F172A), Accents: #3B82F6, #EF4444
 */

:root {
    --bg-main: #0F172A;
    /* Slate 900 */
    --bg-surface: #1E293B;
    /* Slate 800 */
    --bg-elevated: #334155;
    /* Slate 700 */

    --primary: #3B82F6;
    /* Blue 500 */
    --primary-hover: #2563EB;
    /* Blue 600 */

    --success: #10B981;
    /* Emerald 500 */
    --danger: #EF4444;
    /* Red 500 */

    --text-main: #F8FAFC;
    /* Slate 50 */
    --text-muted: #94A3B8;
    /* Slate 400 */
    --border: #334155;
    /* Slate 700 */

    --font-main: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-lg: 16px;
    --radius: 8px;
    --radius-sm: 4px;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Utils */
.hidden {
    display: none !important;
}

.w-full {
    width: 100%;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.pt-2 {
    padding-top: 0.5rem;
}

.text-green {
    color: var(--success) !important;
}

.text-red {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-xl {
    font-size: 1.25rem;
    font-weight: 700;
}

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

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.gap-4 {
    gap: 1rem;
}

.scroll-y {
    overflow-y: auto;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-elevated);
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.top-nav {
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-box {
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 1.1rem;
    font-family: var(--font-mono);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.badge {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lang-toggle {
    display: flex;
    background: var(--bg-main);
    border-radius: 20px;
    padding: 2px;
    border: 1px solid var(--border);
}

.lang-toggle button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-toggle button.active {
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: var(--shadow-card);
}

/* Main Workspace */
.workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    /* handled by panels */
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-panel {
    max-width: 500px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    z-index: 10;
}

.result-panel {
    background: var(--bg-main);
    position: relative;
}

/* Tabs */
.tabs {
    display: flex;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.25rem 0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    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 {
    flex: 1;
    padding: 2rem 1.5rem;
}

/* Forms */
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

.input-with-icon span {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
}

.input-with-icon input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-with-icon input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 0.95rem;
    appearance: none;
    cursor: pointer;
}

/* Custom Radios & Checkboxes */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-card input {
    display: none;
}

.custom-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: inline-block;
    position: relative;
}

.radio-card input:checked+.custom-radio {
    border-color: var(--primary);
}

.radio-card input:checked+.custom-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.radio-card input:checked~span {
    color: var(--primary);
    font-weight: 600;
}

.radio-card:hover {
    border-color: var(--bg-elevated);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    cursor: pointer;
}

.checkbox-card input {
    display: none;
}

.custom-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.checkbox-card input:checked+.custom-check {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-card input:checked+.custom-check::after {
    content: '✓';
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-lg {
    padding: 1rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-elevated);
}

/* Info alerts */
.info-alert {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--primary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.info-alert i {
    font-size: 1.25rem;
}


/* --- Result Panel --- */
.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.empty-state p {
    max-width: 300px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.result-content {
    padding: 3rem 4rem;
    margin: 0 auto;
    max-width: 900px;
    width: 100%;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

/* Salary Slip */
.salary-slip {
    background: #ffffff;
    /* Explicitly light for slip to simulate paper */
    color: #0f172a;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono);
}

.slip-header {
    text-align: center;
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.slip-header h3 {
    font-family: var(--font-main);
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 1.5rem;
}

.slip-meta {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-family: var(--font-main);
}

.slip-section {
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: var(--font-main);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.slip-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.slip-row span {
    color: #475569;
    font-family: var(--font-main);
}

.slip-row strong {
    font-weight: 600;
}

.highlight-row {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    margin: 0.2rem -0.5rem;
}

.total-row {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
    padding-top: 0.8rem;
    font-weight: bold;
}

.total-row span {
    color: #0f172a;
    font-weight: 700;
}

.final-section {
    border-top: 2px solid #0f172a;
    padding-top: 1rem;
    margin-bottom: 0;
}

/* Yearly box */
.yearly-summary {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-item {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
}

.info-val {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .workspace {
        flex-direction: column;
        overflow-y: auto;
    }

    .input-panel {
        max-width: 100%;
        border-right: none;
        height: auto;
        flex: none;
        border-bottom: 1px solid var(--border);
    }

    .result-content {
        padding: 2rem 1.5rem;
    }

    .salary-slip {
        padding: 1.5rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}