:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --gradient-1: #3b82f6;
    --gradient-2: #8b5cf6;
    --input-bg: rgba(15, 23, 42, 0.6);
    --disclaimer-bg: rgba(15, 23, 42, 0.4);
    --font-family: 'Outfit', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --input-bg: rgba(255, 255, 255, 0.9);
    --disclaimer-bg: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--gradient-1);
    top: -200px;
    left: -200px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--gradient-2);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Layout */
.calculator-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

header {
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        justify-content: center;
        text-align: center;
    }
    
    .header-text {
        text-align: center;
    }
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

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

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

input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.help-text {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

/* Results */
.result-card.primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

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

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

.monthly-breakdown {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.monthly-breakdown span {
    font-weight: 600;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.breakdown-item .label {
    color: var(--text-secondary);
}

.breakdown-item .value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.breakdown-item.deduction .value {
    color: var(--danger-color);
}

.breakdown-item.tax .value {
    color: #f59e0b;
}

.breakdown-item.subtotal {
    font-weight: 700;
    margin-top: 0.5rem;
}

.breakdown-item.info .value {
    color: #60a5fa;
}

hr {
    border: 0;
    height: 1px;
    background: var(--card-border);
    margin: 1rem 0;
}

/* Content Section (SEO & Explainer) */
.content-section {
    margin-top: 3rem;
    line-height: 1.6;
}

.content-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.content-section ul {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

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

/* Footer Disclaimer */
.disclaimer {
    text-align: center;
    max-width: 800px;
    margin: 2rem auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 1rem;
    background: var(--disclaimer-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.disclaimer strong {
    color: var(--danger-color);
}

/* Theme Toggle */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--card-border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-primary);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: white;
}
