/* ===================================
   Prévention Cardiovasculaire - CSS Modernisé
   =================================== */

:root {
    /* Couleurs */
    --primary: #c41e3a;
    --primary-dark: #8b1429;
    --blue: #2563eb;
    --green: #059669;
    --orange: #ea580c;
    
    /* Risques */
    --risk-low: #10b981;
    --risk-moderate: #f59e0b;
    --risk-high: #ef4444;
    --risk-very-high: #991b1b;
    
    /* Gris */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --spacing: 1rem;
    --radius: 0.75rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.install-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation */
.nav-tabs {
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    overflow-x: auto;
    position: sticky;
    top: 88px;
    z-index: 999;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tab-btn i {
    font-size: 1.25rem;
}

.tab-btn:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-header h2 i {
    color: var(--primary);
}

.subtitle {
    color: var(--gray-600);
    margin-top: 0.5rem;
}

.info-message {
    background: var(--gray-100);
    border-left: 4px solid var(--blue);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-message i {
    font-size: 1.5rem;
    color: var(--blue);
}

/* Factors Menu */
.factors-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.factor-tab {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.factor-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.factor-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

/* Factor Content */
#facteurs-content {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.factor-section {
    display: none;
}

.factor-section.active {
    display: block;
    animation: fadeIn 0.3s;
}

.factor-header {
    border-bottom: 3px solid var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.factor-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.factor-header h3 i {
    color: var(--primary);
}

/* Algorithme */
.algo-container {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem 0;
}

.algo-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.algo-step {
    background: white;
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.algo-step:hover {
    transform: translateX(4px);
}

.algo-step-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: 700;
    margin-right: 0.5rem;
}

.algo-step h4 {
    display: inline;
    font-size: 1.125rem;
}

.algo-step-content {
    margin-top: 1rem;
    padding-left: 40px;
}

.algo-step-content ul {
    list-style: none;
}

.algo-step-content li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.algo-step-content li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Objectives */
.objectives-box {
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid var(--blue);
}

.objectives-box h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.objective-item {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.objective-label {
    font-weight: 600;
    color: var(--gray-700);
}

.objective-value {
    font-weight: 700;
    color: var(--blue);
    font-size: 1.125rem;
}

/* Visual Schema */
.visual-schema {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem 0;
}

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

.schema-item {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.schema-item:hover {
    background: var(--gray-100);
    transform: translateY(-4px);
}

.schema-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.schema-item h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.schema-item p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Table */
.interactive-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.interactive-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.interactive-table thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.interactive-table th,
.interactive-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.interactive-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.interactive-table tbody tr:hover {
    background: var(--gray-50);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.low { background: var(--risk-low); color: white; }
.badge.moderate { background: var(--risk-moderate); color: white; }
.badge.high { background: var(--risk-high); color: white; }
.badge.very-high { background: var(--risk-very-high); color: white; }

/* Alert */
.alert-box {
    border-left: 4px solid;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-box.info {
    background: #dbeafe;
    border-color: var(--blue);
    color: #1e40af;
}

.alert-box.warning {
    background: #fef3c7;
    border-color: var(--orange);
    color: #92400e;
}

.alert-box i {
    font-size: 1.5rem;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

.disclaimer {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    
    .factors-menu {
        flex-direction: column;
    }
    
    .factor-tab {
        width: 100%;
    }
    
    .schema-grid {
        grid-template-columns: 1fr;
    }
}