/* ==========================================================================
   Interactive Calculator Tools Stylesheet (BMI, EMI, Age)
   ========================================================================== */

.calc-wrapper {
    padding: 2.5rem 0 3.5rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2.25rem;
    align-items: start;
    margin-bottom: 3.5rem;
}

.calc-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

.calc-result-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    position: sticky;
    top: 92px;
}

/* Range Slider Styles */
.slider-group {
    margin-bottom: 1.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
}

.slider-val-box {
    display: inline-flex;
    align-items: center;
    background: var(--bg-muted);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
}

.slider-input-num {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    width: 110px;
    text-align: right;
    outline: none;
}

.slider-unit {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.35rem;
}

.range-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0.75rem 0 0.25rem;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-min-max {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Unit Toggle Pills */
.unit-toggle {
    display: inline-flex;
    background: var(--bg-muted);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.unit-btn {
    padding: 0.45rem 1.15rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Radio Cards (Gender, Loan Type) */
.radio-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.radio-card {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.radio-card:hover {
    border-color: var(--primary);
}

.radio-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.radio-card i {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
    display: block;
}

.radio-card span {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Result Displays */
.result-stat-highlight {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid #bfdbfe;
    margin-bottom: 1.5rem;
}

.result-stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.result-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    font-family: inherit;
}

.result-stat-category {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* BMI Spectrum Bar */
.bmi-spectrum-bar {
    width: 100%;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(to right, 
        #3b82f6 0%, #3b82f6 20%, 
        #10b981 20%, #10b981 48%, 
        #f59e0b 48%, #f59e0b 70%, 
        #ef4444 70%, #ef4444 100%
    );
    position: relative;
    margin: 1.75rem 0 1.25rem;
}

.bmi-marker {
    position: absolute;
    top: -8px;
    width: 6px;
    height: 30px;
    background: #0f172a;
    border: 2px solid #ffffff;
    border-radius: 3px;
    transform: translateX(-50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: left 0.3s ease;
}

.bmi-spectrum-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Data Table Summary */
.summary-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.summary-data-table td {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.925rem;
}

.summary-data-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--secondary);
}

.summary-data-table tr:last-child td {
    border-bottom: none;
}

/* Donut Chart Canvas Container */
.chart-box-container {
    max-width: 220px;
    margin: 1.25rem auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Age Stats Detailed Grid */
.age-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.85rem;
    margin: 1.5rem 0;
}

.age-stat-card {
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.age-stat-num {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.age-stat-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 0.2rem;
}

/* Amortization Table */
.amort-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.amort-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: right;
}

.amort-table th {
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: right;
}

.amort-table th:first-child,
.amort-table td:first-child {
    text-align: left;
}

.amort-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.amort-table tr:nth-child(even) {
    background-color: var(--bg-main);
}

@media (max-width: 992px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
    .calc-result-card {
        position: static;
        order: -1;
    }
}

