/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* --- CSS Variables for Professional Theme --- */
:root {
    --primary-color: #007bff; /* Un bleu professionnel et confiant */
    --primary-color-dark: #0056b3;
    --secondary-color: #f8f9fa; /* Fond clair et propre */
    --text-color: #343a40; /* Gris foncé pour le texte */
    --heading-color: #003366; /* Bleu marine pour les titres */
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: #ffffff;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--primary-color-dark);
}

ul {
    list-style: none;
}

h1, h2, h3 {
    color: var(--heading-color);
    font-weight: 600;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--secondary-color);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    gap: 2rem;
}

.logo-container {
    flex-shrink: 0; /* Prevents the logo from shrinking */
    flex-basis: auto;
}

.logo {
    height: 50px; /* Adjust the height as needed */
    width: auto;
}

header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* SOS Médecin dans le header */
.header-title {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.sos-medecin {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    background: none;
    -webkit-text-fill-color: var(--primary-color);
}

nav#main-nav {
    flex-shrink: 0;
}

header nav ul {
    display: flex;
    gap: 2rem;
}

header nav a {
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

header nav a:hover, header nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Hamburger Menu --- */
.menu-toggle-button {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    order: 2; /* Assure que le menu hamburger reste à droite */
}

.hamburger-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--heading-color);
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--heading-color);
    transition: transform 0.3s ease;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    bottom: -8px;
}

.menu-toggle-button.is-active .hamburger-icon {
    background-color: transparent;
}
.menu-toggle-button.is-active .hamburger-icon::before {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle-button.is-active .hamburger-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}


/* --- Hero Section --- */
#hero {
    background-image: linear-gradient(rgba(0, 86, 179, 0.7), rgba(0, 51, 102, 0.8)), url('../images/stuff.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
    color: white;
    text-align: center;
    padding: 8rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-brand {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 3px 6px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    width: 100%;
}

.hero-brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    padding: 8px;
    object-fit: contain;
}

#hero h2 {
    font-size: 2.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    opacity: 0.95;
}

#hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    background-color: #e63946 !important; /* Rouge pour l'attention */
    color: white !important;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    animation: shake-animation 3s infinite;
    text-decoration: none;
}

.cta-button:hover {
    background-color: #d62828 !important; /* Rouge plus foncé au survol */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* --- Quick Contact Buttons --- */
.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.quick-contact-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-contact-btn {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.quick-contact-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.quick-contact-btn .icon {
    font-size: 1.2rem;
}

.quick-contact-btn img.icon {
    width: 20px;
    height: 20px;
}


/* --- Services Preview Section --- */
#services-preview {
    padding: 4rem 5%;
    text-align: center;
    background-color: var(--secondary-color);
}

#services-preview h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
}

.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 75px; /* Increased space for 150px icons */
}

/* Updated service card styles */
.service-card {
    background: #ffffff;
    padding: 4rem 1.5rem 2.5rem 1.5rem; /* Increased top padding for icon space */
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    text-align: center;
    position: relative; /* Needed for absolute icon positioning */
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.service-icon {
    /* New size and overflowing style */
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    border: 5px solid white;
    box-shadow: var(--box-shadow);
    padding: 25px;
    object-fit: scale-down;

    /* Positioning */
    position: absolute;
    top: -75px; /* Half of new height to overflow */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
}

.service-card h4 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Generic Container & Page Header --- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

#page-header {
    background-color: var(--secondary-color);
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

#page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* --- About Page Specific Styles --- */
#about-content {
    padding: 4rem 0;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.mission-image img {
    width: 100%;
    max-height: 225px !important; /* Drastically reduced size as requested */
    height: auto;
    object-fit: cover; /* Prevents image distortion */
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.values-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.value-card {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary-color);
}

.value-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}

/* --- Services Page Specific Styles --- */
#services-list {
    padding: 4rem 0;
}

.service-detail-card {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    background: #ffffff;
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-bottom: 3.5rem;
    box-shadow: var(--box-shadow);
    border-top: 5px solid var(--primary-color);
    padding-top: 180px; /* Espace pour la très grande icône */
}

.service-icon-large {
    /* COPIE EXACTE de service-icon mais EN ÉNORME */
    width: 200px !important;
    height: 200px !important;
    border-radius: 50% !important;
    background-color: var(--secondary-color) !important;
    border: 6px solid white !important;
    box-shadow: var(--box-shadow) !important;
    padding: 30px !important;
    object-fit: scale-down !important;
    
    /* Positioning IDENTIQUE à service-icon */
    position: absolute !important;
    top: -100px !important; /* Débordement énorme */
    left: 50% !important;
    transform: translateX(-50%) !important; /* Center horizontally */
    
    flex-shrink: 0;
    transition: transform 0.3s ease;
    display: block;
}

.service-icon-large:hover {
    transform: translateX(-50%) scale(1.05) !important;
}

.service-detail-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.service-detail-content p {
    margin-bottom: 1.5rem;
}

.service-detail-content ul {
    list-style: disc;
    padding-left: 20px;
}

.service-detail-content ul li {
    margin-bottom: 0.5rem;
}

/* Reverse layout for even cards */
.service-detail-card:nth-child(even) {
    flex-direction: row-reverse;
}

/* --- Contact Page Specific Styles --- */
#contact-content {
    padding: 4rem 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.contact-form h3, .contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.contact-form .cta-button {
    width: 100%;
    border: none;
    cursor: pointer;
}

.contact-info {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.contact-info ul {
    list-style: none;
    padding: 0;
}

.contact-info li {
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.contact-info a {
    color: var(--text-color);
}
.contact-info a:hover {
    color: var(--primary-color);
}

#map {
    width: 100%;
    height: 250px;
    background-color: #e9ecef;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

/* --- Animation Classes --- */
.service-card, .value-card, .service-detail-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframe animation for the call button */
@keyframes shake-animation {
  /* Quick shake for ~0.5s */
  0%, 17%, 100% { transform: translateX(0); }
  2% { transform: translateX(-5px); }
  4% { transform: translateX(5px); }
  6% { transform: translateX(-5px); }
  8% { transform: translateX(5px); }
  10% { transform: translateX(-5px); }
  12% { transform: translateX(5px); }
  14% { transform: translateX(-5px); }
  16% { transform: translateX(5px); }
  /* Pause for the rest of the duration */
}


/* --- Floating Action Buttons --- */
.floating-contact-buttons {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1001;
}

.fab {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all var(--transition-speed) ease;
    text-decoration: none;
}

.fab:hover {
    transform: scale(1.1);
    background-color: var(--primary-color-dark);
}

.fab.whatsapp {
    background-color: #25D366;
}
.fab.whatsapp:hover {
    background-color: #128C7E;
}

.fab img {
    width: 30px;
    height: 30px;
}

.fab .phone-icon {
    font-size: 26px;
}

/* --- App Promotion Section --- */
#app-promo {
    background-color: var(--secondary-color);
    padding: 4rem 0;
    margin-top: 2rem;
}

.app-promo-container {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.app-promo-text {
    flex: 1;
}

.app-promo-text h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.app-promo-text p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.app-download-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.app-store-btn img {
    height: 50px; /* Adjust size as needed */
    width: auto; /* Maintain aspect ratio */
    transition: transform var(--transition-speed) ease;
}

.app-store-btn:hover img {
    transform: scale(1.05);
}

.app-promo-image {
    flex: 1;
    text-align: center;
}

.app-promo-image img {
    max-width: 100%;
    height: auto;
    max-height: 400px; /* Limit image height */
}

/* --- Legal Content Page (Terms, Privacy) --- */
#legal-content {
    padding: 4rem 0;
    max-width: 800px; /* Narrower for better readability */
}

#legal-content h3 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#legal-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}


/* --- Footer --- */
footer {
    background-color: var(--heading-color);
    color: white;
    text-align: center;
    padding: 2rem 5%;
    margin-top: auto;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: #f8f9fa;
    margin: 0 10px;
    text-decoration: underline;
}

.footer-links a:hover {
    color: #ffffff;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        padding: 1rem 5%;
    }
    
    .menu-toggle-button {
        order: 1; /* Menu hamburger à gauche */
    }
    
    .logo-container {
        order: 2; /* Logo à droite */
    }
    
    .header-title {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: center; /* SOS MÉDECIN centré */
    }
    
    .sos-medecin {
        font-size: 1.8rem;
        letter-spacing: 2px;
        font-weight: 900;
        color: var(--primary-color);
    }
    
    nav#main-nav {
        order: 4;
    }

    /* --- Mobile Navigation --- */
    nav#main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(5px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.4s ease-in-out;
        display: flex;
    }

    nav#main-nav.mobile-menu-open {
        transform: translateY(0);
    }

    header nav ul {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
    }

    header nav a {
        font-size: 1.8rem;
    }

    .menu-toggle-button {
        display: block;
    }


    /* --- General Layout Adjustments --- */
    .hero-brand {
        font-size: 2.8rem;
        letter-spacing: 2px;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .hero-brand-logo {
        width: 50px;
        height: 50px;
        padding: 6px;
    }
    
    #hero h2 {
        font-size: 1.8rem;
    }

    #hero p {
        font-size: 1rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .app-promo-container {
        flex-direction: column;
        text-align: center;
    }

    .app-download-buttons {
        justify-content: center;
    }

    /* Stack multi-column layouts */
    .mission-section,
    .service-detail-card,
    .contact-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .service-detail-card {
        padding-top: 150px; /* Add space for the much bigger overflowing icon on mobile */
        align-items: center;
        padding: 2rem;
        margin-bottom: 3rem;
    }

    .service-detail-card:nth-child(even) {
        flex-direction: column; /* Ensure it stacks correctly */
    }

    .service-icon-large {
        /* MOBILE - ÉNORME comme service-icon */
        width: 180px !important;
        height: 180px !important;
        border-radius: 50% !important;
        background-color: var(--secondary-color) !important;
        border: 6px solid white !important;
        box-shadow: var(--box-shadow) !important;
        padding: 25px !important;
        object-fit: scale-down !important;
        
        /* Position ABSOLUE comme sur home */
        position: absolute !important;
        top: -90px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        
        align-self: center;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    /* Adjust font sizes for readability */
    h3 {
        font-size: 1.8rem;
    }
}
