/* ========================================
   MAJEXCOP - Système de Design
   Couleurs officielles:
   - Bleu: #00AEEF
   - Orange: #F57F20
   - Violet: #583795
   - Blanc: #FFFFFF
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Antonio:wght@400;700&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --majex-blue: #00AEEF;
    --majex-orange: #F57F20;
    --majex-purple: #583795;
    --majex-white: #FFFFFF;
    --majex-gradient: linear-gradient(135deg, #00AEEF 0%, #583795 100%);
}

/* ========================================
   PRELOADER - Animation de chargement
======================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--majex-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Logo animé - Cercle principal */
.logo-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--majex-white);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: pulseGlow 2s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(0, 174, 239, 0.5),
    0 0 80px rgba(88, 55, 149, 0.3);
    overflow: hidden;
}

/* Animation de pulsation avec glow */
@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(0, 174, 239, 0.5),
        0 0 80px rgba(88, 55, 149, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 60px rgba(0, 174, 239, 0.8),
        0 0 120px rgba(88, 55, 149, 0.5);
    }
}

/* ========================================
   IMAGE DU LOGO - Nouvelles animations
======================================== */

/* Image du logo dans le preloader */
.logo-image {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: logoAppear 1.2s ease-out forwards,
    logoPulse 2s ease-in-out 1.2s infinite;
    opacity: 0;
    filter: drop-shadow(0 4px 15px rgba(0, 174, 239, 0.4));
}

/* Animation d'apparition du logo */
@keyframes logoAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-15deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Animation de pulsation continue après l'apparition */
@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 15px rgba(0, 174, 239, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 6px 25px rgba(0, 174, 239, 0.6));
    }
}

/* Alternative - Animation avec révélation circulaire (optionnel) */
.logo-image-reveal {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: logoReveal 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
    logoPulse 2s ease-in-out 1.5s infinite;
    clip-path: circle(0% at 50% 50%);
}

@keyframes logoReveal {
    0% {
        clip-path: circle(0% at 50% 50%);
        transform: rotate(-180deg) scale(0.3);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        clip-path: circle(70% at 50% 50%);
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* Bulles décoratives animées */
.bubble {
    position: absolute;
    border-radius: 50%;
    animation: floatBubble 3s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.bubble-1 {
    width: 40px;
    height: 40px;
    background: var(--majex-orange);
    top: 20px;
    left: 50px;
    animation-delay: 0s;
}

.bubble-2 {
    width: 50px;
    height: 50px;
    background: var(--majex-blue);
    top: 50px;
    right: 40px;
    animation-delay: 0.5s;
}

.bubble-3 {
    width: 25px;
    height: 25px;
    background: var(--majex-purple);
    bottom: 60px;
    left: 40px;
    animation-delay: 1s;
}

@keyframes floatBubble {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
    }
}

/* Anneaux rotatifs autour du logo */
.ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    animation: rotateRing 4s linear infinite;
}

.ring-1 {
    width: 240px;
    height: 240px;
    border-color: var(--majex-orange) transparent transparent transparent;
}

.ring-2 {
    width: 270px;
    height: 270px;
    border-color: transparent var(--majex-blue) transparent transparent;
    animation-direction: reverse;
    animation-duration: 3s;
}

.ring-3 {
    width: 300px;
    height: 300px;
    border-color: transparent transparent var(--majex-purple) transparent;
    animation-duration: 5s;
}

@keyframes rotateRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Texte de chargement */
.loading-text {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Antonio', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--majex-white);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fadeInText 1s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes fadeInText {
    to {
        opacity: 1;
    }
}

/* Points de chargement animés */
.loading-dots {
    display: inline-flex;
    margin-left: 5px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: var(--majex-white);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Particules flottantes en arrière-plan */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--majex-white);
    border-radius: 50%;
    opacity: 0.4;
    animation: floatParticle 6s ease-in-out infinite;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.4;
    }
    25% {
        transform: translate(20px, -30px);
        opacity: 0.8;
    }
    50% {
        transform: translate(-15px, -60px);
        opacity: 0.6;
    }
    75% {
        transform: translate(30px, -40px);
        opacity: 0.9;
    }
}

/* ========================================
   ANIMATIONS GÉNÉRALES
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.6s ease-out forwards;
}

/* ========================================
   STYLES DE BASE
======================================== */
body {
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar avec couleurs MAJEXCOP */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--majex-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--majex-purple);
}

/* ========================================
   COMPOSANTS RÉUTILISABLES
======================================== */

/* Pattern juridique */
.legal-pattern {
    background: var(--majex-gradient);
    position: relative;
    overflow: hidden;
}

.legal-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
}

/* Gradient text */
.gradient-text {
    background: var(--majex-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effect */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Boutons stylisés */
.btn-majex-primary {
    background: var(--majex-gradient);
    color: var(--majex-white);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.3);
}

.btn-majex-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 174, 239, 0.5);
}

.btn-majex-secondary {
    background: var(--majex-white);
    color: var(--majex-blue);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--majex-blue);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-majex-secondary:hover {
    background: var(--majex-blue);
    color: var(--majex-white);
    transform: translateY(-2px);
}

/* Badge couleurs */
.badge-blue {
    background: var(--majex-blue);
    color: var(--majex-white);
}

.badge-orange {
    background: var(--majex-orange);
    color: var(--majex-white);
}

.badge-purple {
    background: var(--majex-purple);
    color: var(--majex-white);
}

/* ========================================
   EFFETS SPÉCIAUX
======================================== */

/* Effet de blob animé */
@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(50px, 30px) scale(1.05);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .loader-container {
        width: 250px;
        height: 250px;
    }

    .logo-circle {
        width: 150px;
        height: 150px;
    }

    .logo-image,
    .logo-image-reveal {
        width: 100px;
        height: 100px;
    }

    .ring-1 {
        width: 190px;
        height: 190px;
    }

    .ring-2 {
        width: 220px;
        height: 220px;
    }

    .ring-3 {
        width: 250px;
        height: 250px;
    }

    .loading-text {
        font-size: 18px;
        bottom: -50px;
    }

    .bubble-1, .bubble-2 {
        width: 30px;
        height: 30px;
    }

    .bubble-3 {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   UTILITIES
======================================== */
.text-majex-blue { color: var(--majex-blue); }
.text-majex-orange { color: var(--majex-orange); }
.text-majex-purple { color: var(--majex-purple); }

.bg-majex-blue { background-color: var(--majex-blue); }
.bg-majex-orange { background-color: var(--majex-orange); }
.bg-majex-purple { background-color: var(--majex-purple); }

.border-majex-blue { border-color: var(--majex-blue); }
.border-majex-orange { border-color: var(--majex-orange); }
.border-majex-purple { border-color: var(--majex-purple); }

.hover\:text-majex-blue:hover { color: var(--majex-blue); }
.hover\:text-majex-orange:hover { color: var(--majex-orange); }
.hover\:text-majex-purple:hover { color: var(--majex-purple); }

.hover\:bg-majex-blue:hover { background-color: var(--majex-blue); }
.hover\:bg-majex-orange:hover { background-color: var(--majex-orange); }
.hover\:bg-majex-purple:hover { background-color: var(--majex-purple); }
