/**
 * Tax Deduction Calculator CSS
 * Styling for the Tax Deduction Calculator page
 */

/* Base styling for calculator */
.tax-deduction-calculator {
    font-family: 'Inter', 'Roboto', sans-serif;
}

/* Form styling */
.calculator-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transition: all 0.3s ease;
}

.dark .calculator-form {
    background: #1f2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.calculator-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.calculator-header h2 {
    color: #16a34a;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dark .calculator-header h2 {
    color: #4ade80;
}

.calculator-header p {
    color: #64748b;
    font-size: 0.95rem;
}

.dark .calculator-header p {
    color: #cbd5e1;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
}

.dark .input-group label {
    color: #f3f4f6;
}

.input-group input[type="number"],
.input-group input[type="date"],
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    color: #1e293b;
    transition: border-color 0.2s ease;
}

.dark .input-group input[type="number"],
.dark .input-group input[type="date"],
.dark .input-group select {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.input-group input[type="number"]:focus,
.input-group input[type="date"]:focus,
.input-group select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.input-group p.text-sm {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #64748b;
}

.dark .input-group p.text-sm {
    color: #9ca3af;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.slider-container {
    margin-top: 0.5rem;
}

.slider-container input[type="range"] {
    width: 100%;
    margin-top: 0.5rem;
}

/* Radio buttons styling */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.radio-button {
    position: relative;
}

.radio-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-button label {
    display: block;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
}

.dark .radio-button label {
    background-color: #374151;
    color: #cbd5e1;
}

.radio-button input[type="radio"]:checked + label {
    background-color: #16a34a;
    color: white;
}

.dark .radio-button input[type="radio"]:checked + label {
    background-color: #15803d;
}

.radio-button input[type="radio"]:focus + label {
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.3);
}

/* Deduction section styling */
.deduction-section {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.deduction-section h3 {
    margin-bottom: 1rem;
}

.deduction-section .text-sm {
    font-size: 0.875rem;
}

/* Checkbox styling */
.flex.items-center {
    display: flex;
    align-items: center;
}

.flex.items-center input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    accent-color: #16a34a;
}

.dark .flex.items-center input[type="checkbox"] {
    accent-color: #15803d;
}

/* Form button */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: #16a34a;
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1.5rem;
}

.dark button[type="submit"] {
    background-color: #15803d;
}

button[type="submit"]:hover {
    background-color: #15803d;
}

.dark button[type="submit"]:hover {
    background-color: #166534;
}

/* Results section styling */
.results-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    height: 100%;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dark .results-section {
    background: #1f2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.results-section.active {
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-heading {
    margin-bottom: 1.5rem;
    text-align: center;
}

.results-heading h3 {
    color: #16a34a;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dark .results-heading h3 {
    color: #4ade80;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .result-card {
    background-color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.result-card.highlight {
    background-color: #ecfdf5;
    border-left: 4px solid #16a34a;
}

.dark .result-card.highlight {
    background-color: #064e3b;
    border-left: 4px solid #10b981;
}

.result-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
}

.dark .result-card h4 {
    color: #cbd5e1;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.dark .result-value {
    color: #f3f4f6;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: #16a34a;
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}

.dark .action-button {
    background-color: #15803d;
}

.action-button i {
    margin-right: 0.5rem;
}

.action-button.secondary {
    background-color: #64748b;
}

.dark .action-button.secondary {
    background-color: #4b5563;
}

.action-button:hover {
    background-color: #15803d;
}

.action-button.secondary:hover {
    background-color: #475569;
}

.dark .action-button:hover {
    background-color: #166534;
}

.dark .action-button.secondary:hover {
    background-color: #374151;
}

/* Chart section styling */
.chart-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    width: 100%;
    overflow: hidden;
}

.dark .chart-section {
    background: #1f2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.chart-section h3 {
    color: #16a34a;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.dark .chart-section h3 {
    color: #4ade80;
}

.chart-container {
    position: relative;
    height: 300px;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Fix for responsive charts */
canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Breakdown section styling */
.breakdown-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.dark .breakdown-section {
    background: #1f2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.breakdown-section h3 {
    color: #16a34a;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.dark .breakdown-section h3 {
    color: #4ade80;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown-table th,
.breakdown-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.dark .breakdown-table th,
.dark .breakdown-table td {
    border-bottom: 1px solid #374151;
}

.breakdown-table th {
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
}

.dark .breakdown-table th {
    color: #e2e8f0;
    background-color: #2d3748;
}

.breakdown-table tr:last-child td {
    border-bottom: none;
}

/* Hidden state */
.hidden {
    display: none;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 640px) {
    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .calculator-form,
    .results-section,
    .chart-section,
    .breakdown-section {
        padding: 1.5rem;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Animation keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section.active,
.chart-section,
.breakdown-section {
    animation: slideIn 0.5s ease forwards;
} 