:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #2c3e50;
    --muted-color: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Custom Background Gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-icon {
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

/* Strategy Cards */
.strategy-card {
    border: none;
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.strategy-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.strategy-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: white;
}

.strategy-icon.standard {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.strategy-icon.snowball {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.strategy-icon.avalanche {
    background: linear-gradient(135deg, #45b7d1, #3498db);
}

/* Step Cards */
.step-card {
    padding: 2rem;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto;
}

/* Benefits Section */
.benefit-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Debt Form Styles */
.debt-item {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.debt-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow);
}

.debt-item.active {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 144, 220, 0.25);
}

.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.debt-number {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.remove-debt {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.remove-debt:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Form Controls */
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 144, 220, 0.25);
}

.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 144, 220, 0.25);
}

/* Result Cards */
.strategy-result-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.strategy-result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.result-metric {
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.savings-badge {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    display: inline-block;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-icon {
        font-size: 4rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .debt-item {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .strategy-card,
    .step-card,
    .debt-item {
        border: 2px solid var(--text-color);
    }
    
    .bg-gradient-primary {
        background: var(--primary-color);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Emergency modal force close - can be triggered from browser console */
.modal.force-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.modal-backdrop.force-hidden {
    display: none !important;
    opacity: 0 !important;
}

body.force-modal-reset {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Additional modal debugging styles */
.modal.debug-visible {
    background-color: rgba(255, 0, 0, 0.3) !important;
    border: 3px solid red !important;
}

.modal-backdrop.debug-visible {
    background-color: rgba(0, 255, 0, 0.3) !important;
}
