/**
 * Styles partagés Malambi Website 9.0.0
 * Tout ce qui est en plus de Tailwind.
 */

/* === Polices ===
   Auto-hébergées via /assets/css/fonts.css (chargé avant ce fichier). */

body {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Momo Trust Display', serif;
}

/* === Effets visuels === */
:root {
    --hero-pattern-svg: 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");
    --grad-malambi:   linear-gradient(135deg, #1d5c9a 0%, #289de7 100%);
    --grad-dark:      linear-gradient(135deg, #0f172a 0%, #1d5c9a 100%);
    --grad-radial:    radial-gradient(circle at top right, #289de7 0%, #1d5c9a 60%, #143f6b 100%);
}

/* Note : on utilise background-image (pas la shorthand background) afin que .hero-pattern,
   appliquée plus tard dans la cascade, puisse être combinée via la règle .gradient-X.hero-pattern. */
.gradient-malambi { background-image: var(--grad-malambi); background-color: #1d5c9a; }
.gradient-dark    { background-image: var(--grad-dark);    background-color: #0f172a; }
.gradient-radial  { background-image: var(--grad-radial);  background-color: #1d5c9a; }

.hero-pattern { background-image: var(--hero-pattern-svg); }

/* Quand pattern + gradient cohabitent, on layer : SVG par-dessus le gradient */
.gradient-malambi.hero-pattern { background-image: var(--hero-pattern-svg), var(--grad-malambi); }
.gradient-dark.hero-pattern    { background-image: var(--hero-pattern-svg), var(--grad-dark); }
.gradient-radial.hero-pattern  { background-image: var(--hero-pattern-svg), var(--grad-radial); }

/* === Bokeh hero — particules lumineuses animées ===
   Repris de l'ADN visuel du logo_fb (logo Malambi sur fond bleu cyan + bokehs cyan/blancs).
   Plusieurs radial-gradient empilés simulent les points lumineux ; animation drift + pulse,
   désactivable via prefers-reduced-motion.

   Usage : <section class="gradient-radial hero-bokeh">…</section>
   (le contenu doit être positionné — le mixin met automatiquement les enfants en z-index 1). */

.hero-bokeh {
    position: relative;
    isolation: isolate;
}

.hero-bokeh::before,
.hero-bokeh::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-repeat: no-repeat;
    will-change: transform, opacity;
}

/* Couche 1 : grands bokehs cyan/blancs lents */
.hero-bokeh::before {
    background-image:
        radial-gradient(circle at 12% 25%, rgba(255,255,255,0.18) 0%, transparent 5%),
        radial-gradient(circle at 78% 20%, rgba(40,157,231,0.30) 0%, transparent 8%),
        radial-gradient(circle at 35% 75%, rgba(255,255,255,0.15) 0%, transparent 4%),
        radial-gradient(circle at 90% 70%, rgba(40,157,231,0.25) 0%, transparent 7%),
        radial-gradient(circle at 55% 45%, rgba(255,255,255,0.12) 0%, transparent 6%),
        radial-gradient(circle at 18% 85%, rgba(40,157,231,0.20) 0%, transparent 5%);
    animation: bokeh-drift-a 24s ease-in-out infinite alternate;
}

/* Couche 2 : petits bokehs blancs vifs, plus rapides */
.hero-bokeh::after {
    background-image:
        radial-gradient(circle at 25% 50%, rgba(255,255,255,0.22) 0%, transparent 1.5%),
        radial-gradient(circle at 65% 35%, rgba(255,255,255,0.30) 0%, transparent 1.2%),
        radial-gradient(circle at 45% 80%, rgba(255,255,255,0.18) 0%, transparent 1.5%),
        radial-gradient(circle at 88% 50%, rgba(255,255,255,0.25) 0%, transparent 1.3%),
        radial-gradient(circle at 8% 60%,  rgba(255,255,255,0.20) 0%, transparent 1.4%),
        radial-gradient(circle at 70% 90%, rgba(255,255,255,0.22) 0%, transparent 1.6%),
        radial-gradient(circle at 30% 15%, rgba(255,255,255,0.28) 0%, transparent 1.2%);
    animation: bokeh-drift-b 17s ease-in-out infinite alternate;
}

@keyframes bokeh-drift-a {
    0%   { transform: translate(0, 0)        scale(1);    opacity: 0.95; }
    50%  { transform: translate(-2%, 1.5%)   scale(1.05); opacity: 1;    }
    100% { transform: translate(2%, -1.5%)   scale(0.98); opacity: 0.85; }
}
@keyframes bokeh-drift-b {
    0%   { transform: translate(0, 0)         scale(1);    opacity: 1;    }
    50%  { transform: translate(1.5%, -1%)    scale(1.10); opacity: 0.85; }
    100% { transform: translate(-1.5%, 1%)    scale(0.95); opacity: 1;    }
}

/* Le contenu principal du hero doit rester au-dessus des bokehs */
.hero-bokeh > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
    .hero-bokeh::before,
    .hero-bokeh::after { animation: none; }
}

/* === Scène isométrique animée (port + camion + voiture) ===
   Section dédiée — pas de fond hero, pas de blur. Animations CSS pures.
   Tous les véhicules sont en SVG ; on les translate via translateX. */

.iso-scene {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.iso-scene .veh-truck   { animation: iso-truck-move 22s linear infinite; }
.iso-scene .veh-car     { animation: iso-car-move   14s linear infinite; }
.iso-scene .veh-car-2   { animation: iso-car2-move  18s linear infinite; }
.iso-scene .crane-arm   { animation: iso-crane-sway 6s ease-in-out infinite alternate;
                          transform-origin: 215px 220px; transform-box: fill-box; }
.iso-scene .ship-bob    { animation: iso-ship-bob   5s ease-in-out infinite alternate; }
.iso-scene .container-lift { animation: iso-container-lift 8s ease-in-out infinite alternate;
                              transform-box: fill-box; }
.iso-scene .cloud-drift { animation: iso-cloud-drift 60s linear infinite; }

@keyframes iso-truck-move {
    0%   { transform: translateX(-200px); }
    100% { transform: translateX(1480px); }
}
@keyframes iso-car-move {
    0%   { transform: translateX(1480px); }
    100% { transform: translateX(-200px); }
}
@keyframes iso-car2-move {
    0%   { transform: translateX(-300px); }
    100% { transform: translateX(1580px); }
}
@keyframes iso-crane-sway {
    from { transform: rotate(-2deg); }
    to   { transform: rotate(3deg); }
}
@keyframes iso-ship-bob {
    from { transform: translateY(-2px); }
    to   { transform: translateY(2px); }
}
@keyframes iso-container-lift {
    from { transform: translateY(0px); }
    to   { transform: translateY(-15px); }
}
@keyframes iso-cloud-drift {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}

@media (prefers-reduced-motion: reduce) {
    .iso-scene .veh-truck,
    .iso-scene .veh-car,
    .iso-scene .veh-car-2,
    .iso-scene .crane-arm,
    .iso-scene .ship-bob,
    .iso-scene .container-lift,
    .iso-scene .cloud-drift { animation: none; }
}

/* === Lightbox galerie événement === */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center; justify-content: center;
    padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 80vh; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-caption {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: white; font-size: 14px; max-width: 80vw; text-align: center;
    background: rgba(0,0,0,0.5); padding: 8px 16px; border-radius: 6px;
}
.lightbox-counter {
    position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.7); font-size: 13px;
    background: rgba(0,0,0,0.4); padding: 4px 12px; border-radius: 12px;
}

/* === Bouton fullscreen (page /demo.html) === */
.fullscreen-toggle {
    position: fixed;
    top: 100px;
    right: 16px;
    z-index: 60;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}
.fullscreen-toggle:hover {
    background: #1d5c9a;
    transform: scale(1.05);
}

/* === Mode stand (kiosque forum) === */
body.stand-mode { background: #0f172a; }

/* On masque tout ce qui n'est pas la zone d'affichage utile */
body.stand-mode > nav,                                 /* header injecté */
body.stand-mode > footer,                              /* footer injecté */
body.stand-mode #event-banner,                         /* bandeau forum */
body.stand-mode .whatsapp-float,                       /* bouton WhatsApp */
body.stand-mode > section.gradient-radial.hero-bokeh,  /* hero démo */
body.stand-mode > section.bg-gradient-to-r,            /* bandeau forum bas */
body.stand-mode > section.bg-white                     /* sections "Ce que vous voyez" */
{
    display: none !important;
}

/* Le bouton fullscreen reste visible mais déplacé */
body.stand-mode .fullscreen-toggle {
    top: 16px;
}

/* Bandeau stand en haut */
.stand-overlay {
    position: sticky;
    top: 0;
    z-index: 70;
    background: linear-gradient(135deg, #0f172a 0%, #1d5c9a 100%);
    color: white;
    padding: 14px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.stand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    gap: 24px;
}
.stand-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.stand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(40, 157, 231, 0.4);
}
.stand-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}
.stand-subtitle {
    font-size: 13px;
    color: #fef3c7;
    margin-top: 2px;
}
.stand-clock {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.stand-clock-time {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #fef3c7;
}
.stand-clock-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    text-transform: capitalize;
}

/* Section KPI : agrandie, fond foncé, valeurs jaune Malambi (haut contraste) */
body.stand-mode > section:has(#kpi-active),
body.stand-mode > section.py-6 {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0 !important;
}
body.stand-mode .text-malambi-blue { color: #fef3c7 !important; }
body.stand-mode .text-gray-500     { color: #cbd5e1 !important; }
body.stand-mode .text-gray-400     { color: #94a3b8 !important; }
body.stand-mode .text-gray-900     { color: #ffffff !important; }
body.stand-mode .text-gray-600     { color: rgba(255, 255, 255, 0.75) !important; }

/* Agrandir les chiffres KPI en mode stand pour visibilité projecteur */
body.stand-mode .text-3xl { font-size: 2.5rem !important; line-height: 1 !important; }
body.stand-mode #kpi-active,
body.stand-mode #kpi-avg-speed,
body.stand-mode #kpi-total-km,
body.stand-mode #alerts-counter {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Section carte+panneau : fond foncé, carte agrandie, panneau blanc */
body.stand-mode > section.py-8.lg\:py-12,
body.stand-mode > section[class*="bg-gray-50"] {
    background: #0f172a !important;
    padding: 16px !important;
}
body.stand-mode #demo-map { height: calc(100vh - 280px) !important; min-height: 480px; }
body.stand-mode .bg-white {
    background: #1e293b !important;
    color: #f8fafc;
}
body.stand-mode .border-gray-100,
body.stand-mode .border-gray-200 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
body.stand-mode .alert-item {
    background: #1e293b !important;
    color: #f8fafc;
}

/* Le commentaire de bas de carte : caché en stand mode pour gagner de la place */
body.stand-mode > section.py-8 > div > div > p,
body.stand-mode > section.lg\:py-12 > div > div > p {
    display: none;
}

/* === Demo stage (page /demo.html) === */
.demo-marker-wrap {
    pointer-events: auto;
}
.demo-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    transition: transform 0.2s ease;
}
.demo-marker:hover {
    transform: scale(1.15);
}
.demo-marker-cam {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #fef3c7;
    color: #dc2626;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}
.demo-marker-label {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.95);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.alert-item {
    animation: alert-slide-in 0.4s ease-out;
}
@keyframes alert-slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(29, 92, 154, 0.15);
}

/* === Boutons Malambi === */
.btn-primary {
    background-color: #1d5c9a;
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #289de7;
    box-shadow: 0 10px 25px -5px rgba(29, 92, 154, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: #1d5c9a;
    border: 2px solid #1d5c9a;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: #1d5c9a;
    color: white;
}

/* === WhatsApp floating button === */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: all 0.3s;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5);
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    z-index: -1;
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* === Navigation active state === */
.nav-link {
    position: relative;
    color: #475569;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #1d5c9a;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1d5c9a;
}

/* === Badge produit (NEW, BETA, PRO) === */
.product-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-new      { background: #10b981; color: white; }
.badge-beta     { background: #f59e0b; color: white; }
.badge-pro      { background: #1d5c9a; color: white; }
.badge-hardware { background: #7c3aed; color: white; }

/* === Section dividers === */
.section-divider {
    height: 4px;
    background: linear-gradient(90deg, transparent, #1d5c9a, transparent);
    margin: 4rem auto;
    max-width: 200px;
}

/* === Notifications === */
.notification {
    position: fixed;
    top: 90px;
    right: 1rem;
    z-index: 60;
    max-width: 24rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: white;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out;
}

.notification-success { background: #10b981; }
.notification-error   { background: #ef4444; }
.notification-info    { background: #1d5c9a; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Mobile menu === */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
}

/* === Print === */
@media print {
    .whatsapp-float, nav, footer { display: none; }
}
