/* Fichier de styles principal pour le site web */

:root {
    --primary-color: #008C3A;
    --primary-dark: #006c2d;
    --primary-light: #00a945;
    --text-color: #333333;
    --background-light: #f5f5f5;
    --white: #ffffff;
    --transition-speed: 0.3s;
    --transition-timing: ease;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    --container-padding: clamp(1rem, 5vw, 2rem);
    --card-width: clamp(250px, 25vw, 280px);
}

/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 100%;
    overflow-x: hidden; /* Empêche le débordement horizontal */
}

/* Header et Navigation */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

img {
    max-width: 100%;
    height: auto;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content:space-between;
    align-items: center;
}

nav img {
    height: 50px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
}

nav ul a {
    position: relative;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all var(--transition-speed) var(--transition-timing);
}

nav ul a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: all var(--transition-speed) var(--transition-timing);
}

nav ul a:hover::after {
    width: 100%;
}

/* Styles pour les sous-menus */
nav ul li {
    position: relative;
}

nav ul ul {
    display:none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 250px;
    box-shadow: var(--box-shadow);
    border-radius: 5px;
    padding: 0.5rem 0;
    flex-direction: column;
    gap: 0;
    z-index: 1000;
}

nav ul li:hover > ul {
    display: block;
}

nav ul ul li {
    padding: 0;
}

nav ul ul a {
    padding: 0.7rem 1.5rem;
    display: block;
    font-weight: normal;
    font-size: 0.95rem;
    white-space: nowrap;
}

nav ul ul a:hover {
    background-color: rgba(0, 140, 58, 0.1);
}


/* Sections principales */
main {
    margin-top: 80px;
}

section {
    padding: 4rem 2rem;
}

#accueil {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/locaux/Locaux.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
    padding: 9rem 2rem;
}

#accueil h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#accueil h2 {
    font-size: 2rem;
}

/* Section Spécialités */
#specialite {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

#specialite div {
    position: relative;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

#specialite div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    z-index: 1;
    transition: all var(--transition-speed) var(--transition-timing);
}

#specialite div:hover::before {
    background: linear-gradient(rgba(0,140,58,0.8), rgba(0,140,58,0.95));
}

.specialite-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-speed) var(--transition-timing);
}

#specialite div:hover .specialite-img {
    transform: scale(1.1);
}

#specialite div h2 {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    color: var(--white);
    z-index: 2;
    transition: all var(--transition-speed) var(--transition-timing);
    font-size: 2rem;
}

#specialite div p {
    position: absolute;
    top: 50%;
    left: 2rem;
    right: 2rem;
    transform: translateY(100%);
    opacity: 0;
    color: var(--white);
    z-index: 2;
    transition: all var(--transition-speed) var(--transition-timing);
    line-height: 1.8;
}

#specialite div:hover h2 {
    bottom: 75%;
    font-size: 1.8rem;
}

#specialite div:hover p {
    transform: translateY(-50%);
    opacity: 1;
    padding-top: 1.5rem;
}

#specialite div strong {
    color: var(--white);
}

/* Section Contact */
#contact {
    background-color: var(--background-light);
    position: relative;
    padding: 6rem 2rem;
}

#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,140,58,0.1) 0%, rgba(0,140,58,0.05) 100%);
    z-index: 1;
}

#contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    z-index: 2;
}

#contact h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 1rem auto;
}

/* Container principal pour la disposition en 2 colonnes */
#contact .contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    position: relative;
    z-index: 2;
    align-items: stretch;
}

/* Coordonnées */
#contact .coordonnees {
    background-color: var(--primary-color);
    padding: 2.5rem;
    border-radius: 10px;
    color: var(--white);
    box-shadow: var(--box-shadow);
}

#contact .coordonnees h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

#contact .coordonnees h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--white);
}

#contact .coordonnees p {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Ajout des styles pour les icônes SVG */
#contact .coordonnees p svg {
    width: 20px;
    height: 20px;
    min-width: 20px;  /* Pour éviter que l'icône ne se compresse */
    stroke: currentColor;
}

#contact .coordonnees a {
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 0.25rem 0;
}

#contact .coordonnees a:hover {
    opacity: 0.8;
    transform: translateX(2px);
}

#contact .coordonnees a:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Styles pour les horaires */
#contact .coordonnees .horaires {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#contact .coordonnees .horaires h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--white);
    font-weight: 600;
}

/* Container pour la carte */
#contact .map-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
}

#contact .map-container #map {
    height: 100%;
    min-height: 450px;
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    position: relative;
}

/* Crédits de la carte */
#contact .map-credit {
    text-align: center;
    margin: 0;
    opacity: 0.8;
}

#contact .map-credit small {
    font-size: 0.8rem;
    color: var(--text-color);
}

#contact .map-credit a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

#contact .map-credit a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

#contact .map-container #map #zoom-message {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translate(-50%);
    background-color: rgba(55, 55, 55, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    display: block;
    transition: opacity 0.3s ease;
}

/* Formulaire */
#contactForm {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

#contactForm div {
    margin-bottom: 1.5rem;
}

#contactForm input,
#contactForm textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: all var(--transition-speed) var(--transition-timing);
    background-color: #f8f8f8;
}

#contactForm input:focus,
#contactForm textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,140,58,0.1);
    background-color: var(--white);
}

#contactForm textarea {
    min-height: 200px;
    font-family: 'Arial', sans-serif;
    resize: none;
    
}

#contactForm button {
    position: relative;
    overflow: hidden;
    z-index: 1;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease;
    width: 100%;
}

#contactForm button:hover {
    transform: translateY(-2px);
}

#contactForm button:active {
    transform: translateY(0);
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
    border-top: 3px solid var(--primary-color);
}

/* Optimiser les transitions */
nav a, .specialite-img, #specialite div div::before {
    transition: all var(--transition-speed) var(--transition-timing);
}

/* Utiliser la variable pour les box-shadows */
#contactForm, #contact .coordonnees {
    box-shadow: var(--box-shadow);
}

/* Bouton retour en haut */
#scrollToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;  /* Caché par défaut */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
}

#scrollToTop:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#scrollToTop.visible {
    display: flex;
}

/* Section Hero */
#hero {
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
}

.hero-electronique {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/menus/Electronique.jpg');
}

.hero-electrotechnique {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/menus/Electrotechnique.jpg');
}

.hero-automatisme {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/menus/Automatisme.jpg');
}

.hero-about {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/locaux/Locaux.jpg');
}

#hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#hero p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--white);
}

/* Sections de Services */
.service-section {
    padding: 6rem 2rem;
}

.service-section:nth-child(even) {
    background-color: var(--background-light);
}

.service-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    align-items: center;
}

.service-content.reverse {
    direction: rtl;
}

.service-content.reverse .service-text {
    direction: ltr;
}

.service-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    position: relative;
}

.service-text h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.service-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-text ul {
    list-style: none;
    padding: 0;
}

.service-text ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.service-text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.service-image {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.service-image:hover img {
    transform: scale(1.05);
}

/* Sections Index */
.index-section {
    padding: 6rem 8rem;
}

.index-section:nth-child(even) {
    background-color: var(--background-light);
}


/* Sections About */
.about-section {
    padding: 6rem 8rem;
}

.about-section:nth-child(even) {
    background-color: var(--background-light);
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.about-text h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 10px;
}

/* Timeline */
.timeline {
    margin-top: 3rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--primary-color);
}

.year {
    font-weight: bold;
    color: var(--primary-color);
    text-align: right;
}

.event h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 3rem auto 0;
}

.team-member {
    text-align: center;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-photo {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.role {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Partners Section */
.partners-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}

.partners-carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.partners-carousel {
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
}

.partners-track {
    display: flex;
    gap: 30px;
    transition: transform 0.5s ease;
    justify-content: center;
    align-items: center;

}

.partner {
    flex: 0 0 300px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.partner a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.partner img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.partner:hover {
    transform: translateY(-5px);
}

.partner:hover img {
    transform: scale(1.1);
}

/* Boutons du carousel */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: var(--box-shadow);
}

.carousel-arrow:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    left: 0;
}

.carousel-arrow.next {
    right: 0;
}


/* Style de l'organigramme */
.org-chart {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.org-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}



.page-transition {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-out;
}

/* Transitions de sortie */
.page-transition.fade-out-to-left {
    opacity: 0;
    transform: translateX(-20px);
}

.page-transition.fade-out-to-right {
    opacity: 0;
    transform: translateX(20px);
}

/* Transition d'entrée */
.page-transition.fade-in {
    opacity: 0;
    transform: translateX(0);
}

/* Transitions spécifiques pour l'entrée selon la direction */
.page-transition.fade-in-from-left {
    opacity: 0;
    transform: translateX(-20px);
}

.page-transition.fade-in-from-right {
    opacity: 0;
    transform: translateX(20px);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem var(--container-padding);
    text-align: center;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2rem);
    margin-top: 2rem;
    flex-wrap: wrap;  /* Permet le retour à la ligne sur petits écrans */
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    font-size: 1.5rem;
}

.services-container {
    display: flex;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: 2rem var(--container-padding);
    max-width: 100%;
    margin: 0 auto;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    justify-content: center;
}

.services-container::-webkit-scrollbar {
    display: none; /* Pour Chrome, Safari et Opera */
}

.service-card {
    flex: 0 0 var(--card-width);
    padding: clamp(1rem, 2vw, 1.5rem);
    background: var(--white);
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.2) rotate(360deg);
    transition: transform 0.5s ease;
}

.service-card h3 {
    position: relative;
    margin-bottom: 1rem;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.service-card:hover h3 {
    transform: translateY(-5px);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.service-card:hover p {
    opacity: 1;
}

/* Ajustement pour le conteneur parent */
#services-grid {
    position: relative;
    padding: 0;
    margin: 2rem 0;
    overflow: hidden;
}

/* Ajustement des dégradés */
#services-grid::before,
#services-grid::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 1;
    pointer-events: none;
}

#services-grid::before {
    left: 0;
    background: linear-gradient(to right, var(--background-light) 0%, rgba(255,255,255,0) 100%);
}

#services-grid::after {
    right: 0;
    background: linear-gradient(to left, var(--background-light) 0%, rgba(255,255,255,0) 100%);
}


/* Ajustements pour les images */
.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;  /* Maintient un ratio constant */
}

/* Contact section responsive */
#contact > div {
    grid-template-columns: 1fr;  /* Une colonne sur mobile */
    max-width: min(1200px, 90%);
    gap: 2rem;
}

/* Map responsive - style général supprimé pour éviter les conflits */

/* Styles pour les footers avec liens légaux */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--white);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-links a:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Version responsive pour footer */
@media (max-width: 768px) {
    .footer-content {
        text-align: center;
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .footer-content p {
        font-size: 0.85rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links a {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Paragraphe des spécialités */
.specialites-intro {
    text-align: center;
    margin: 3rem auto;
    max-width: 800px;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
    grid-column: 1 / -1;
    width: 100%;
}