/**
 * =============================================================
 * ARCHIVO: /assets/css/theme-mosaic.css
 * Tema Global: Voki "Oscuro Mosaico" (Base Oscura + Fondos Vivos)
 * =============================================================
 */

:root {
  /* Fondos y Superficies (misma paleta base que Oscuro) */
  --voki-bg: #09090b;
  --voki-surface: #121214;
  --voki-surface-hover: #1f1f22;
  --bg-base: var(--voki-bg);
  --bg-surface: var(--voki-surface);
  --bg-input: #18181b;

  /* Bordes y Divisores sutiles */
  --voki-divider: #27272a;
  --border-color: var(--voki-divider);

  /* Textos */
  --voki-text: #f4f4f5;
  --voki-muted: #a1a1aa;
  --text-main: var(--voki-text);
  --text-muted: var(--voki-muted);

  /* Color de Acento Principal (Morado Voki) */
  --voki-accent: #5c16c5;
  --voki-accent-hover: #7224e2;
  --voki-primary: var(--voki-accent);
  --brand-purple: var(--voki-accent);
  --brand-purple-hover: var(--voki-accent-hover);
  --brand-purple-glow: rgba(92, 22, 197, 0.4);

  /* Colores de Estado y Notificaciones */
  --voki-success: #10b981;
  --voki-warning: #f59e0b;
  --voki-danger: #ff2b55;
  --voki-info: #0dcaf0;

  /* Sobrescribir variables de Bootstrap nativas */
  --bs-primary: #5c16c5;
  --bs-primary-rgb: 92, 22, 197;
  --bs-body-bg: #09090b;
  --bs-body-color: #f4f4f5;
}

/* ==========================================================
   UTILIDADES GLOBALES
========================================================== */
html:not(.voki-has-custom-bg),
body:not(.voki-has-custom-bg) {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background-color: var(--voki-bg) !important;
  color: var(--voki-text) !important;
}

.bg-dark:not(.voki-has-custom-bg) {
  background-color: var(--voki-bg) !important;
}

.border-subtle {
  border-color: var(--voki-divider) !important;
}

.voki-post-card,
[data-post-card-id],
.voki-post-card .card-body:not(.voki-post-bg),
[data-post-card-id] .card-body:not(.voki-post-bg) {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* ==========================================================
   FONDOS MOSAICO SUTILES Y DINAMICOS POR SECCION
   (Excluye perfiles para evitar conflictos con fondos de usuario)
========================================================== */
@keyframes vokiMosaicDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-240px, -240px, 0);
  }
}

/* Mantener el contenido por encima de la capa mosaico fija */
body[data-voki-route="home"]:not(.voki-has-custom-bg) > main,
body[data-voki-route="explore"]:not(.voki-has-custom-bg) > main,
body[data-voki-route="search"]:not(.voki-has-custom-bg) > main {
  position: relative;
  z-index: 2;
}

/* Barras superior e inferior ligeramente translúcidas en secciones con mosaico */
body[data-voki-route="home"]:not(.voki-has-custom-bg) header.sticky-top,
body[data-voki-route="explore"]:not(.voki-has-custom-bg) header.sticky-top,
body[data-voki-route="search"]:not(.voki-has-custom-bg) header.sticky-top,
body[data-voki-route="home"]:not(.voki-has-custom-bg) .voki-bottom-navbar,
body[data-voki-route="explore"]:not(.voki-has-custom-bg) .voki-bottom-navbar,
body[data-voki-route="search"]:not(.voki-has-custom-bg) .voki-bottom-navbar,
body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .voki-bottom-navbar {
  background-color: rgba(9, 9, 11, 0.82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body[data-voki-route="home"]:not(.voki-has-custom-bg) header.sticky-top .bg-dark,
body[data-voki-route="explore"]:not(.voki-has-custom-bg) header.sticky-top .bg-dark {
  background-color: transparent !important;
}

/* 1) FEED PRINCIPAL (home): Mosaico orgánico sutil + ambiente violeta profundo fijo al viewport */
body[data-voki-route="home"]:not(.voki-has-custom-bg) {
  background-color: #09090b !important;
}

body[data-voki-route="home"]:not(.voki-has-custom-bg)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(155deg, #140e26 0%, #0e0b1a 50%, #09090d 100%);
}

body[data-voki-route="home"]:not(.voki-has-custom-bg)::before {
  content: "";
  position: fixed;
  inset: -240px;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  background-repeat: repeat;
  background-size: 240px 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='%23a78bfa' stroke-opacity='0.055' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(18,20) rotate(-12)'%3E%3Cpath d='M4 4h16a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H9l-5 4v-4H4a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3z'/%3E%3C/g%3E%3Cg transform='translate(96,16) rotate(16)'%3E%3Cpath d='M10 1l2.2 5.8L18 9l-5.8 2.2L10 17l-2.2-5.8L2 9l5.8-2.2z'/%3E%3C/g%3E%3Cg transform='translate(172,22) rotate(-8)'%3E%3Ccircle cx='10' cy='10' r='7'/%3E%3Cpath d='M10 6v8M6 10h8'/%3E%3C/g%3E%3Cg transform='translate(48,86) rotate(14)'%3E%3Cpath d='M2 10c4-4 7 4 11 0s7 4 11 0'/%3E%3C/g%3E%3Cg transform='translate(132,82) rotate(-18)'%3E%3Cpolygon points='10,2 18,16 2,16'/%3E%3C/g%3E%3Cg transform='translate(202,88) rotate(10)'%3E%3Cpath d='M10 16s-6.5-4-6.5-8.2A3.8 3.8 0 0 1 10 5.4a3.8 3.8 0 0 1 6.5 2.4C16.5 12 10 16 10 16z'/%3E%3C/g%3E%3Cg transform='translate(20,152) rotate(18)'%3E%3Crect x='2' y='2' width='15' height='15' rx='4'/%3E%3C/g%3E%3Cg transform='translate(94,148) rotate(-10)'%3E%3Cpath d='M9 2v12M4 9l5 5 5-5'/%3E%3C/g%3E%3Cg transform='translate(168,154) rotate(20)'%3E%3Cpath d='M11 2a8 8 0 1 0 8 8 6 6 0 0 1-8-8z'/%3E%3C/g%3E%3Cg transform='translate(54,204) rotate(-14)'%3E%3Cpath d='M3 10h14M10 3v14'/%3E%3C/g%3E%3Cg transform='translate(138,202) rotate(12)'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3C/g%3E%3Ccircle cx='72' cy='54' r='1.6' fill='%23a78bfa' fill-opacity='0.06' stroke='none'/%3E%3Ccircle cx='158' cy='52' r='1.4' fill='%23a78bfa' fill-opacity='0.06' stroke='none'/%3E%3Ccircle cx='72' cy='182' r='1.6' fill='%23a78bfa' fill-opacity='0.06' stroke='none'/%3E%3Ccircle cx='216' cy='186' r='1.5' fill='%23a78bfa' fill-opacity='0.06' stroke='none'/%3E%3C/svg%3E");
  animation: vokiMosaicDrift 60s linear infinite;
}

/* 2) EXPLORACIÓN (explore / search): Mosaico geométrico & brújula + ambiente fijo al viewport */
body[data-voki-route="explore"]:not(.voki-has-custom-bg),
body[data-voki-route="search"]:not(.voki-has-custom-bg) {
  background-color: #09090b !important;
}

body[data-voki-route="explore"]:not(.voki-has-custom-bg)::after,
body[data-voki-route="search"]:not(.voki-has-custom-bg)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(155deg, #0b1426 0%, #0a0f1d 52%, #09090c 100%);
}

body[data-voki-route="explore"]:not(.voki-has-custom-bg)::before,
body[data-voki-route="search"]:not(.voki-has-custom-bg)::before {
  content: "";
  position: fixed;
  inset: -240px;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  background-repeat: repeat;
  background-size: 240px 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='%2393c5fd' stroke-opacity='0.05' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(18,18) rotate(-10)'%3E%3Ccircle cx='10' cy='10' r='8'/%3E%3Cpolygon points='10,5 12.5,10 10,15 7.5,10'/%3E%3C/g%3E%3Cg transform='translate(96,18) rotate(14)'%3E%3Cpolygon points='10,1 18,5.5 18,14.5 10,19 2,14.5 2,5.5'/%3E%3C/g%3E%3Cg transform='translate(174,20) rotate(-14)'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='M14 14l4 4'/%3E%3C/g%3E%3Cg transform='translate(50,84) rotate(20)'%3E%3Cpolygon points='10,1 19,10 10,19 1,10'/%3E%3C/g%3E%3Cg transform='translate(130,82) rotate(-12)'%3E%3Cpath d='M2 12l5-5 5 5 5-5'/%3E%3C/g%3E%3Cg transform='translate(200,86) rotate(8)'%3E%3Crect x='2' y='2' width='14' height='14' rx='3'/%3E%3Cpath d='M2 9h14M9 2v14'/%3E%3C/g%3E%3Cg transform='translate(20,150) rotate(12)'%3E%3Cpolygon points='10,2 19,17 1,17'/%3E%3C/g%3E%3Cg transform='translate(96,148) rotate(-16)'%3E%3Cpath d='M10 1l2.2 5.8L18 9l-5.8 2.2L10 17l-2.2-5.8L2 9l5.8-2.2z'/%3E%3C/g%3E%3Cg transform='translate(170,152) rotate(15)'%3E%3Ccircle cx='10' cy='10' r='8'/%3E%3Ccircle cx='10' cy='10' r='3'/%3E%3C/g%3E%3Cg transform='translate(56,204) rotate(-8)'%3E%3Cpath d='M4 4l10 10M14 4L4 14'/%3E%3C/g%3E%3Cg transform='translate(142,202) rotate(18)'%3E%3Cpolygon points='9,1 17,9 9,17 1,9'/%3E%3C/g%3E%3Ccircle cx='74' cy='52' r='1.5' fill='%2393c5fd' fill-opacity='0.055' stroke='none'/%3E%3Ccircle cx='158' cy='56' r='1.5' fill='%2393c5fd' fill-opacity='0.055' stroke='none'/%3E%3Ccircle cx='72' cy='182' r='1.5' fill='%2393c5fd' fill-opacity='0.055' stroke='none'/%3E%3C/svg%3E");
  animation: vokiMosaicDrift 65s linear infinite;
}

/* 3) MENSAJES / INBOX (chat): Mosaico de burbujas en el panel de conversaciones */
body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .chat-inbox-viewport {
  background: linear-gradient(155deg, #130e24 0%, #0d0a18 52%, #09090c 100%) !important;
}

body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .inbox-top-header {
  background: rgba(9, 9, 11, 0.84) !important;
}

body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .inbox-rail {
  background: rgba(9, 9, 11, 0.72) !important;
}

body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .inbox-main-panel {
  background: transparent !important;
  position: relative;
}

body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .inbox-main-panel > * {
  position: relative;
  z-index: 1;
}

body[data-voki-route="chat"]:not(.chat-room-open):not(.voki-has-custom-bg) .inbox-main-panel::before {
  content: "";
  position: absolute;
  inset: -240px;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  background-repeat: repeat;
  background-size: 240px 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='%23c4b5fd' stroke-opacity='0.05' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(18,20) rotate(-12)'%3E%3Cpath d='M4 4h15a3 3 0 0 1 3 3v7a3 3 0 0 1-3 3H9l-5 4v-4H4a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3z'/%3E%3C/g%3E%3Cg transform='translate(96,18) rotate(14)'%3E%3Cpath d='M2 10l16-7-4 16-4-6z'/%3E%3C/g%3E%3Cg transform='translate(174,22) rotate(-10)'%3E%3Cpath d='M10 16s-6.5-4-6.5-8.2A3.8 3.8 0 0 1 10 5.4a3.8 3.8 0 0 1 6.5 2.4C16.5 12 10 16 10 16z'/%3E%3C/g%3E%3Cg transform='translate(48,86) rotate(16)'%3E%3Cpath d='M10 2a7 7 0 0 0-7 7c0 1.4.4 2.7 1.1 3.8L3 17l4.2-1.1A7 7 0 1 0 10 2z'/%3E%3C/g%3E%3Cg transform='translate(132,84) rotate(-14)'%3E%3Cpath d='M4 12a4 4 0 0 1 4-4h6a4 4 0 0 1 0 8H8'/%3E%3C/g%3E%3Cg transform='translate(200,88) rotate(12)'%3E%3Cpath d='M10 1l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3C/g%3E%3Cg transform='translate(20,152) rotate(10)'%3E%3Cpath d='M2 10c4-4 7 4 11 0s7 4 11 0'/%3E%3C/g%3E%3Cg transform='translate(98,150) rotate(-14)'%3E%3Cpath d='M5 4h12a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H9l-4 3v-3H5a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3z'/%3E%3C/g%3E%3Cg transform='translate(170,154) rotate(18)'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='M6 9h6'/%3E%3C/g%3E%3Cg transform='translate(56,204) rotate(-12)'%3E%3Cpath d='M3 10l13-5-3 13-3-5z'/%3E%3C/g%3E%3Cg transform='translate(140,202) rotate(10)'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3C/g%3E%3Ccircle cx='74' cy='54' r='1.5' fill='%23c4b5fd' fill-opacity='0.055' stroke='none'/%3E%3Ccircle cx='160' cy='52' r='1.5' fill='%23c4b5fd' fill-opacity='0.055' stroke='none'/%3E%3Ccircle cx='74' cy='182' r='1.5' fill='%23c4b5fd' fill-opacity='0.055' stroke='none'/%3E%3C/svg%3E");
  animation: vokiMosaicDrift 60s linear infinite;
}

/* Respetar preferencia de movimiento reducido o modo ahorro de energía */
@media (prefers-reduced-motion: reduce) {
  body[data-voki-route="home"]::before,
  body[data-voki-route="explore"]::before,
  body[data-voki-route="search"]::before,
  body[data-voki-route="chat"] .inbox-main-panel::before {
    animation: none !important;
  }
}

html.voki-reduce-motion body[data-voki-route="home"]::before,
html.voki-reduce-motion body[data-voki-route="explore"]::before,
html.voki-reduce-motion body[data-voki-route="search"]::before,
html.voki-reduce-motion body[data-voki-route="chat"] .inbox-main-panel::before {
  animation: none !important;
}

/* ==========================================================
   SOBRESCRIBIR CLASES "PRIMARY" DE BOOTSTRAP AL MORADO VOKI
========================================================== */
.text-primary {
  color: var(--voki-accent) !important;
}

.bg-primary {
  background-color: var(--voki-accent) !important;
}

.btn-primary {
  background-color: var(--voki-accent) !important;
  border-color: var(--voki-accent) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
  background-color: var(--voki-accent-hover) !important;
  border-color: var(--voki-accent-hover) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.25rem rgba(92, 22, 197, 0.5) !important;
}

.btn-outline-primary {
  color: var(--voki-accent) !important;
  border-color: var(--voki-accent) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:active {
  background-color: var(--voki-accent) !important;
  color: #ffffff !important;
}

.badge.bg-primary {
  background-color: var(--voki-accent) !important;
  color: #ffffff !important;
}
