:root {
    --bs-primary: #0d6efd;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
}

[data-bs-theme="dark"] {
    --bs-primary: #6ea8fe;
    --bs-success: #75b798;
    --bs-info: #6edff6;
    --bs-warning: #ffda6a;
    --bs-danger: #ea868f;
    --bs-light: #495057;
    --bs-dark: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    transition: all 0.3s ease;
}

/* Card enhancements */
.card {
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
}

/* Form styling */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

.input-group-text {
    border: 2px solid #e9ecef;
    border-radius: 8px 0 0 8px;
    background-color: #f8f9fa;
    font-weight: 500;
}

/* Button styling */
.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Navigation pills */
.nav-pills .nav-link {
    border-radius: 8px;
    margin-right: 8px;
    font-weight: 500;
    color: var(--bs-gray-600);
    transition: all 0.3s ease;
}

.nav-pills .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

/* Results cards */
.card.bg-success, .card.bg-primary, .card.bg-info, .card.bg-warning {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.card.bg-warning {
    color: #000 !important;
}

/* Tax breakdown styling */
.card-body .row .col-6 .d-flex {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-body .row .col-6:last-child .d-flex,
.card-body .row .col-12 .d-flex {
    border-bottom: none;
}

/* Dark mode specific styles */
[data-bs-theme="dark"] {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] body {
    background-color: #212529 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .container {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] .row {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .card {
    background-color: #2b2b2b;
    color: #ffffff;
    border-color: #555;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #3b3b3b;
    border-color: #555;
    color: #ffffff;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #555;
    border-color: #555;
    color: #ffffff;
}

[data-bs-theme="dark"] .navbar-light {
    background-color: #2b2b2b !important;
    border-color: #555 !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-brand {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #2b2b2b !important;
}

/* Dark mode ad sections */
[data-bs-theme="dark"] .text-center {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .adsbygoogle {
    background-color: #2b2b2b !important;
    border-radius: 8px;
    padding: 10px;
}

/* Dark mode text colors */
[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .lead {
    color: #e9ecef !important;
}

/* Feature highlights dark mode */
[data-bs-theme="dark"] .text-center .col-md-3 small {
    background-color: rgba(108, 117, 125, 0.2) !important;
    color: #e9ecef !important;
}

/* Ensure all sections have proper dark mode background */
[data-bs-theme="dark"] html {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] main {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] footer {
    background-color: #2b2b2b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] footer .text-muted {
    color: #adb5bd !important;
}

/* Fix ad section backgrounds in dark mode */
[data-bs-theme="dark"] .row > .col-12 > .text-center {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] .row {
    background-color: #212529 !important;
}

/* Header section dark mode */
[data-bs-theme="dark"] header {
    background-color: #212529 !important;
}

/* Section backgrounds */
[data-bs-theme="dark"] section {
    background-color: #212529 !important;
}

/* Mobile layout optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .nav-pills {
        flex-wrap: wrap;
        margin-bottom: 1rem !important;
    }
    
    .nav-pills .nav-link {
        margin-right: 4px;
        margin-bottom: 8px;
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* Optimize header for mobile */
    .h2.mb-3 {
        margin-bottom: 1rem !important;
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Compact feature highlights */
    .text-center .col-md-3.col-6.mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .text-center .col-md-3 small {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom checkbox styling */
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Footer styling */
footer {
    margin-top: auto;
}

[data-bs-theme="dark"] footer.bg-light {
    background-color: #2b2b2b !important;
    border-color: #555 !important;
}

/* Accessibility improvements */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* SEO Content styling */
.lead {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.6;
}

/* Feature highlights */
.text-center .col-md-3 small {
    font-size: 0.875rem;
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: rgba(13, 110, 253, 0.05);
}

[data-bs-theme="dark"] .text-center .col-md-3 small {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Google Ads styling */
.adsbygoogle {
    display: block;
    margin: 20px auto;
    max-width: 100%;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .adsbygoogle {
        margin: 10px auto;
    }
    
    /* Reduce vertical gaps on mobile */
    .row.mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .row.my-4 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .row.mt-5 {
        margin-top: 2rem !important;
    }
    
    .row.mt-4 {
        margin-top: 1.5rem !important;
    }
    
    /* Reduce header spacing */
    header.text-center.mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Reduce feature highlights spacing */
    .text-center .row.mt-4.mb-3 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Reduce card spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Reduce section spacing */
    section.row.mt-5 {
        margin-top: 2rem !important;
    }
}

/* Print styles */
@media print {
    .navbar, footer, #theme-toggle, .adsbygoogle {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
