/* Variables pour les couleurs principales */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #121212;
    --text-color: #333;
    --text-light: #fff;
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-dark: 0 15px 40px rgba(0, 0, 0, 0.3);
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
    --transition-slow: 0.8s ease;
}

/* Réinitialisation et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Styles pour le header */
#header {
    background: var(--primary-color);
    transition: all var(--transition-fast);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

#header.scrolled {
    background: rgba(44, 62, 80, 0.95);
    padding: 10px 0;
    box-shadow: var(--shadow-medium);
}

.navbar-brand img {
    height: 50px;
    transition: all var(--transition-fast);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    position: relative;
    transition: all var(--transition-fast);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--secondary-color);
}

.navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: all var(--transition-fast);
    transform: translateX(-50%);
}

.navbar-dark .navbar-nav .nav-link:hover::after {
    width: 70%;
}

/* Section Héro avec animations avancées */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
    padding: 150px 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/images/pattern.svg');
    opacity: 0.05;
    z-index: 0;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(5%) translateY(5%); }
    100% { transform: translateX(0) translateY(0); }
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    margin-bottom: 2rem;
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
}

.hero-section p {
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.8s;
}

@keyframes fadeInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation flèche de scroll */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-20px) translateX(-50%); }
    60% { transform: translateY(-10px) translateX(-50%); }
}

/* Services section */
.service-card {
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-medium);
    height: 100%;
    background: white;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transform: translateY(20px);
    opacity: 0;
}

.service-card.aos-animate {
    transform: translateY(0);
    opacity: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-medium);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-medium);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    transition: all var(--transition-medium);
}

.service-card:hover .service-icon {
    transform: scale(1.2);
    color: var(--accent-color);
}

.price-tag {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    margin: 1rem 0;
    transition: all var(--transition-fast);
}

.service-card:hover .price-tag {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.5);
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.service-features li {
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.service-features li::before {
    content: '✓';
    color: var(--secondary-color);
    margin-right: 10px;
    font-weight: bold;
}

.service-features li:last-child {
    border-bottom: none;
}

.btn-primary {
    background: var(--secondary-color);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.4);
}

/* Compétences section */
.skill-card {
    border: none;
    transition: all var(--transition-medium);
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: var(--shadow-light);
    border-radius: 15px;
    padding: 2rem;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.skill-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(transparent, rgba(52, 152, 219, 0.05));
    transition: all var(--transition-medium);
    z-index: -1;
}

.skill-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: var(--shadow-medium);
}

.skill-card:hover::after {
    height: 100%;
}

.skill-card i {
    transition: all var(--transition-medium);
}

.skill-card:hover i {
    transform: scale(1.3) rotate(5deg);
}

.skill-card h5 {
    margin-top: 1rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.skill-card h5::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all var(--transition-medium);
}

.skill-card:hover h5::after {
    width: 100%;
}

/* Portfolio section */
.portfolio-image {
    width: 100%;
    max-width: 800px;
    height: 450px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-medium);
    transform: scale(0.95);
}

.carousel-item {
    padding: 2rem 0;
}

.carousel-item:hover .portfolio-image {
    transform: scale(1);
    box-shadow: var(--shadow-dark);
}

.carousel-control-prev, 
.carousel-control-next {
    width: 10%;
    opacity: 0.7;
}

.carousel-control-prev-icon, 
.carousel-control-next-icon {
    background-color: var(--primary-color);
    padding: 20px;
    border-radius: 50%;
    background-size: 50%;
}

/* Formulaire de contact */
.contact-form {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    padding: 3rem;
    transition: all var(--transition-medium);
}

.contact-form:hover {
    box-shadow: var(--shadow-medium);
}

.form-label {
    color: var(--primary-color);
    font-weight: 500;
}

.form-control, .form-select {
    border: 2px solid rgba(0, 0, 0, 0.1);
    padding: 12px 15px;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}


.floating-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    /* Le reste des styles reste inchangé */
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.chat-popup {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 300px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
}

.chat-popup.chat-open {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Footer */
#footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

#footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/images/pattern.svg');
    opacity: 0.05;
    z-index: 0;
}

#footer .container {
    position: relative;
    z-index: 2;
}

#footer h5 {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

#footer h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
}

#footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: all var(--transition-fast);
}

#footer a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.social-icons a:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.5);
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.delay-1 {
    animation-delay: 0.5s;
}

.delay-2 {
    animation-delay: 1s;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Styles de section généraux */
section {
    padding: 100px 0;
    position: relative;
}

section h2 {
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    font-weight: 700;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
}

.text-center h2::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Animations supplémentaires */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes rotateIn {
    from { transform: rotate(-10deg) scale(0.8); opacity: 0; }
    to { transform: rotate(0) scale(1); opacity: 1; }
}

/* Utils */
.bg-light {
    background-color: #f8f9fa;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* Page loader animation */
/* Correction pour le loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.7s, visibility 0.7s;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Force hide via !important si nécessaire */
.hide-loader {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Responsive Design */
@media (max-width: 992px) {
    section {
        padding: 80px 0;
    }
    
    .hero-section {
        padding: 120px 0;
        min-height: auto;
    }
    
    .service-card {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .navbar-collapse {
        background: rgba(44, 62, 80, 0.95);
        border-radius: 10px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .hero-section {
        padding: 100px 0;
    }
    
    section h2 {
        font-size: 1.8rem;
    }
    
    .portfolio-image {
        height: 300px;
    }
    
    .contact-form {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .service-icon {
        font-size: 2.5rem;
    }
    
    .portfolio-image {
        height: 250px;
    }
    
    .skill-card {
        padding: 1.5rem;
    }
}

/* Curseur personnalisé */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    transition: all 0.1s ease;
    display: none;
}

@media (min-width: 992px) {
    .custom-cursor {
        display: block;
    }
}

.expand {
    transform: translate(-50%, -50%) scale(2);
    background: rgba(231, 76, 60, 0.5);
}

/* Effet de défilement progressif */
html {
    scroll-padding-top: 80px;
    scroll-behavior: smooth;
}

/* Pour les images de fond */
.pattern-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: 0;
    background-image: url('assets/images/pattern.svg');
}