/* Debt Payoff Calculator Styles */

.debt-input-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.debt-input-group {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.input-group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.debts-list {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.debt-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debt-info {
    flex: 1;
}

.debt-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.15rem;
}

.debt-details {
    font-size: 0.85rem;
    color: var(--text-light);
}

.debt-remove-btn {
    padding: 0.5rem 1rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.debt-remove-btn:hover {
    background: var(--primary-dark);
}

.results-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
}

.results-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.15rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

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

.summary-card label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-value.success {
    color: var(--success-color);
}

.schedule-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.schedule-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.schedule-table {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.schedule-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.payment-table th {
    background: var(--border-color);
    color: var(--text-color);
    padding: 0.4rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
}

.payment-table td {
    padding: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.payment-table tbody tr:hover {
    background: var(--surface-color);
}

.payment-table tbody tr.payment-row {
    background: rgba(34, 197, 94, 0.05);
    border-left: 3px solid #22c55e;
}

.payment-table tbody tr.interest-row {
    background: rgba(168, 85, 247, 0.03);
    border-left: 3px solid transparent;
    opacity: 0.8;
}

.payment-table tbody tr.three-month-increment {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
    font-weight: 500;
}

.payment-table tbody tr.three-month-increment td {
    color: var(--text-color);
}

.schedule-table th {
    background: var(--border-color);
    color: var(--text-color);
    padding: 0.6rem;
    text-align: left;
    font-weight: 600;
}

.schedule-table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

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

.schedule-table tbody tr:hover {
    background: var(--surface-color);
}

.action-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.action-btn.secondary {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.action-btn.secondary:hover {
    background: #2563eb;
}

.tool-actions-horizontal {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.error-msg {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: var(--radius-md);
    color: #c33;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: none;
}

.error-msg.show {
    display: block;
}

.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.sidebar-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.sidebar-section p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section li {
    font-size: 0.9rem;
    padding: 0.5rem 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section li:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .debt-input-group {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        order: -1;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
html.dark-mode .error-msg {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}
