/* ===== 1. styles.css - CORE & LAYOUT ===== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    color: white;
    padding: 30px;
    text-align: center;
}

/* Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab-button {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    position: relative;
}

.tab-button.active {
    color: #667eea;
    background: white;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Common Components */
.step-section {
    background: #f8f9ff;
    margin-bottom: 30px;
    border-radius: 15px;
    border: 2px solid #e3e8ff;
    overflow: hidden;
}

.step-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.step-total {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.total-value {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Input Components */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Progress & Results */
.progress-bar {
    background: #e2e8f0;
    height: 25px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffa726, #4facfe);
    transition: width 0.8s ease;
    border-radius: 12px;
}

.progress-text {
    text-align: center;
    color: #64748b;
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.insights {
    background: #fefce8;
    border: 2px solid #fde047;
    padding: 25px;
    border-radius: 12px;
}

.insights h3 {
    color: #ca8a04;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.insights.warning {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: #dc2626;
}

.insights.success {
    background: #f0fdf4;
    border: 2px solid #86efac;
    color: #166534;
}


/* Main Content Grid for Health Tab */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Tab Content Padding */
.tab-content {
    padding: 30px;
}

/* Result Section for Health */
.result-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Input Section for Health */
.input-section {
    background: #f8f9ff;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #e3e8ff;
}

.input-section h2 {
    margin-bottom: 20px;
    color: #374151;
    font-size: 1.5rem;
}


/* Utilities */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 15px;
    }
}


/* ===== REAL-TIME UI IMPROVEMENTS ===== */

/* Health subtitle */
.health-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

/* Optional field indicator */
.optional {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: normal;
    font-style: italic;
}

/* Input hint text */
.input-hint {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.3;
}

/* Real-time note in finance */
.realtime-note {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 15px;
    text-align: center;
}

.realtime-note p {
    margin: 0;
    color: #667eea;
    font-size: 0.9rem;
    font-style: italic;
}

/* Results section - always visible improvements */
.results-section {
    padding: 30px;
    background: #f8f9ff;
    border-radius: 15px;
    border: 2px solid #e3e8ff;
    margin-top: 30px;
    /* Remove display: none - always show */
}

/* Default state styling */
.result-main {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #64748b;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.5s ease;
}

.result-main.has-data {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.result-main.warning {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
}

.result-main.success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

/* Remove calculate button styles */
.calculate-section {
    display: none;
}

/* Enhanced input focus states for real-time feedback */
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Loading state for inputs */
.input-group input.calculating {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

/* Real-time validation states */
.input-group input.valid {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.input-group input.invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Smooth transitions for all dynamic content */
.result-number,
.result-label,
.detail-value,
.progress-fill {
    transition: all 0.3s ease;
}

/* Animation for number changes */
@keyframes numberUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.result-number.updating {
    animation: numberUpdate 0.3s ease;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .realtime-note {
        padding: 10px 12px;
    }
    
    .realtime-note p {
        font-size: 0.8rem;
    }
    
    .health-subtitle {
        font-size: 0.85rem;
    }
}