/* assets/css/style.css */

/* =========================================
   1. VARIABLES & DESIGN TOKENS
   ========================================= */
:root {
    --cpw-primary: #007bff;
    --cpw-primary-rgb: 0, 123, 255;
    --cpw-secondary: #6f42c1;
    
    /* Couleurs de fond */
    --cpw-bg: #ffffff;
    --cpw-text: #1a1d23;
    --cpw-text-muted: #64748b;
    
    /* Bordures & Effets */
    --cpw-border-color: rgba(0, 0, 0, 0.08);
    --cpw-glass-border: rgba(255, 255, 255, 0.6);
    --cpw-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    --cpw-shadow-lg: 0 20px 40px -5px rgba(0, 123, 255, 0.15);
    --cpw-glass-bg: rgba(255, 255, 255, 0.90); 
    
    /* Dimensions */
    --cpw-container: 1100px;
    --cpw-radius: 24px;
    --cpw-radius-btn: 50px;
}

[data-theme="dark"] {
    --cpw-bg: #0f172a; /* Slate 900 */
    --cpw-text: #f1f5f9;
    --cpw-text-muted: #94a3b8;
    --cpw-border-color: rgba(255, 255, 255, 0.1);
    --cpw-glass-border: rgba(255, 255, 255, 0.1);
    --cpw-glass-bg: rgba(15, 23, 42, 0.90); 
    --cpw-shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. BASE & RESET
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--cpw-bg);
    color: var(--cpw-text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

.cpw-container {
    max-width: var(--cpw-container);
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

/* Utilitaires Globaux */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--cpw-border-color);
    box-shadow: var(--cpw-shadow-lg);
}
[data-theme="dark"] .glass-panel {
    background: rgba(30, 41, 59, 0.6); 
    border-color: rgba(255,255,255,0.1);
}

/* =========================================
   3. AMBIENT LIGHT (HALOS ARRIÈRE-PLAN)
   ========================================= */
.cpw-ambient-light {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.cpw-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatBlob 20s infinite alternate;
}

.cpw-blob-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(var(--cpw-primary-rgb), 0.15) 0%, transparent 70%);
}

.cpw-blob-2 {
    bottom: -10%; right: -10%;
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(111, 66, 193, 0.12) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, 40px) scale(1.1); }
}

/* =========================================
   4. HEADER (FIXE & STABLE)
   ========================================= */
.cpw-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1.2rem 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent; /* Invisible au début */
    background-color: transparent; 
}

/* État Scrolé */
.cpw-header.scrolled {
    padding: 0.8rem 0;
    background: var(--cpw-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cpw-border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

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

/* LOGO */
.cpw-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cpw-primary);
    display: flex; align-items: center; gap: 0.5rem;
}
.cpw-logo span { color: var(--cpw-text); }

/* NAVIGATION DESKTOP */
.cpw-nav-desktop {
    display: flex; gap: 2rem; align-items: center;
    background: rgba(var(--cpw-primary-rgb), 0.03);
    padding: 0.5rem 0.5rem 0.5rem 1.5rem; /* Padding ajusté pour le bouton */
    border-radius: 30px;
    border: 1px solid var(--cpw-border-color);
}

[data-theme="dark"] .cpw-nav-desktop {
    background: rgba(255, 255, 255, 0.03); 
    border-color: rgba(255, 255, 255, 0.08);
}

/* LIENS DE NAVIGATION */
.cpw-nav-link {
    font-size: 0.95rem; 
    font-weight: 500;
    color: var(--cpw-text-muted);
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.cpw-nav-link:hover { color: var(--cpw-primary); }

.cpw-nav-link.active {
    color: var(--cpw-primary) !important;
    font-weight: 700;
}

.cpw-nav-link.active::after {
    content: ''; position: absolute;
    bottom: 0; left: 50%;
    width: 6px; height: 6px;
    background-color: var(--cpw-primary);
    border-radius: 50%; transform: translateX(-50%);
    box-shadow: 0 2px 5px rgba(var(--cpw-primary-rgb), 0.4);
}

/* BOUTON NAV CTA ("Estimer mon projet") */
.nav-item-cta {
    background: var(--cpw-primary);
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    margin-left: 1rem;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
    font-weight: 600;
}
.nav-item-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
    color: white; 
}
.nav-item-cta.active::after { display: none; } /* Pas de point sous le bouton */


/* ACTIONS (BOUTONS DROITE) */
.cpw-actions { display: flex; align-items: center; gap: 0.8rem; }

.cpw-btn-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--cpw-border-color);
    background: transparent;
    color: var(--cpw-text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.cpw-btn-icon:hover {
    border-color: var(--cpw-primary);
    color: var(--cpw-primary);
    background: rgba(var(--cpw-primary-rgb), 0.05);
}

.cpw-btn-login {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem; font-weight: 600;
    color: var(--cpw-text);
    border: 1px solid var(--cpw-border-color);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}
[data-theme="dark"] .cpw-btn-login { background: rgba(255, 255, 255, 0.05); }

.cpw-btn-login:hover {
    background: var(--cpw-primary);
    border-color: var(--cpw-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--cpw-primary-rgb), 0.2);
}

.cpw-burger { display: none; } 

/* =========================================
   5. MENU MOBILE OVERLAY
   ========================================= */
.cpw-mobile-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}

[data-theme="dark"] .cpw-mobile-overlay {
    background: rgba(15, 23, 42, 0.98);
}

.cpw-mobile-overlay.active { opacity: 1; visibility: visible; }

.cpw-close-btn {
    position: absolute; top: 2rem; right: 2rem;
    background: none; border: none;
    font-size: 2rem; color: var(--cpw-text);
    cursor: pointer;
}

.cpw-mobile-nav {
    display: flex; flex-direction: column; gap: 2rem;
    text-align: center; width: 80%;
}

.cpw-mobile-link {
    font-size: 1.8rem; font-weight: 800;
    color: var(--cpw-text);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}
.cpw-mobile-link:hover { color: var(--cpw-primary); }

.cpw-mobile-link.active { color: var(--cpw-primary); }
.cpw-mobile-link.active::after {
    content: '•'; position: absolute;
    margin-left: 10px; color: var(--cpw-primary);
    font-size: 1.5rem; line-height: 1; top: -2px; 
}

/* Boutons dans menu mobile */
.cpw-mobile-nav .cpw-btn-primary {
    display: inline-block; width: 100%;
    padding: 1rem 2rem; 
    background: var(--cpw-primary); color: white;
    border-radius: 50px; font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(0,123,255,0.3);
}

/* Animation d'apparition menu mobile */
.cpw-mobile-overlay.active .cpw-mobile-link,
.cpw-mobile-overlay.active .cpw-btn-login,
.cpw-mobile-overlay.active .cpw-btn-primary {
    animation: slideUpFade 0.5s ease forwards;
    opacity: 0; transform: translateY(20px);
}
.cpw-mobile-overlay.active .cpw-mobile-link:nth-child(1) { animation-delay: 0.1s; }
.cpw-mobile-overlay.active .cpw-mobile-link:nth-child(2) { animation-delay: 0.15s; }
.cpw-mobile-overlay.active .cpw-mobile-link:nth-child(3) { animation-delay: 0.2s; }
.cpw-mobile-overlay.active .cpw-mobile-link:nth-child(4) { animation-delay: 0.25s; }
.cpw-mobile-overlay.active div { animation-delay: 0.3s; }

@keyframes slideUpFade { to { opacity: 1; transform: translateY(0); } }

/* =========================================
   6. FOOTER (FAT FOOTER)
   ========================================= */
.cpw-footer {
    padding: 5rem 0 2rem;
    background: white;
    border-top: 1px solid var(--cpw-border-color);
    margin-top: 6rem;
    font-size: 0.9rem;
    color: var(--cpw-text-muted);
}
[data-theme="dark"] .cpw-footer { background: #0f172a; }

.cpw-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.cpw-footer-col h4 {
    font-size: 1rem; font-weight: 700;
    margin-bottom: 1.2rem; color: var(--cpw-text);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.footer-desc {
    font-size: 0.95rem; color: var(--cpw-text-muted);
    line-height: 1.6; margin: 1rem 0 1.5rem;
}

.footer-socials { display: flex; gap: 1rem; }
.footer-socials a {
    width: 36px; height: 36px;
    background: rgba(var(--cpw-primary-rgb), 0.1);
    color: var(--cpw-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.footer-socials a:hover {
    background: var(--cpw-primary); color: white;
    transform: translateY(-3px);
}

.footer-links-list li { margin-bottom: 0.8rem; }
.footer-links-list a {
    color: var(--cpw-text-muted); font-size: 0.95rem;
    transition: color 0.2s, padding-left 0.2s;
}
.footer-links-list a:hover {
    color: var(--cpw-primary); padding-left: 5px;
}

.cpw-footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--cpw-border-color);
    color: var(--cpw-text-muted);
    font-size: 0.9rem;
}

/* =========================================
   7. RESPONSIVE (MEDIA QUERIES)
   ========================================= */
@media (max-width: 992px) {
    /* Header Mobile */
    .cpw-nav-desktop, 
    .cpw-actions .cpw-btn-login { display: none !important; }
    
    .cpw-burger { display: flex; }
    
    .cpw-container { padding: 0 1.5rem; }

    /* Footer Tablette (2 cols) */
    .cpw-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 600px) {
    /* Footer Mobile (1 col) */
    .cpw-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-socials { justify-content: center; }
}

/* =========================================
   CORRECTIF FOOTER MOBILE
   ========================================= */
@media (max-width: 600px) {
    /* Footer Mobile (1 col) */
    .cpw-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* CENTRAGE DU LOGO */
    .footer-logo {
        justify-content: center; /* Force le centrage des éléments flex */
        margin-bottom: 1rem;     /* Ajoute un peu d'espace sous le logo */
        width: 100%;             /* S'assure qu'il prend toute la largeur pour se centrer */
    }

    /* Centrage des icônes réseaux sociaux */
    .footer-socials { 
        justify-content: center; 
    }
    
    /* Bouton CTA Menu Mobile */
    .cpw-mobile-nav .cpw-btn-primary {
        display: inline-block; padding: 1rem 2rem; font-size: 1.1rem;
    }
}
/* ===============================================
   CORRECTIF BOUTON NAV CTA ("Estimer mon projet")
   ============================================ */
.nav-item-cta {
    background: var(--cpw-primary);
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    margin-left: 1rem;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
    font-weight: 600;
    transition: all 0.3s ease; /* Ajout d'une transition fluide */
}

.nav-item-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
    color: white !important; 
}

/* CORRECTIF : Gestion de l'état actif sur le bouton */
.nav-item-cta.active {
    color: white !important; /* Force le texte blanc */
    background: var(--cpw-primary); /* Maintient le fond bleu */
    opacity: 1; /* S'assure qu'il est bien visible */
}

/* On cache le petit point qui apparait sous les liens normaux actifs */
.nav-item-cta.active::after { 
    display: none; 
}