/* ===== HEALTH.CSS - FIXED VERSION ===== */

/* ===== HEALTH TAB LAYOUT ===== */
.health-tab-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

/* ===== HEALTH INPUT SECTION ===== */
.health-input-section {
    background: #f8f9ff;
    padding: 25px 30px;
    border-radius: 15px;
    border: 2px solid #e3e8ff;
    margin-bottom: 25px;
}

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

/* ===== REUSE SHARED INPUT GRID FROM FINANCE ===== */
/* These classes should match finance.css exactly */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px 20px;
    margin-bottom: 20px;
}

.input-grid-4col {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.input-grid-3col {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.input-grid-2col {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.input-group {
    margin-bottom: 0;
}

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

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

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

/* Calculate Button for Health */
.health-calculate-btn {
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    display: block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

/* ===== HEALTH RESULTS SECTION ===== */
.health-results-section {
    background: white;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
    padding: 25px;
    margin-bottom: 25px;
}

/* Health Metrics Grid - Compact */
.health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.health-metric {
    background: #f8fafc;
    padding: 18px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
}

.health-metric:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.1);
    background: white;
}

.health-metric h4 {
    color: #374151;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.health-value {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1;
    color: #1e293b;
}

.health-value small {
    font-size: 0.9rem;
    font-weight: 400;
    color: #64748b;
    margin-left: 4px;
}

.health-status {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Enhanced Status Colors */
.status-excellent { 
    background: linear-gradient(135deg, #dcfce7, #bbf7d0); 
    color: #15803d; 
    border: 1px solid #22c55e;
}

.status-good { 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); 
    color: #1d4ed8; 
    border: 1px solid #3b82f6;
}

.status-average { 
    background: linear-gradient(135deg, #fef3c7, #fde68a); 
    color: #b45309; 
    border: 1px solid #f59e0b;
}

.status-poor { 
    background: linear-gradient(135deg, #fee2e2, #fecaca); 
    color: #dc2626; 
    border: 1px solid #ef4444;
}

/* ===== HEALTH DETAILS SECTION ===== */
.health-details {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.health-details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.health-details .detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.health-details .detail-label {
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
}

.health-details .detail-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

/* ===== HEALTH PROGRESS & INSIGHTS ===== */
.health-progress-section {
    margin-top: 20px;
}

.health-progress-bar {
    background: #e2e8f0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

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

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

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

.health-insights.warning {
    background: #fef2f2;
    border: 2px solid #fca5a5;
}

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

.health-insights h3 {
    color: #ca8a04;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.health-insights.warning h3 {
    color: #dc2626;
}

.health-insights.success h3 {
    color: #166534;
}

.health-insights p {
    color: #713f12;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

.health-insights.warning p {
    color: #dc2626;
}

.health-insights.success p {
    color: #166534;
}

/* ===== ERROR MESSAGE ===== */
.health-error-message {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    margin: 20px 0;
}

.text-center {
    text-align: center;
    padding: 30px 20px;
    color: #64748b;
    font-size: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .input-grid-4col {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .health-metrics {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .input-grid,
    .input-grid-4col,
    .input-grid-3col {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px 15px;
    }
    
    .input-grid-2col {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .health-tab-content {
        padding: 20px;
    }
    
    .health-input-section {
        padding: 20px;
    }
    
    .health-results-section {
        padding: 20px;
    }
    
    .health-metrics {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }
    
    .health-metric {
        padding: 15px;
    }
    
    .health-value {
        font-size: 1.8rem;
    }
    
    .health-details {
        padding: 15px;
    }

    .input-grid,
    .input-grid-4col,
    .input-grid-3col,
    .input-grid-2col {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px 12px;
    }
}

@media (max-width: 480px) {
    .health-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .health-metric {
        padding: 12px;
    }
    
    .health-value {
        font-size: 1.6rem;
    }

    .input-grid,
    .input-grid-4col,
    .input-grid-3col,
    .input-grid-2col {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .health-input-section {
        padding: 15px;
    }
}