/* ========================================= */
/* 1. Variables CSS et Réinitialisation     */
/* ========================================= */

:root {
    /* Couleurs */
    --primary-color: #002D62;          /* Bleu foncé Kyvatech */
    --secondary-color: #2ECC71;        /* Vert électrique */
    --text-color: #333;                /* Texte principal */
    --light-text-color: #f4f4f4;       /* Texte clair sur fond sombre */
    --background-dark: rgba(0, 45, 98, 0.9);
    --background-light: rgba(255, 255, 255, 0.95);
    --background-dark-footer: rgba(34, 34, 34, 0.95);
    --hover-green: #28a745;
    --hover-blue: #001f40;

    /* Typographie */
    --font-family-montserrat: 'Montserrat', sans-serif;
    --heading-font-weight: 700;
    --body-font-weight: 400;

    /* Espacements */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 40px;
    --spacing-xl: 80px;

    /* Transitions */
    --transition-duration: 0.3s;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #002D62;
}

.hero-section, .main-header, .services-section, .why-kyvatech-section, .main-footer {
    position: relative;
    z-index: 1;
}

.main-header { background-color: rgba(255, 255, 255, 0.9); }
.services-section { background-color: rgba(255, 255, 255, 0.8); }
.why-kyvatech-section { background-color: rgba(0, 45, 98, 0.9); }
.main-footer { background-color: rgba(34, 34, 34, 0.9); }

/* Basic Reset & Typography */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-family-montserrat);
    line-height: 1.6;
    color: var(--text-color);
    background-color: transparent;
    position: relative;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    box-sizing: border-box;
    width: 100%;
}

h1, h2, h3 {
    color: var(--primary-color);
    font-weight: var(--heading-font-weight);
    margin-bottom: var(--spacing-md);
}

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

/* ========================================= */
/* 2. Boutons                               */
/* ========================================= */

.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 5px;
    transition: background-color var(--transition-duration) ease, transform var(--transition-duration) ease;
    font-weight: 600;
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--hover-green);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: var(--hover-blue);
    transform: translateY(-2px);
}

/* ========================================= */
/* 3. En-tête (Header)                      */
/* ========================================= */

.main-header {
    background-color: var(--background-light);
    padding: var(--spacing-md) 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img:first-child {
    height: 45px;
    display: block;
}

.logo img:last-child {
    height: 35px;
    margin-left: 10px;
    display: block;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav ul li {
    margin-left: var(--spacing-md);
}

.main-nav ul li a {
    color: var(--text-color);
    font-weight: 600;
    padding: var(--spacing-xs) 0;
    position: relative;
    transition: color var(--transition-duration) ease;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    left: 0;
    bottom: -5px;
    transition: width var(--transition-duration) ease;
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 11;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================= */
/* 4. Section principale (Hero)             */
/* ========================================= */

.hero-section {
    position: relative;
    height: 60vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-lg);
}

.hero-content h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: var(--spacing-md);
    color: white;
    text-shadow: 0 14px 8px rgba(0,0,0,0.4);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: var(--spacing-lg);
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================= */
/* 5. Services Section                      */
/* ========================================= */

.services-section {
    padding: var(--spacing-xl) 0 0 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.95), rgba(255, 255, 255, 0.9));
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.08), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(46, 204, 113, 0.08), transparent 50%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    pointer-events: none;
    z-index: 1;
}

.services-section > * {
    position: relative;
    z-index: 2;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.services-section h2 {
    font-size: 2em;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.service-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: var(--spacing-xl);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(46, 204, 113, 0.1);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.service-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

.service-item:nth-child(1) { animation-delay: 0.1s; }
.service-item:nth-child(2) { animation-delay: 0.2s; }
.service-item:nth-child(3) { animation-delay: 0.3s; }
.service-item:nth-child(4) { animation-delay: 0.4s; }
.service-item:nth-child(5) { animation-delay: 0.5s; }
.service-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-item:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 8px 30px rgba(0,0,0,0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.service-item img {
    height: 80px;
    margin-bottom: var(--spacing-lg);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.service-item:hover img {
    transform: scale(1.1) rotate(5deg);
}

.service-item h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.4em;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.service-item p {
    line-height: 1.6;
    color: #555;
    font-size: 1.05em;
}

/* ========================================= */
/* 6. Pourquoi Kyvatech Section             */
/* ========================================= */

.why-kyvatech-section {
    background-color: var(--background-dark);
    color: white;
    padding: var(--spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.why-kyvatech-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 45, 98, 0.95) 0%, rgba(0, 35, 80, 0.9) 100%);
    z-index: 0;
}

.why-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.why-text {
    flex: 2;
    animation: slideInLeft 0.8s ease-out 0.3s both;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.why-text h2 {
    color: white;
    margin-bottom: var(--spacing-lg);
    font-size: 1.7em;
    position: relative;
}

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

.why-text ul li {
    margin-bottom: var(--spacing-md);
    font-size: 1.2em;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
    position: relative;
}

.why-text ul li:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(10px);
}

.why-text ul li::before {
    content: "✓";
    color: var(--secondary-color);
    font-weight: bold;
    margin-right: var(--spacing-sm);
    font-size: 1.2em;
}

.why-text .highlight {
    font-weight: var(--heading-font-weight);
    color: var(--secondary-color);
}

.contact-form-simple {
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    padding: var(--spacing-xl);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.8s ease-out 0.5s both;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.contact-form-simple h3 {
    color: white;
    margin-bottom: var(--spacing-lg);
    font-size: 1.8em;
    text-align: center;
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.contact-form-simple h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 2px;
}

.contact-form-simple form input,
.contact-form-simple form textarea {
    width: 100%;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-sizing: border-box;
    max-width: 100%;
    font-size: 1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.contact-form-simple form input:focus,
.contact-form-simple form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
    transform: translateY(-2px);
}

.contact-form-simple form input::placeholder,
.contact-form-simple form input::placeholder,
.contact-form-simple form textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95em;
}

.contact-form-simple form button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    width: 100%;
}

.contact-form-simple form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.contact-form-simple form button:active {
    transform: translateY(-1px);
}

.contact-form-simple form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.contact-form-simple form button:hover::before {
    left: 100%;
}

/* ========================================= */
/* 7. Section Partenaires                   */
/* ========================================= */
.partners-section {
    padding: 0 0 var(--spacing-xl) 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.9), rgba(255, 255, 255, 0.95));
    position: relative;
}

.partners-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 70% 20%, rgba(52, 152, 219, 0.08), transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(46, 204, 113, 0.08), transparent 50%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    pointer-events: none;
    z-index: 1;
}

.partners-section > * {
    position: relative;
    z-index: 2;
}

.partners-section h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out;
}

.partners-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: slideInUp 0.8s ease-out 0.3s both;
}

.partner-tile {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: var(--spacing-xl);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.partner-logo {
    transition: transform 0.3s ease;
}

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

.partner-logo img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all var(--transition-duration) ease;
    border-radius: 8px;
}

.partner-logo img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* ========================================= */
/* 8. Pied de page (Footer)                 */
/* ========================================= */

.main-footer {
    background: linear-gradient(135deg, var(--background-dark-footer), #1a252f);
    color: var(--light-text-color);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(52, 152, 219, 0.1), transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(46, 204, 113, 0.1), transparent 50%);
    pointer-events: none;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    position: relative;
    z-index: 2;
}

.footer-logo img {
    height: 40px;
    transition: transform 0.3s ease;
}

.footer-logo img:hover {
    transform: scale(1.1);
}

.footer-contact {
    min-width: 180px;
}

.footer-contact h4 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.footer-contact p {
    margin-bottom: var(--spacing-xs);
    font-size: 0.9em;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================= */
/* 9. Responsivité (Media Queries)          */
/* ========================================= */

@media (max-width: 768px) {
    /* Amélioration du conteneur pour les petits écrans */
    .container {
        padding: 0 var(--spacing-sm);
        max-width: 100%;
    }
    
    /* Cache le logo texte et affiche le logo principal plus petit */
    .logo img:first-child {
        height: 35px;
        display: block;
    }
    
    .logo img:last-child {
        display: none;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.95);
        transition: right var(--transition-duration) ease-in-out;
        padding-top: 100px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
    }

    .main-nav.open {
        right: 0;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .main-nav ul li {
        margin: var(--spacing-md) 0;
        width: 100%;
        text-align: center;
    }

    .main-nav ul li a {
        font-size: 1.2em;
        padding: var(--spacing-sm) 0;
        display: block;
        width: 100%;
    }

    .main-nav ul li a::after {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .btn-contact {
        display: none;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .services-section, .partners-section, .why-kyvatech-section {
        padding: var(--spacing-lg) 0;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .why-content {
        flex-direction: column;
        align-items: center; /* Ajouté pour centrer les éléments enfants */
    }

    .contact-form-simple {
        width: 100%;
        max-width: 400px; /* Ajouté pour limiter la largeur sur les écrans plus grands */
        margin: 0 auto; /* Permet de centrer horizontalement */
        margin-top: var(--spacing-md);
        box-sizing: border-box;
        padding: var(--spacing-md);
    }

    .partners-section .container {
        padding: 0 var(--spacing-sm);
    }
    
    .partner-tile {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .partner-logo img {
        max-height: 60px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-contact, .social-media {
        align-items: center;
    }
}

/* Media query pour les très petits écrans */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .hero-content h1 {
        font-size: 1.8em;
        padding: 0 var(--spacing-xs);
    }
    
    .service-item {
        padding: var(--spacing-md);
        margin: 0 var(--spacing-xs);
    }
    
    .contact-form-simple {
        padding: var(--spacing-sm);
    }
    
    .partner-tile {
        padding: var(--spacing-sm);
    }
}

@media (min-width: 769px) {
    .logo img:first-child {
        height: 45px;
        display: block;
    }

    .logo img:last-child {
        height: 35px;
        margin-left: 10px;
        display: block;
    }

    .menu-toggle {
        display: none;
    }

    .main-nav {
        display: block;
        position: static;
        width: auto;
        height: auto;
        padding-top: 0;
        box-shadow: none;
    }
}