/* ===================================
   Smart Repayment Calculator - Refined Design
   =================================== */

.repayment-calculator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.repayment-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.calc-controls-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    align-items: flex-start;
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--spacing-xl);
}

.slider-section {
    display: flex;
    flex-direction: column;
}

.slider-section label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.range-wrapper {
    position: relative;
    margin: 36px 0 12px;
}

input[type=range] {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    accent-color: var(--accent-primary);
    cursor: grab;
    padding: 0;
    border: none;
}

input[type=range]:active {
    cursor: grabbing;
}

.slider-value {
    position: absolute;
    top: -32px;
    right: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
}

.strategy-section {
    min-width: 200px;
}

.strategy-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.strategy-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.strategy-select:hover {
    border-color: var(--accent-primary);
}

.strategy-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Context Bar */
.calc-context-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-subtle);
    gap: var(--spacing-lg);
}

.context-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-right: var(--spacing-lg);
    border-right: 1px solid var(--border-subtle);
}

.context-item:last-child {
    border-right: none;
    padding-right: 0;
}

.context-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.context-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.context-item .value.highlight {
    color: var(--accent-primary);
}

.context-item .sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Payment Plan Section */
.payment-plan {
    margin-top: var(--spacing-lg);
}

.payment-plan h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--spacing-md);
}

/* Detailed Table */
.plan-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.plan-table {
    width: 100%;
    border-collapse: collapse;
}

.plan-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.plan-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--text-primary);
}

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

.plan-table tr:hover td {
    background: var(--bg-card-hover);
}

.highlight-row {
    background: var(--success-light) !important;
}

.plan-creditor {
    font-weight: 600;
    color: var(--text-primary);
}

.plan-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.plan-total {
    font-weight: 700;
    color: var(--text-primary);
}

.text-success {
    color: var(--success);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

/* Badges */
.payoff-badge {
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: inline-block;
}

.payoff-badge.good {
    color: var(--success);
    background: var(--success-light);
    border-color: transparent;
}

.payoff-badge.warning {
    color: var(--warning);
    background: var(--warning-light);
    border-color: transparent;
}

/* Action Button */
.action-btn-sm {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.action-btn-sm:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.action-btn-sm:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .calc-controls-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .calc-context-bar {
        grid-template-columns: 1fr;
    }

    .context-item {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding-right: 0;
        padding-bottom: var(--spacing-md);
    }

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