/* =====================================================================
   WORLD OF TOOLS OS — THÈME DES APPLICATIONS (v1)
   Identité couleur par application + fond & verre communs.
   À charger APRÈS css/wot-design-system.css et AVANT le CSS de l'app.

   Les règles "base" sont en :where() -> spécificité 0 : elles ne peuvent
   donc jamais écraser le style propre d'une application existante.
   ===================================================================== */

:root {
    --wota-accent: var(--wot-accent-1, #f5b82e);
    --wota-accent-2: var(--wot-accent-2, #ffd76a);
    --wota-accent-soft: var(--wot-accent-soft, rgba(245, 184, 46, 0.16));
    --wota-accent-glow: var(--wot-accent-glow, rgba(245, 184, 46, 0.42));
    --wota-mesh: rgba(245, 184, 46, 0.22);
    --wota-ink: var(--wot-ink-950, #05080f);
    --wota-ink-2: var(--wot-ink-800, #0a1624);
    --wota-surface: rgba(12, 23, 37, 0.66);
    --wota-surface-strong: rgba(7, 14, 24, 0.86);
    --wota-border: rgba(255, 255, 255, 0.12);
    --wota-border-soft: rgba(255, 255, 255, 0.07);
    --wota-text: var(--wot-color-text, #e8eef7);
    --wota-muted: rgba(232, 238, 247, 0.62);
    --wota-radius: 22px;
    --wota-blur: 22px;
}

/* ------------------ Identité couleur par application ------------------ */
html[data-app='support'] {
    --wota-accent: #a78bfa;
    --wota-accent-2: #c4b5fd;
    --wota-accent-soft: rgba(167, 139, 250, 0.16);
    --wota-accent-glow: rgba(139, 92, 246, 0.45);
    --wota-mesh: rgba(139, 92, 246, 0.30);
}

html[data-app='faq'] {
    --wota-accent: #fb923c;
    --wota-accent-2: #fdba74;
    --wota-accent-soft: rgba(251, 146, 60, 0.16);
    --wota-accent-glow: rgba(249, 115, 22, 0.42);
    --wota-mesh: rgba(251, 146, 60, 0.28);
}

html[data-app='legal'] {
    --wota-accent: #e879f9;
    --wota-accent-2: #f0abfc;
    --wota-accent-soft: rgba(232, 121, 249, 0.16);
    --wota-accent-glow: rgba(217, 70, 239, 0.42);
    --wota-mesh: rgba(232, 121, 249, 0.26);
}

html[data-app='wot-coin'] {
    --wota-accent: #f5b82e;
    --wota-accent-2: #ffd76a;
    --wota-accent-soft: rgba(245, 184, 46, 0.16);
    --wota-accent-glow: rgba(245, 184, 46, 0.45);
    --wota-mesh: rgba(245, 184, 46, 0.26);
}

html[data-app='wot-missions'] {
    --wota-accent: #f5b82e;
    --wota-accent-2: #38bdf8;
    --wota-accent-soft: rgba(245, 184, 46, 0.16);
    --wota-accent-glow: rgba(245, 184, 46, 0.45);
    --wota-mesh: rgba(56, 189, 248, 0.24);
}

html[data-app='bot-not-code'] {
    --wota-accent: #34d399;
    --wota-accent-2: #6ee7b7;
    --wota-accent-soft: rgba(52, 211, 153, 0.16);
    --wota-accent-glow: rgba(52, 211, 153, 0.42);
    --wota-mesh: rgba(52, 211, 153, 0.26);
}

/* ------------------ Fond commun des applications ------------------ */
.wota-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 10% -12%, var(--wota-mesh) 0%, transparent 58%),
        radial-gradient(90% 80% at 102% 6%, rgba(56, 189, 248, 0.13) 0%, transparent 62%),
        radial-gradient(120% 100% at 50% 122%, rgba(139, 92, 246, 0.12) 0%, transparent 62%),
        linear-gradient(180deg, var(--wota-ink-2) 0%, var(--wota-ink) 64%);
}

.wota-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 18%, transparent 78%);
    mask-image: radial-gradient(120% 90% at 50% 0%, #000 18%, transparent 78%);
}

/* Halo doux animé (désactivé si reduced-motion) */
.wota-bg::before {
    content: '';
    position: absolute;
    top: -30vmax;
    left: 50%;
    width: 90vmax;
    height: 90vmax;
    margin-left: -45vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--wota-mesh) 0%, transparent 62%);
    opacity: 0.85;
    animation: wotaDrift 22s ease-in-out infinite alternate;
}

@keyframes wotaDrift {
    from {
        transform: translate3d(-6%, -2%, 0) scale(1);
    }
    to {
        transform: translate3d(6%, 4%, 0) scale(1.12);
    }
}

/* ------------------ Verre commun réutilisable ------------------ */
.wota-card {
    position: relative;
    border-radius: var(--wota-radius);
    border: 1px solid var(--wota-border);
    background: linear-gradient(180deg, rgba(24, 32, 54, 0.72), rgba(9, 14, 26, 0.78));
    box-shadow: 0 30px 80px rgba(2, 6, 12, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(var(--wota-blur)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--wota-blur)) saturate(1.6);
}

.wota-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 55%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ------------------ Détails communs ------------------ */
:where(html[data-app]) {
    scrollbar-color: var(--wota-accent) transparent;
    scrollbar-width: thin;
}

:where(html[data-app]) ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

:where(html[data-app]) ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

:where(html[data-app]) ::-webkit-scrollbar-thumb:hover {
    background: var(--wota-accent);
    background-clip: content-box;
}

:where(html[data-app]) ::selection {
    background: var(--wota-accent-soft);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .wota-bg::before {
        animation: none !important;
    }
}
