/* Tax Calculation Tool Specific Styles */

/* Tax Breakdown Display */
.tax-breakdown {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid #e2e8f0;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.breakdown-table th,
.breakdown-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.breakdown-table th {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.breakdown-table td {
    font-size: 14px;
    color: #475569;
}

.breakdown-table .amount {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.breakdown-table .total-row {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-top: 2px solid #2563eb;
}

.breakdown-table .total-row td {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
}

.exemption-options {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.exemption-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.exemption-item:hover {
    border-color: #2563eb;
    background: #f1f5f9;
}

.exemption-item input[type="checkbox"] {
    display: none;
}

.exemption-item input[type="checkbox"]:checked + .checkmark {
    background: #2563eb;
    border-color: #2563eb;
}

.exemption-item input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.exemption-item:has(input[type="checkbox"]:checked) {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.exemption-item .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.exemption-item .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.exemption-details {
    flex: 1;
}

.exemption-details strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.exemption-details span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.tax-breakdown {
    text-align: center;
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
    border-radius: 8px;
}

.tax-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.tax-item {
    text-align: center;
}

.tax-label {
    font-size: 12px;
    color: #0c4a6e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tax-value {
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
    font-family: 'Roboto Mono', monospace;
}

.breakdown-table {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.breakdown-table table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    background: white;
}

.breakdown-table th,
.breakdown-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.breakdown-table th {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-table tr:nth-child(even) {
    background: #f8fafc;
}

.breakdown-table tr:hover {
    background: #f1f5f9;
}

.breakdown-table .item-name {
    font-weight: 500;
    color: #1e293b;
}

.breakdown-table .amount {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    text-align: right;
}

.breakdown-table .subtotal-row {
    background: #f1f5f9 !important;
    font-weight: 600;
    border-top: 2px solid #e2e8f0;
}

.breakdown-table .total-row {
    background: #2563eb !important;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.breakdown-table .total-row td {
    border-bottom: none;
}

.tax-analysis {
    margin: 24px 0;
}

.tax-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.tax-detail-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.tax-detail-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.tax-detail-card.state-tax {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #f1f5f9);
}

.tax-detail-card.local-tax {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.tax-detail-card.exemption {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.tax-detail-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tax-detail-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
}

.tax-detail-card.state-tax .tax-detail-value {
    color: #2563eb;
}

.tax-detail-card.local-tax .tax-detail-value {
    color: #10b981;
}

.tax-detail-card.exemption .tax-detail-value {
    color: #f59e0b;
}

.tax-detail-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.state-comparison {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.comparison-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.comparison-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.comparison-item.current-state {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.comparison-state {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.comparison-rate {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 4px;
    font-family: 'Roboto Mono', monospace;
}

.comparison-item.current-state .comparison-rate {
    color: #10b981;
}

.comparison-total {
    font-size: 12px;
    color: #64748b;
    font-family: 'Roboto Mono', monospace;
}

.tax-info {
    space-y: 16px;
}

.info-item {
    padding: 16px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #2563eb;
}

.info-item strong {
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.info-item p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.exemption-list {
    space-y: 12px;
}

.exemption-category {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    gap: 8px;
}

.category-name {
    font-weight: 600;
    color: #2563eb;
    font-size: 13px;
    flex-shrink: 0;
}

.category-details {
    color: #64748b;
    font-size: 12px;
    text-align: right;
    line-height: 1.3;
}

/* Primary result styling */
.primary-result .result-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tax-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tax-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .breakdown-table {
        font-size: 14px;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .tax-details {
        grid-template-columns: 1fr;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .tax-summary {
        grid-template-columns: 1fr;
    }
    
    .exemption-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .category-details {
        text-align: left;
    }
}

/* Animation for total reveal */
@keyframes totalReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.primary-result.animate .result-value {
    animation: totalReveal 0.6s ease-out;
}

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

.breakdown-table.loading::after {
    content: "Calculating taxes...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
}
