/* =========================
   LuxAeternum Chat — PRO UI
   Totally Black • Premium • Animations
   Works: index.html / private.html / auth.html
   ========================= */

:root{
  --bg:#000;
  --bg2:#05060a;
  --panel: rgba(255,255,255,.045);
  --panel2: rgba(255,255,255,.07);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);

  --text: rgba(255,255,255,.94);
  --muted: rgba(255,255,255,.62);

  --accent: rgba(255,255,255,.92);   /* premium white */
  --danger: rgba(248,113,113,.92);

  --radius: 18px;
  --radius2: 22px;

  --shadow: 0 20px 80px rgba(0,0,0,.72);
  --shadow2: 0 10px 30px rgba(0,0,0,.35);

  --blur: 16px;
  --speed: .22s;
  --ease: cubic-bezier(.2,.8,.2,1);
}

/* Reset */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  overflow:hidden;

  /* Premium black depth */
  background:
    radial-gradient(1100px 800px at 18% 18%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(900px 700px at 82% 22%, rgba(255,255,255,.035), transparent 62%),
    radial-gradient(1200px 900px at 60% 110%, rgba(255,255,255,.03), transparent 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

/* Subtle animated grain glow */
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 600px at 20% 15%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(900px 600px at 80% 25%, rgba(255,255,255,.05), transparent 60%);
  opacity:.25;
  filter: blur(18px);
  animation: floatGlow 9s ease-in-out infinite alternate;
}
@keyframes floatGlow{
  from{ transform: translate3d(-10px,-8px,0) scale(1); }
  to  { transform: translate3d(12px,10px,0)  scale(1.03); }
}

/* App shell (safe areas for iPhone) */
.app{
  height: 100svh;
  height: 100dvh;
  min-height: -webkit-fill-available;
  display:flex;
  flex-direction:column;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* =========================
   TOP BAR
   ========================= */
.topbar{
  position: sticky;
  top:0;
  z-index: 60;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(var(--blur));
}

.head{
  display:flex;
  align-items:center;
  gap:12px;
}

/* Logo image */
.logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  object-fit: cover;
  box-shadow: var(--shadow2);
  flex: 0 0 auto;

  transform: translateZ(0);
  transition: transform var(--speed) var(--ease), filter var(--speed) var(--ease);
}
.logo:hover{
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.05);
}

.twrap{ flex:1; min-width:0; }
.title{
  font-weight: 900;
  letter-spacing:.2px;
  font-size: 16px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.sub{
  margin-top:2px;
  color: var(--muted);
  font-size: 12px;
}

.right{
  display:flex;
  align-items:center;
  gap:10px;
}

/* User pill */
.pill{
  max-width: 46vw;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;

  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.pill:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}

/* =========================
   LAYOUT CARD
   ========================= */
.shell{
  flex:1;
  min-height:0;
  display:flex;
  justify-content:center;
}

.card{
  width: min(980px, 100%);
  height: 100%;
  display:flex;
  flex-direction:column;
  border-left: 1px solid rgba(255,255,255,.03);
  border-right: 1px solid rgba(255,255,255,.03);
}

/* Tabs bar */
.nav{
  display:flex;
  gap:10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

/* Tab buttons */
.nav a{
  text-decoration:none;
  color: rgba(255,255,255,.70);
  font-weight: 900;
  font-size: 12px;
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);

  transition:
    transform var(--speed) var(--ease),
    background var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    color var(--speed) var(--ease);
}
.nav a:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.86);
}
.nav a.active{
  color: rgba(0,0,0,.92);
  background: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.92);
}

/* =========================
   MESSAGES
   ========================= */
.messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding: 16px 12px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Soft fade mask top/bottom */
.messages{
  mask-image: linear-gradient(to bottom,
    transparent 0px,
    black 18px,
    black calc(100% - 22px),
    transparent 100%);
}

/* Day divider */
.day{
  display:flex;
  justify-content:center;
  margin: 10px 0 14px;
}
.day span{
  font-size: 12px;
  color: rgba(255,255,255,.70);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(12px);
}

/* Message row */
.row{
  display:flex;
  gap:10px;
  align-items:flex-end;
  margin: 10px 0;
  animation: popIn .18s var(--ease) both;
}
@keyframes popIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}
.row.me{ justify-content:flex-end; }

/* Avatar */
.avatar{
  width: 34px; height: 34px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 12px;
  opacity:.92;
  flex: 0 0 auto;
}
.row.me .avatar{ display:none; }

/* Bubble */
.bubble{
  max-width: min(78%, 560px);
  padding: 12px 12px 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,.30);

  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.bubble:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.055);
}

/* Your messages: bright but still premium */
.row.me .bubble{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

/* Meta */
.meta{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
}
.name{
  font-size: 12px;
  font-weight: 950;
  opacity:.90;
  letter-spacing:.1px;
}
.time{
  font-size: 11px;
  color: rgba(255,255,255,.55);
  white-space:nowrap;
}
.text{
  font-size: 15px;
  line-height:1.35;
  white-space:pre-wrap;
  word-break:break-word;
}

/* =========================
   FOOTER / COMPOSER (iPhone safe)
   ========================= */
.footer{
  position: sticky;
  bottom: 0;
  z-index: 55;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(var(--blur));
}

.composer{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: 0 10px 28px rgba(0,0,0,.40);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.composer:focus-within{
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.055);
}

/* Inputs */
input{
  font-family: inherit;
}
.composer input,
.field input{
  flex:1;
  min-width:0;
  padding: 12px 12px;
  background: transparent;
  color: var(--text);
  border:none;
  outline:none;
  font-size: 16px; /* iOS no zoom */
}
.composer input::placeholder,
.field input::placeholder{
  color: rgba(255,255,255,.45);
}

/* =========================
   BUTTONS (all)
   ========================= */
.btn{
  border:none;
  cursor:pointer;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 950;
  background: rgba(255,255,255,.92);
  color: #000;

  box-shadow: 0 12px 26px rgba(255,255,255,.10);
  transform: translateZ(0);
  transition:
    transform .08s var(--ease),
    filter var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    background var(--speed) var(--ease),
    color var(--speed) var(--ease);
}
.btn:hover{
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(255,255,255,.14);
}
.btn:active{ transform: scale(.98); }
.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

/* Secondary buttons */
.btn.secondary{
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow:none;
}
.btn.secondary:hover{
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
}

/* Danger */
.btn.danger{
  background: var(--danger);
  color:#140406;
  box-shadow: 0 12px 26px rgba(248,113,113,.14);
}

/* =========================
   PRIVATE PANEL
   ========================= */
.panel{
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

.field{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.field:focus-within{
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.055);
}

.small{
  font-size: 12px;
  color: rgba(255,255,255,.62);
  line-height: 1.35;
}

/* =========================
   QUALITY OF LIFE
   ========================= */
a{ -webkit-tap-highlight-color: transparent; }
button{ -webkit-tap-highlight-color: transparent; }
img{ user-select:none; -webkit-user-drag:none; }

@media (max-width: 420px){
  .topbar{ padding: 12px 12px 9px; }
  .messages{ padding: 14px 10px; }
  .bubble{ max-width: 84%; }
  .pill{ max-width: 55vw; }
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  body::before{ display:none; }
}
.attach-wrapper{
  position: relative;
}

.attach-menu{
  position: absolute;
  bottom: 55px;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.1);
  padding: 10px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  z-index: 50;
}

.attach-menu button{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}

.attach-menu button:hover{
  background: rgba(255,255,255,.12);
}

.attach-menu.hidden{
  display: none;
}
/* ==========================================
   PATCH: Mobile header + organized top menu
   Works with your current premium theme
========================================== */

:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --topbar-h: 72px;     /* aproximación */
  --tabs-h: 56px;       /* aproximación */
}

/* En móviles, NO escondas el scroll del body para evitar glitches
   (los mensajes ya tienen su propio scroll, pero Safari a veces “corta”) */
@media (max-width: 820px){
  body{ overflow: hidden; }
}

/* Topbar: hazla FIXED para que jamás se corte */
.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding-top: var(--safe-top);
}

/* Reserva espacio arriba para que nada quede debajo del header fijo */
.app{
  padding-top: calc(var(--topbar-h) + var(--tabs-h));
}

/* Ajuste fino: el padding original safe-area de .app te puede empujar todo.
   Mantén safe-area abajo y lados, pero arriba lo manejamos con topbar fixed. */
.app{
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* HEAD: permite wrap cuando no cabe */
.head{
  flex-wrap: wrap;
}

/* Title zone: que no se aplaste */
.twrap{
  flex: 1 1 240px;
}

/* Right zone: wrap inteligente */
.right{
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 52vw;
  gap: 8px;
}

/* Pill más compacta en móviles */
.pill{
  max-width: 42vw;
}

/* En pantallas chicas: reduce controles para que nunca se corte */
@media (max-width: 520px){
  .logo{ width: 38px; height: 38px; border-radius: 12px; }
  .title{ font-size: 14px; }
  .sub{ font-size: 11px; }

  .right{ max-width: 58vw; }
  .pill{ max-width: 38vw; padding: 7px 10px; }

  .btn{ padding: 10px 12px; border-radius: 14px; }
  .btn.secondary{ padding: 10px 12px; }
}

/* ==========================================
   TOP TABS (nuevo menú organizado)
========================================== */

.top-tabs{
  display: flex;
  gap: 10px;
  padding: 0 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

.top-tabs .tab{
  text-decoration: none;
  color: rgba(255,255,255,.70);
  font-weight: 900;
  font-size: 12px;
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  transition:
    transform var(--speed) var(--ease),
    background var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    color var(--speed) var(--ease);
}

.top-tabs .tab:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.86);
}

.top-tabs .tab.active{
  color: rgba(0,0,0,.92);
  background: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.92);
}

/* En móviles, tabs con wrap */
@media (max-width: 420px){
  .top-tabs{
    padding: 0 12px 10px;
    flex-wrap: wrap;
  }
}

/* ==========================================
   Messages + footer safe-area
========================================== */

/* El contenido principal ya está bajo el header fijo */
.shell{ flex: 1; min-height: 0; }

/* Footer ya maneja safe-area, pero mejoramos iOS */
.footer{
  padding-bottom: calc(10px + var(--safe-bot));
}

/* Evitar zoom iOS en inputs */
.composer input{ font-size: 16px; }

/* ==========================================
   Opcional: botón de campana más “icono”
   (si no quieres, no pasa nada)
========================================== */
#btnNotif{
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}



