/* Tools Pages Styles - Enhanced */
.tools-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.tools-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.tools-header h1 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tools-header p {
    margin: 10px 0 0;
    opacity: 0.9;
    font-size: 0.8rem;
}

.tools-body {
    padding: 1.5rem;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 10px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.period-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.period-btn.active {
    background: white;
    color: var(--secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.period-btn:hover:not(.active) {
    background: #e2e8f0;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
}

.salary-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: 'Inter', monospace;
    text-align: right;
}

.salary-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.currency-prefix {
    position: relative;
}

.currency-prefix input {
    padding-left: 55px;
    text-align: right;
}

.currency-prefix::before {
    content: "KES";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
    z-index: 1;
}

/* Toggle Switches */
.toggle-group {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
}

.toggle-switch:last-child {
    margin-bottom: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: all 0.3s;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--secondary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.summary-card {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border);
}

.summary-label {
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Inter', monospace;
}

.net-card {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.net-value {
    color: #059669;
    font-size: 1.1rem;
}

/* Calculation Table */
.calculation-table {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-label {
    font-size: 0.8rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    font-family: 'Inter', monospace;
}

.deduction-row {
    background: #f1f5f9;
    font-weight: 600;
}

.sub-row {
    padding-left: 30px;
    background: #ffffff;
}

.sub-row .calc-label {
    font-size: 0.75rem;
    color: #64748b;
}

.tax-row {
    background: #fff7ed;
}

.relief-row {
    background: #fef3c7;
}

.total-tax-row {
    background: #fee2e2;
}

.total-tax-row .calc-label,
.total-tax-row .calc-amount {
    color: #dc2626;
    font-weight: 700;
}

.net-row {
    background: #ecfdf5;
}

.net-amount {
    color: #059669;
    font-size: 1rem;
    font-weight: 800;
}

/* Tax Bands Info */
.tax-bands-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e0f2fe;
    border-radius: 8px;
    font-size: 0.7rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Year Selector */
.year-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.year-select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem;
    background: #e0f2fe;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #0369a1;
}

.loading-indicator .spin {
    animation: spin 1s linear infinite;
}

/* FAQ Section Styles */
.faq-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.faq-section h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-item {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.faq-answer {
    color: #475569;
    line-height: 1.6;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 1rem;
    }
    
    .faq-question {
        font-size: 0.85rem;
    }
    
    .faq-answer {
        font-size: 0.8rem;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .tools-body {
        padding: 1rem;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .calc-label {
        font-size: 0.7rem;
    }
    
    .calc-amount {
        font-size: 0.75rem;
    }
    
    .sub-row {
        padding-left: 20px;
    }
    
    .toggle-label {
        font-size: 0.7rem;
    }
}