:root {
    --primary: #3b82f6;
    --secondary: #1e40af;
    --accent: #10b981;
}

.dark {
    --primary: #60a5fa;
    --secondary: #93c5fd;
    --accent: #34d399;
}

.theme-transition {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Custom animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-camp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Shadow utilities */
.shadow-soft {
    box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
}

/* Styles pour le carrousel Hero */
.hero-carousel-container {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
}

.hero-carousel-track {
    display: flex;
    width: 300%; /* 3 slides */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-carousel-slide {
    flex: 0 0 33.333%;
}

.hero-carousel-prev,
.hero-carousel-next {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.hero-carousel-container:hover .hero-carousel-prev,
.hero-carousel-container:hover .hero-carousel-next {
    opacity: 1;
}

.hero-carousel-indicator.active {
    background-color: white;
    transform: scale(1.2);
}

/* ===== CORRECTIONS POUR LA SECTION ACCUEIL ===== */
/* Ajuster la hauteur du conteneur du carrousel */
.hero-carousel-container {
    margin-top: 1rem;
}

/* Amélioration des survols dans la section Services */
.services-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.services-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.services-card:hover::before {
    opacity: 1;
}

.services-card .service-content {
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
}

.services-card:hover .service-content {
    transform: translateY(-5px);
}

.services-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

/* Amélioration de la visibilité du texte au survol */
.services-card:hover h3 {
    color: var(--primary);
}

.services-card:hover p {
    color: var(--secondary);
}

.dark .services-card:hover h3 {
    color: var(--secondary);
}

.dark .services-card:hover p {
    color: var(--secondary);
}

.dark .services-card:hover li {
    color: white;
}

/*anah*/
.dark .services-card h3 {
    color: white;
}

.dark .services-card p {
    color: white;
}

.dark .services-card li {
    color: rgba(37, 211, 102, 0.7);
}

/* Animation de l'image de fond au survol */
.service-bg-image {
    transition: all 0.6s ease;
    filter: grayscale(100%) brightness(0.3);
}

.services-card:hover .service-bg-image {
    filter: grayscale(0%) brightness(0.6);
    transform: scale(1.05);
}

/* WhatsApp button improvements */
.whatsapp-float {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
}

/* Services carousel styles */
.carousel-indicator.active {
    background-color: var(--primary);
}

.services-transition {
    transition: transform 0.5s ease-in-out;
}

/* Hide scrollbar for services carousel on mobile */
#servicesCarousel::-webkit-scrollbar {
    display: none;
}

#servicesCarousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #mobile-menu {
        position: absolute;
        width: 100%;
        left: 0;
        top: 100%;
    }
    
    /* Mobile optimizations */
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
    
    .py-20 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
    
    /* Stack buttons on mobile */
    .flex-wrap.gap-4 {
        flex-direction: column;
    }
    
    .flex-wrap.gap-4 a {
        text-align: center;
    }
    
    /* Services carousel mobile */
    #servicesCarousel {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    #servicesTrack {
        display: flex;
        scroll-snap-type: x mandatory;
    }
    
    #servicesTrack > div {
        flex: 0 0 85%;
        scroll-snap-align: start;
    }
    
    /* Hide navigation buttons on mobile */
    #prevBtn, #nextBtn {
        display: none;
    }
    
    /* Hero carousel mobile */
    .hero-carousel-prev,
    .hero-carousel-next {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    .hero-carousel-indicator {
        width: 8px;
        height: 8px;
    }
    
    /* Icônes responsive */
    .hero-icons-container {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        max-width: 90%;
    }
    
    /* Services carousel tablet */
    #servicesTrack > div {
        flex: 0 0 45%;
    }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
    #servicesTrack > div {
        flex: 0 0 33.333%;
    }
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Smooth animations */
.transition-all {
    transition: all 0.3s ease;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

::-webkit-scrollbar-thumb:hover {
    background: #a5a5a5;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loading animation for images */
img {
    transition: opacity 0.3s ease;
}

img[data-src] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Fade out animation */
.fade-out {
    animation: fadeOut 0.4s ease-in-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

.lock-scroll {
    overflow: hidden;
}

/* Responsive text sizes */
@media (max-width: 480px) {
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.375rem;
    }
    
    .text-xl {
        font-size: 1.25rem;
    }
    
    .text-lg {
        font-size: 1.125rem;
    }
    #themeSelect{
        display: none;
    }
    #langSelect{
        display: none;
    }
}

/* Touch-friendly button sizes */
@media (max-width: 768px) {
    button, 
    a[role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Improved spacing for mobile */
@media (max-width: 768px) {
    .space-y-4 > * + * {
        margin-top: 1rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1.5rem;
    }
    
    .space-y-8 > * + * {
        margin-top: 2rem;
    }
}

/* Thème sombre amélioré */
.dark .services-card {
    background: rgba(55, 65, 81, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.5);
}

.dark .services-card:hover {
    background: rgba(55, 65, 81, 0.95);
    border-color: var(--primary);
}

/* Placeholder pour les images manquantes */
.placeholder-bg {
    width: 100%;
    height: 12rem; /* h-48 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

@media (min-width: 640px) {
    .placeholder-bg {
        height: 16rem; /* sm:h-64 */
    }
}

/* ===== CORRECTIONS SPÉCIFIQUES ===== */
/* Icônes sous le carrousel */
.hero-icons-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Background images pour les services */
.service-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Amélioration de la visibilité des images de fond des services */
.services-card .service-content {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(2px);
}

.dark .services-card .service-content {
    background: transparent !important;
}

/* Ajouter ces styles à la fin du fichier */
.placeholder-bg {
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
}

.hero-carousel-slide .placeholder-bg {
    height: 12rem; /* h-48 */
}

@media (min-width: 640px) {
    .hero-carousel-slide .placeholder-bg {
        height: 16rem; /* sm:h-64 */
    }
}

/* Amélioration de l'affichage des images du carrousel */
.hero-carousel-slide img {
    transition: opacity 0.3s ease;
}

.hero-carousel-slide img:not([src]) {
    opacity: 0;
}

/* Style pour les indicateurs actifs */
.hero-carousel-indicator.bg-white {
    transform: scale(1.2);
}