/* ============================================
   CONGO MEDIKA - DESIGN PROFESSIONNEL OPTIMISÉ
   Couleur principale: #8d3188 (Violet)
   Version: 6.0 - Performance optimisée
   ============================================ */

:root {
    --primary: #8d3188;
    --primary-dark: #6b2367;
    --primary-light: #c45ebe;
    --primary-soft: rgba(141, 49, 136, 0.15);
    --primary-glow: rgba(141, 49, 136, 0.25);
    --secondary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #111827;
    --gray-dark: #374151;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --gray-lighter: #e5e7eb;
    --light: #f9fafb;
    --white: #ffffff;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Optimisation des polices - chargement plus rapide */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Conteneur optimisé */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* ============================================
   HEADER - GÉRÉ PAR HEADER.PHP
   Les styles du header sont définis dans le fichier header.php
   pour éviter les conflits et les doublons.
   ============================================ */

/* Styles globaux pour le header (compléments) */
.header .btn {
    font-family: 'Inter', sans-serif;
}

/* Animation pour le dropdown */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== SECTIONS AVEC ARRIÈRE-PLANS FLOUTÉS OPTIMISÉS ========== */

/* Section Services */
.services-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(141, 49, 136, 0.05) 100%);
    overflow: hidden;
}

.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/medical-bg.jpg') center/cover no-repeat;
    filter: blur(8px);
    opacity: 0.12;
    z-index: 0;
}

.services-section .container {
    position: relative;
    z-index: 1;
}

/* Section Témoignages */
.testimonials-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.testimonials-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/patient-bg.jpg') center/cover no-repeat;
    filter: blur(8px);
    opacity: 0.15;
    z-index: 0;
}

.testimonials-section .container {
    position: relative;
    z-index: 1;
}

.testimonials-section .section-header h2,
.testimonials-section .section-header p {
    color: white;
}

.testimonials-section .testimonial-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Section CTA */
.cta-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/cta-bg.jpg') center/cover no-repeat;
    filter: blur(10px);
    opacity: 0.25;
    z-index: 0;
}

.cta-section .container {
    position: relative;
    z-index: 1;
}

/* ========== BOUTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-lighter);
    color: var(--gray-dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-outline-light {
    border: 1px solid white;
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary);
}

/* ========== SLIDER OPTIMISÉ ========== */
.hero-slider {
    position: relative;
    height: 80vh;
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
}

.slide-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 600px;
    padding: 0 2rem;
}

.slide-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.slide-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.slide-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Navigation slider */
.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--primary);
}

/* ========== SERVICES OPTIMISÉS ========== */
.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-lighter);
    box-shadow: var(--shadow);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.service-icon {
    width: 65px;
    height: 65px;
    background: var(--primary-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.service-icon i {
    font-size: 1.75rem;
    color: var(--primary);
}

/* ========== STATS OPTIMISÉS ========== */
.stats-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ========== TESTIMONIALS ========== */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* ========== SERVICES SPÉCIALISÉS ========== */
.specialties-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 4rem 0;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.specialty-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.specialty-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(141, 49, 136, 0.1);
}

.specialty-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.specialty-icon i {
    font-size: 1.6rem;
    color: white;
}

.specialty-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.specialty-card p {
    color: var(--gray);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.specialty-card .btn-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.specialty-card .btn-link:hover {
    color: var(--primary-dark);
}

.specialty-card .btn-link:hover i {
    transform: translateX(4px);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--dark);
    color: var(--gray-light);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-col p,
.footer-col a {
    color: var(--gray-light);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.8;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.social-links a {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    background: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.7rem;
}

/* ========== NOTIFICATIONS ========== */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
}

.badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 9px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* ========== RESPONSIVE OPTIMISÉ ========== */

/* Tablettes */
@media (max-width: 1024px) {
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-slider {
        height: 70vh;
        min-height: 450px;
    }
}

/* Mobile - POINTS CRITIQUES CORRIGÉS */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    /* ===== MENU MOBILE ===== */
    .menu-toggle {
        display: block;
        order: 2;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 0.5rem 1rem 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-lighter);
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        display: block;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-menu li {
        padding: 0.25rem 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 0.6rem 0.75rem;
        border-radius: 8px;
        font-size: 0.95rem;
    }
    
    .nav-menu a.active::after {
        display: none;
    }
    
    .nav-menu a.active {
        background: var(--primary-soft);
        color: var(--primary);
    }
    
    /* ===== BOUTONS MOBILE - CORRIGÉ ===== */
    .nav-buttons {
        order: 3;
        display: flex;
        gap: 0.5rem;
        flex: 0 0 auto;
    }
    
    .nav-buttons .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        border-radius: 6px;
        white-space: nowrap;
    }
    
    /* Bouton Inscription - TOUJOURS BLANC SUR VIOLET */
    .btn-register {
        background: var(--primary) !important;
        color: var(--white) !important;
        border: none !important;
    }
    
    .btn-register:hover {
        background: var(--primary-dark) !important;
    }
    
    /* Bouton Connexion - visible sur mobile */
    .btn-login {
        background: transparent;
        color: var(--gray-dark);
        border: 1px solid var(--gray-lighter);
    }
    
    .btn-login:hover {
        border-color: var(--primary);
        color: var(--primary);
    }
    
    /* ===== LOGO MOBILE ===== */
    .nav-brand {
        order: 1;
        flex: 1;
    }
    
    .nav-brand .logo {
        height: 38px;
    }
    
    .slogan {
        display: none;
    }
    
    /* ===== SLIDER MOBILE ===== */
    .hero-slider {
        height: 55vh;
        min-height: 350px;
    }
    
    .slide-content h1 {
        font-size: 1.6rem;
    }
    
    .slide-content p {
        font-size: 0.95rem;
    }
    
    .slide-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .slide-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* ===== GRID MOBILE ===== */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .specialties-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* ===== SECTION MOBILE ===== */
    .section {
        padding: 2.5rem 0;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    /* ===== FOOTER MOBILE ===== */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    /* ===== CTA MOBILE ===== */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    /* ===== CARTES MOBILE ===== */
    .service-card {
        padding: 1.25rem;
    }
    
    .specialty-card {
        padding: 1.25rem;
    }
    
    .testimonial-card {
        padding: 1.25rem;
    }
    
    /* ===== SWIPER NAVIGATION MOBILE ===== */
    .swiper-button-next,
    .swiper-button-prev {
        width: 36px;
        height: 36px;
    }
    
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 14px !important;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .nav-buttons .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .nav-brand .logo {
        height: 32px;
    }
    
    .hero-slider {
        height: 50vh;
        min-height: 300px;
    }
    
    .slide-content h1 {
        font-size: 1.3rem;
    }
    
    .slide-content p {
        font-size: 0.85rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

/* ========== PERFORMANCE - OPTIMISATIONS ========== */

/* Réduire les animations sur mobile pour meilleure performance */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Lazy loading des images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* Optimisation du scroll sur mobile */
.table-container {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* Empêcher le zoom des inputs sur iOS */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Contenu principal - priorité de rendu */
.main-content {
    contain: layout style paint;
}

/* Cache des ressources statiques */
.cached {
    will-change: transform;
}

/* ========== ALERTES ========== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   OPTIMISATIONS MOBILE - PERFORMANCE
   ============================================ */

/* Réduire les animations sur mobile */
@media (max-width: 768px) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Optimiser les images */
    img {
        max-width: 100%;
        height: auto;
        content-visibility: auto;
    }
    
    /* Réduire les ombres */
    .card, .stat-card, .medicament-card, .featured-card, .service-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    }
    
    /* Améliorer le touch */
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Empêcher le zoom des inputs sur iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Optimiser le scroll */
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Contenu principal - priorité de rendu */
    .main-content {
        contain: layout style paint;
    }
}

/* Lazy loading des images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}
img.lazy.loaded {
    opacity: 1;
}

/* Réduire les mouvements pour les personnes sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}