/* ===== Page Background ===== */
body.modules-page {
    background: linear-gradient(135deg, #1a1d29 0%, #252936 100%) !important;
    background-attachment: fixed !important;
    position: relative;
    overflow-x: hidden;
    color: rgba(255, 255, 255, 0.9) !important;
    min-height: 100vh;
}

body.modules-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 239, 233, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.modules-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 200%;
    animation: particlesFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* ===== Modules Container ===== */
.modules-container {
    position: relative;
    padding-top: 80px;
}

/* ===== Cube Container ===== */
.module-cube-container {
    position: sticky;
    top: 20px;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    background: transparent;
    border-radius: 20px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Z-index décroissant : CRM le plus HAUT (106) passe SOUS Gestion (105) qui passe SOUS RH (104), etc. */
#crm.module-cube-container { z-index: 106; }
#gestion.module-cube-container { z-index: 105; }
#rh.module-cube-container { z-index: 104; }
#facturation.module-cube-container { z-index: 103; }
#comptabilite.module-cube-container { z-index: 102; }
#stocks.module-cube-container { z-index: 101; }


.module-cube-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cube-overlay {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.cube-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== Module Content ===== */
.module-content {
    position: relative;
    background: rgba(30, 35, 50, 0.6);
    backdrop-filter: blur(14px);
    padding: 4rem 0;
    z-index: 1;
    min-height: auto;
    transform: none;
    will-change: auto;
    border-radius: 0;
    box-shadow: none;
}

.module-header {
    text-align: center;
    margin-bottom: 3rem;
}

.module-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.module-icon.icon-blue {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.module-icon.icon-green {
    background: linear-gradient(135deg, #10B981, #059669);
}

.module-icon.icon-purple {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.module-icon.icon-orange {
    background: linear-gradient(135deg, #FF6B35, #F97316);
}

.module-icon.icon-teal {
    background: linear-gradient(135deg, #14B8A6, #0D9488);
}

.module-icon.icon-red {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.module-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1rem;
}

.module-intro {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===== Features List ===== */
.module-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.feature-item i {
    font-size: 1.5rem;
    color: #10B981;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.feature-item h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .modules-container {
        padding-top: 60px;
    }

    .module-cube-container {
        width: 250px;
        height: 250px;
        top: 20px;
    }

    .module-content {
        transform: none;
    }

    .cube-badge {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    .module-header h2 {
        font-size: 2rem;
    }

    .module-intro {
        font-size: 1.1rem;
    }

    .module-features-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-item {
        padding: 1.5rem;
    }
}

/* ===== Scroll Animations ===== */
.module-detail-section {
    opacity: 0;
    animation: fadeInSection 0.8s ease forwards;
}

@keyframes fadeInSection {
    to {
        opacity: 1;
    }
}


@keyframes particlesFloat {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}
