/* 
   Société de Déménagement Casablanca 
   Animations pour la page À propos
*/

/* Fix pour le défilement horizontal */
* {
    max-width: 100%;
}

/* Exception pour les éléments qui doivent dépasser */
.dropdown-menu, .dropdown, .nav-item, .navbar, .header {
    max-width: none;
}

/* Animations générales */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation séquentielle pour les éléments */
.fade-in-sequence > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-sequence.visible > *:nth-child(1) {
    transition-delay: 0.1s;
}

.fade-in-sequence.visible > *:nth-child(2) {
    transition-delay: 0.3s;
}

.fade-in-sequence.visible > *:nth-child(3) {
    transition-delay: 0.5s;
}

.fade-in-sequence.visible > *:nth-child(4) {
    transition-delay: 0.7s;
}

.fade-in-sequence.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Animation pour les cartes et sections */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible,
.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Animation pour la timeline */
.timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation pour les compteurs */
.counter-item {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease;
}

.counter-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* Animation des barres de progression */
.progress-bar {
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* Style spécifique pour la page À propos */
html, body {
    overflow-x: hidden !important; /* Empêche strictement le défilement horizontal sur toute la page */
    width: 100% !important;
    position: relative;
    max-width: 100vw;
}

/* Fix pour le header dans la page À propos */
.header {
    overflow: visible !important; /* Crucial pour permettre aux dropdowns de s'afficher */
    width: 100% !important;
    position: sticky !important;
    z-index: 100 !important; /* Même z-index que dans style.css */
}

.about-hero {
    position: relative;
    background-image: url('../images/about-hero.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 120px 0;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

/* Style spécifique pour les cartes de valeurs */
.bg-light {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.bg-light .services-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.bg-light .service-card {
    height: auto; /* Annule la hauteur fixe des service-card habituelles */
    min-height: 280px; /* Définit une hauteur minimale */
    padding-top: 20px; /* Ajoute un padding en haut */
    width: 100%;
    box-sizing: border-box;
}

.about-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.about-hero .container {
    position: relative;
    z-index: 2;
}

.about-hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.about-hero p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Timeline histoire de l'entreprise */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-container {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: var(--white);
    border: 4px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--light-color);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--light-color);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--light-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--light-color) transparent transparent;
}

.right::after {
    left: -16px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--light-color);
    position: relative;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-content .date {
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 15px;
    display: block;
}

/* Section compteurs */
.counter-section {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    width: 100%;
    overflow-x: hidden; /* Empêche le défilement horizontal spécifiquement pour cette section */
}

.counter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box; /* S'assure que le padding est inclus dans la largeur */
    width: 100%;
}

.counter-item {
    padding: 20px;
}

.counter-item .counter {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.counter-item i {
    font-size: 36px;
    margin-bottom: 15px;
    display: block;
}

.counter-item h4 {
    font-size: 18px;
    margin: 0;
}

/* Section équipe */
.team-section {
    padding: 80px 0;
    width: 100%;
    overflow-x: hidden; /* Empêche le défilement horizontal */
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 0 15px;
    box-sizing: border-box;
    width: 100%;
}

.team-member {
    text-align: center;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-member:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.member-image {
    height: 250px;
    overflow: hidden;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-member:hover .member-image img {
    transform: scale(1.1);
}

.member-info {
    padding: 20px;
}

.member-info h3 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.member-info .position {
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: block;
}

.member-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.member-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--light-color);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.member-social a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Correction pour le menu dropdown dans la page à propos */
/* Version desktop */
@media screen and (min-width: 769px) {
    /* Permettre le débordement du header et navbar */
    .header, .navbar, .nav-item, .nav-menu, .dropdown {
        overflow: visible !important;
    }
    
    /* Styles identiques au style.css principal pour le dropdown */
    .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        background-color: var(--white) !important;
        width: 220px !important; /* Exactement comme dans style.css */
        box-shadow: var(--shadow) !important;
        border-radius: 4px !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(10px) !important;
        transition: var(--transition) !important;
        z-index: 99 !important;
        padding: 10px 0 !important;
        display: block !important; /* S'assurer que le menu est présent dans le DOM */
    }
    
    .dropdown:hover .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
    
    .dropdown-menu li {
        padding: 0 !important;
    }
    
    .dropdown-menu a {
        padding: 10px 20px;
        display: block;
        color: var(--primary-color);
        transition: var(--transition);
    }
    
    .dropdown-menu a:hover {
        background-color: var(--primary-color) !important;
        color: var(--white);
    }
}

/* Version mobile - exactement comme dans style.css */
@media screen and (max-width: 768px) {
    .dropdown-menu {
        position: static !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        display: none !important;
    }
    
    .dropdown.active .dropdown-menu {
        display: block !important;
        margin-top: 10px !important; 
        position: static !important;
        max-height: 300px !important;
        text-align: left !important; /* Alignement du texte à gauche pour une meilleure lisibilité */
    }
}

/* Responsive pour timeline et autres sections */
@media screen and (max-width: 768px) {
    /* Règles générales strictes pour empêcher le défilement horizontal */
    .section, section {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        overflow-x: hidden !important;
    }
    
    .timeline {
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
        overflow-x: hidden;
        position: relative;
    }
    
    /* Amélioration du positionnement des cercles de la timeline */
    .timeline-container::after {
        width: 20px;
        height: 20px;
        border-width: 2px;
        top: 18px;
        position: absolute;
        background-color: white;
        border-radius: 50%;
        z-index: 5; /* Augmenter le z-index pour s'assurer que le cercle est visible */
        border-color: var(--primary-color);
        border-style: solid;
        box-sizing: border-box;
    }
    
    .timeline::after {
        left: 21px; /* Redéfini pour un alignement parfait */
        width: 4px; /* Largeur réduite pour plus de précision */
    }
    
    .timeline-container {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        box-sizing: border-box;
        max-width: calc(100% - 15px);
    }
    
    .timeline-container::before {
        left: 60px;
        border: medium solid var(--light-color);
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--light-color) transparent transparent;
    }

    .left::after, .right::after {
        left: 11px; /* Réajusté avec précision pour aligner parfaitement les cercles */
    }

    .right {
        left: 0%;
    }
    
    /* Amélioration de l'alignement en version mobile */
    .timeline-container {
        margin-bottom: 30px; /* Espace vertical entre les éléments */
        position: relative; /* Assure que les positions absolues fonctionnent correctement */
    }
    
    .timeline-content {
        width: 100%;
        box-sizing: border-box;
        margin-left: 20px; /* Ajuste légèrement le positionnement par rapport aux cercles */
    }
    
    /* Fix supplémentaire pour l'alignement des cercles */
    .timeline {
        padding-top: 20px; /* Ajoute un peu d'espace au début de la timeline */
        padding-bottom: 20px; /* Ajoute un peu d'espace à la fin de la timeline */
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix spécifique pour éviter tout débordement */
    img, video {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix spécifique pour le logo en version mobile */
    .logo .logo-img {
        max-width: 200px !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
    }
}
.logo-img {
    max-width: 200px; /* Ajustez la taille maximale de l'image du logo */
    height: auto; /* Assurez-vous que la hauteur s'ajuste automatiquement */
    display: block;
    margin: 0 auto; /* Centrer le logo */
}