/* ═══════════════════════════════════════════════════════════════════
   lussyca_theme.css — variables tema + layout base WA
   Versión: 20260629-quality-audit
   Modo claro: html[data-theme="light"] (ver lussyca_brand_ui.css)
   Modo oscuro: body.night-mode / html[data-theme="dark"]
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables compartidas ── */
:root {
  /* Fondos (oscuro por defecto en app hasta toggle) */
  --bg-deep:   #0c0a12;
  --bg-base:   #16121e;
  --bg-card:   #1e1a2a;
  --bg-hover:  #24203a;
  --bg-soft:   #1c1726;
  --paper:     #f5f0fa;
  --grad-hdr: rgba(20, 16, 28, 0.96);
  --grad-tabs: #16121e;
  --wa-chat-bg: #0c0a12;

  /* Acento principal — rose */
  --rose:       #F05A8A;
  --rose-light: #ffb8d0;
  --accent:     #F05A8A;
  --accent-dim: rgba(240, 90, 138, 0.55);
  --accent-glow:rgba(240, 90, 138, 0.30);
  --accent2:    #8B5CF6;

  /* Acento secundario — violet */
  --violet:     #8B5CF6;

  /* Texto */
  --text:       #f0ecf8;
  --text-muted: #a899c4;
  --text-faint: #5a4a7a;

  /* Bordes */
  --border:       rgba(240, 90, 138, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);

  /* Sombras */
  --shadow-elev:  0 4px 24px rgba(0, 0, 0, 0.55);

  /* Colores por personaje */
  --c-irene:     #F05A8A;
  --c-valentina: #e67040;
  --c-raven:     #e53e5a;
  --c-lucas:     #38bdf8;
  --c-marco:     #4ade80;

  /* Gold */
  --gold: #f59e0b;

  /* Gradientes */
  --grad-msg-user: linear-gradient(135deg, #2d1b5e, #1e1040);
  --grad-msg-bot:  linear-gradient(135deg, #1a1a38, #16133a);

  /* Tipografía */
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

/* Oscuro explícito */
body.night-mode,
html[data-theme="dark"] body {
  --bg-deep:   #0c0a12;
  --bg-base:   #16121e;
  --bg-card:   #1e1a2a;
  --bg-hover:  #24203a;
  --bg-soft:   #1c1726;
  --text:       #f0ecf8;
  --text-muted: #a899c4;
  --text-faint: #5a4a7a;
  --border:       rgba(240, 90, 138, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);
  --grad-hdr: rgba(20, 16, 28, 0.96);
  --wa-chat-bg: #0c0a12;
}

/* ── Reset mínimo ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Base body (app) ── */
body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* Solo app chat — la landing necesita scroll de documento */
html:has(body.night-mode),
html:has(#app-layout) {
  height: 100%;
  overflow: hidden;
}

/* ── Layout principal WhatsApp-style ── */
/* Topnav fijo — el layout arranca debajo */
#lussyca-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
}

#app-layout,
.wa-layout {
  display: flex;
  flex-direction: row;
  height: auto;
  width: 100%;
  overflow: hidden;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
}

@media (max-width: 768px) {
  #lussyca-topnav { min-height: 48px; }
  #app-layout,
  .wa-layout { top: 48px; }
}

/* Panel lateral (lista de chats) */
#wa-list-pane {
  display: flex;
  flex-direction: column;
  width: 360px;
  min-width: 280px;
  max-width: 420px;
  height: 100%;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Panel principal (chat abierto) */
#wa-main-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-deep);
  overflow: hidden;
  position: relative;
}

/* Mobile: ocultar lista cuando hay chat abierto */
@media (max-width: 768px) {
  #wa-list-pane {
    width: 100%;
    max-width: 100%;
    position: fixed;
    inset: 0;
    z-index: 10;
  }
  #wa-list-pane.pane-hidden {
    display: none !important;
  }
  #wa-main-pane {
    position: fixed;
    inset: 0;
    z-index: 11;
  }
  #wa-main-pane.pane-hidden {
    display: none !important;
  }
}

/* ── Modales: ocultos por defecto ── */
#msg-ctx-menu,
#fwd-modal,
#group-create-modal,
.ctx-menu,
.dropdown-menu {
  display: none !important;
}
#msg-ctx-menu.show,
#fwd-modal.show,
#group-create-modal.show,
.ctx-menu.show,
.dropdown-menu.show {
  display: block !important;
}

/* ── Irene-modal base ── */
.irene-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 980;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: transparent;
}
.irene-modal.show {
  display: flex !important;
}

/* ── Scrollbars premium ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--rose);
}

/* ── Links ── */
a { color: var(--rose-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Botones base ── */
button, .btn {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--rose), var(--violet));
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
}
