/* Variables et Reset */
:root {
    --primary-color: #00a0e3;
    --secondary-color: #ff6b00;
    --dark-color: var(--theme-dark);
    --light-color: var(--theme-light);
    --gray-color: var(--theme-gray);
    
    /* Theme Light (default) */
    --theme-dark: #333;
    --theme-light: #fff;
    --theme-gray: #f4f4f4;
    --theme-text: #333;
    --theme-bg: #fff;
    --theme-nav: rgba(255, 255, 255, 0.95);
    --theme-card: #fff;
    --theme-shadow: rgba(0, 0, 0, 0.1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --theme-dark: #fff;
    --theme-light: #1a1a1a;
    --theme-gray: #2a2a2a;
    --theme-text: #fff;
    --theme-bg: #121212;
    --theme-nav: rgba(18, 18, 18, 0.95);
    --theme-card: #1a1a1a;
    --theme-shadow: rgba(0, 0, 0, 0.3);
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 2rem;
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 34px;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
}

.slider i {
    color: var(--light-color);
    font-size: 14px;
    z-index: 1;
}

input:checked + .slider {
    background-color: var(--secondary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--theme-nav);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-links li a {
    color: var(--dark-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: left 0.3s ease;
}

.nav-links li a:hover::before {
    left: 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.7)), 
                url('https://boursenews.ma/uploads/actualites/5cc00da57d0ef.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Pour un effet parallaxe */
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--light-color);
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(0,160,227,0.5), 
        rgba(255,107,0,0.5)
    );
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-weight: 800;
    letter-spacing: 2px;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    font-weight: 400;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary-color);
    color: var(--light-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: bounce 2s infinite;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

.cta-button:hover::after {
    left: 100%;
}

/* Services Section */
.services {
    padding: 4rem 0;
    background: var(--gray-color);
}

.services h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: var(--theme-card);
    color: var(--theme-text);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 15px 30px var(--theme-shadow);
}

.service-image {
    height: 200px;
    overflow: hidden;
}

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

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

.service-content {
    padding: 1.5rem;
}

.service-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-details {
    list-style: none;
    margin-bottom: 1rem;
}

.service-details li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.service-details i {
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

.service-content p {
    color: var(--dark-color);
    font-size: 0.9rem;
    line-height: 1.6;
}

.service-card i {
    animation: float 3s ease-in-out infinite;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
}

.contact h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-item {
    text-align: center;
}

.info-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        background: var(--light-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -5px 0 10px rgba(0,0,0,0.1);
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .burger {
        display: block;
        cursor: pointer;
    }

    .burger div {
        width: 25px;
        height: 3px;
        background: var(--dark-color);
        margin: 5px;
        transition: all 0.3s ease;
    }

    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .toggle .line2 {
        opacity: 0;
    }

    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero h1 {
        font-size: 2rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }

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

    .service-image {
        height: 150px;
    }
}

@media (max-width: 1200px) {
    .nav-links {
        display: none;
    }

    .nav-links.nav-active {
        display: flex;
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 300px;
        gap: 2rem;
    }
}

/* Ajout des animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

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

@keyframes rotateIn {
    from { transform: rotate(-180deg) scale(0); opacity: 0; }
    to { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Style du formulaire de contact */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #eee;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Effet de flou sur le scroll */
.blur-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.blur-section.visible {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.8s ease forwards;
}

/* Section Réalisations */
.realisations {
    padding: 5rem 0;
    background: var(--light-color);
}

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

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: 300px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-image {
    width: 100%;
    height: 100%;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--light-color);
    transition: bottom 0.3s ease;
}

.project-card:hover .project-overlay {
    bottom: 0;
}

.project-card:hover img {
    transform: scale(1.1);
}

/* Section Avantages */
.avantages {
    padding: 5rem 0;
    background: var(--gray-color);
}

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

.advantage-card {
    text-align: center;
    padding: 2rem;
    background: var(--light-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.advantage-card:hover {
    transform: translateY(-10px);
}

.advantage-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.advantage-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255,255,255,0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.advantage-card:hover::after {
    animation: shine 1.5s ease-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* Section Témoignages */
.testimonials {
    padding: 5rem 0;
    background: var(--light-color);
}

.testimonial {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
    transition: all 0.5s ease;
}

.testimonial:hover {
    transform: scale(1.02);
}

.testimonial-content {
    position: relative;
    padding: 2rem;
}

.testimonial i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: rotateIn 1s ease-out;
}

.testimonial p {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 1rem;
}

/* Section Statistiques */
.stats {
    padding: 5rem 0;
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), 
                url('https://boursenews.ma/uploads/actualites/5cc00da57d0ef.jpg');
    background-size: cover;
    background-attachment: fixed;
    color: var(--light-color);
}

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

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--primary-color);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

/* Optimisations SEO */
h1, h2, h3 {
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Meta description pour le SEO */
head::after {
    content: "KASS-BTP - Entreprise leader en construction, travaux publics et hydraulique au Mali. Expertise en bâtiment, route et génie civil.";
    display: none;
}

/* Amélioration de la visibilité des sections */
section {
    opacity: 1 !important;
    filter: blur(0) !important;
    transform: translateY(0) !important;
}

/* Espacement entre les sections */
section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Amélioration des transitions */
.project-card,
.advantage-card,
.testimonial,
.stat-card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.project-card.visible,
.advantage-card.visible,
.testimonial.visible,
.stat-card.visible {
    opacity: 1;
    transform: translateY(0);
} 