/* ==========================================================================
   NOWEY — global.css
   Estilos compartidos por TODAS las páginas del sitio.
   Si cambias colores, fuentes, header o footer, hazlo aquí.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@700;900&display=swap');

/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root {
  --bg:          #050a0e;
  --bg-card:     #0b1324;
  --blue:        #00b7ff;
  --blue-dark:   #008de0;
  --green:       #39ff14;
  --green-dark:  #28cc0e;
  --orange:      #ff7b00;
  --orange-dark: #ff9900;
  --pink:        #ff00cc;
  --yellow:      #ffee00;
  --text:        #c8d5e0;
  --text-muted:  #8a97ad;
  --white:       #ffffff;
  --border:      rgba(0,183,255,.15);
  --glass:       rgba(11,19,36,.75);
  --shadow:      0 10px 30px rgba(0,0,0,.45);
  --card-bg:     linear-gradient(180deg, rgba(10,18,35,.95), rgba(4,10,22,.98));
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Rajdhani', sans-serif;
  background:
    radial-gradient(circle at top left,  rgba(0,183,255,.08), transparent 35%),
    radial-gradient(circle at top right, rgba(57,255,20,.05),  transparent 30%),
    radial-gradient(circle at bottom right, rgba(255,123,0,.08), transparent 35%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* Capa de glow de fondo — compatible con div.background-glow (index) y body::before (arcade/staff) */
.background-glow,
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(0,183,255,.15), transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(57,255,20,.04),  transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(255,123,0,.12),  transparent 25%);
}

/* ==========================================================================
   BANNER SVG
   ========================================================================== */
.site-banner { width: 100%; display: block; line-height: 0; overflow: hidden; }
.site-banner svg { width: 100%; height: auto; display: block; max-height: 220px; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0; left: 0;
  width: 100%;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 50px;
  gap: 40px;
  background: rgba(4,10,22,.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border);
  z-index: 999;
}

/* Logo */
.logo span {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav */
.main-nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;

}

.main-nav a {
    color: #00b7ff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: color 0.2s, text-shadow 0.2s;
}

.main-nav a:hover,
.main-nav a.activo {
    color: #39ff14;
    text-shadow: 0 0 8px #39ff14;
}

/* Acciones del header */
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Botón ingresar */
.btn-login {
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: .3s;
  white-space: nowrap;
}
.btn-login:hover { background: var(--orange); color: #000; }

/* ==========================================================================
   UTILIDADES
   ========================================================================== */

/* Texto con gradiente tricolor — usar en títulos o spans destacados */
.gradient-text {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tarjeta base reutilizable */
.nowey-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
}

/* Pill de estado (ej: "ONLINE", "ACTIVO") */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 30px;
  font-size: .85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 15px var(--green);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  margin-top: 50px;
  border-top: 1px solid rgba(0,183,255,.12);
  background: linear-gradient(180deg, rgba(4,10,22,.85), rgba(2,5,12,1));
  padding: 50px 30px;
}
.footer-content {
  max-width: 1400px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}
.footer-content h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.footer-content p { color: var(--text); }

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--blue), var(--green), var(--orange));
  border-radius: 20px;
}

/* ==========================================================================
   RESPONSIVE — base global (banner + header + footer)
   Cada página puede añadir su propio @media para lo que le sea específico.
   ========================================================================== */
@media (max-width: 768px) {
  .site-banner svg { max-height: 140px; }

  .main-header {
    height: auto;
    padding: 15px 20px;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
  }
  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
  }
  .main-nav a { font-size: 13px; }
  .header-actions { width: 100%; justify-content: center; }
  .btn-login { width: 180px; text-align: center; }

  .footer-content { flex-direction: column; text-align: center; }
}

/* =================================================================
   CHAT — estilos específicos
   ================================================================= */
/* ==========================================================================
   NOWEY — chat/assets/css/style.css
   Estilos del Chat. Los estilos globales (body, header, banner) están en global.css
   ========================================================================== */


/* ==========================================================================
   ALIASES DE VARIABLES — compatibilidad con las que usa script.js
   ========================================================================== */
:root {
  --orange-1:       var(--orange);
  --orange-2:       #ff9033;
  --orange-3:       #ffaa55;
  --orange-4:       rgba(255,123,0,.45);
  --border-color:   var(--border);
  --bg-card:        linear-gradient(180deg, rgba(10,18,35,.95), rgba(4,10,22,.98));
  --text-main:      var(--text);
  --gradient-main:  linear-gradient(135deg, var(--orange), var(--orange-dark));
}

/* ==========================================================================
   PANTALLAS DE AUTENTICACIÓN (welcome / login / register)
   ========================================================================== */
.auth-wrapper {
  min-height: calc(100vh - 310px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 50px 45px;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,123,0,.07), transparent 70%);
  pointer-events: none;
}

.auth-card h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.auth-card h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 35px;
  letter-spacing: 1px;
}

/* Welcome card — un poco más ancha */
.welcome-card { max-width: 500px; }
.welcome-description {
  color: var(--text);
  line-height: 1.8;
  font-size: 1rem;
  margin-bottom: 35px;
  padding: 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(0,183,255,.08);
  border-radius: 16px;
}
.welcome-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Formularios */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(0,183,255,.15);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--white);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  transition: .25s;
  outline: none;
}
.form-control:focus {
  border-color: var(--orange);
  background: rgba(255,123,0,.05);
  box-shadow: 0 0 0 3px rgba(255,123,0,.1);
}
.form-control::placeholder { color: rgba(200,213,224,.3); }

/* Botón principal */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #000;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: .25s;
  margin-top: 8px;
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255,123,0,.3);
}
.btn-primary:active { transform: translateY(0); }

/* Link de pie de formulario */
.auth-footer {
  text-align: center;
  font-size: .9rem;
  color: var(--text-muted);
  margin-top: 20px;
}
.auth-footer span {
  color: var(--orange);
  cursor: pointer;
  font-weight: 600;
  transition: .2s;
}
.auth-footer span:hover { color: var(--orange-dark); text-decoration: underline; }

/* ==========================================================================
   APP HEADER — barra interna del chat (diferente del main-header del sitio)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 85px; /* queda debajo del main-header sticky */
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(4,10,22,.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,123,0,.15);
  z-index: 99;
}

.app-header .logo {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--white);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #000;
  flex-shrink: 0;
}

.admin-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--orange);
  background: rgba(255,123,0,.1);
  color: var(--orange);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: .2s;
}
.admin-btn:hover { background: var(--orange); color: #000; }

/* ==========================================================================
   LAYOUT PRINCIPAL DEL CHAT
   ========================================================================== */
.main-container {
  display: flex;
  height: calc(100vh - 364px); /* banner(220) + main-header(85) + app-header(58) + 1px */
  min-height: 420px;
}

/* SIDEBAR */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: rgba(4,10,22,.85);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,183,255,.2); border-radius: 4px; }

.sidebar-section { margin-bottom: 20px; }

.sidebar-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,183,255,.1);
}

.online-count {
  background: var(--orange);
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.user-list { display: flex; flex-direction: column; gap: 4px; }

.user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  transition: .2s;
}
.user-item:hover { background: rgba(255,123,0,.08); color: var(--white); }

/* Dot de estado en sidebar */
.user-item .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

/* ÁREA PRINCIPAL DE CHAT */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(5,10,14,.6);
}

/* ==========================================================================
   MENSAJES
   ========================================================================== */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.messages-container::-webkit-scrollbar { width: 6px; }
.messages-container::-webkit-scrollbar-track { background: transparent; }
.messages-container::-webkit-scrollbar-thumb { background: rgba(0,183,255,.15); border-radius: 6px; }

.message-bubble {
  max-width: 75%;
  align-self: flex-start;
  background: rgba(11,19,36,.9);
  border: 1px solid rgba(0,183,255,.1);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  transition: .2s;
}
.message-bubble:hover { border-color: rgba(0,183,255,.2); }
.message-bubble.me {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(255,123,0,.18), rgba(255,153,0,.12));
  border-color: rgba(255,123,0,.2);
  border-radius: 16px 16px 4px 16px;
}

.private-msg {
  background: rgba(255,235,59,.06) !important;
  border-color: rgba(255,235,59,.2) !important;
}

.message-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.msg-nick {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--orange);
  transition: .2s;
}
.message-bubble.me .msg-nick { color: var(--orange-dark); }
.msg-nick:hover { color: var(--white); }

.msg-time {
  font-size: .7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.msg-content {
  font-size: .95rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

/* Badges de rol */
.badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.badge-admin {
  background: rgba(255,123,0,.2);
  color: var(--orange);
  border: 1px solid rgba(255,123,0,.3);
}
.badge-mod {
  background: rgba(0,183,255,.15);
  color: var(--blue);
  border: 1px solid rgba(0,183,255,.25);
}

/* ==========================================================================
   INPUT DE CHAT
   ========================================================================== */
.input-container {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(4,10,22,.98);
  position: relative;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(0,183,255,.15);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: .25s;
}
.input-wrapper:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,123,0,.08);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 500;
}
.chat-input::placeholder { color: rgba(200,213,224,.3); }

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: .2s;
  line-height: 1;
}
.emoji-btn:hover { background: rgba(255,255,255,.06); }

.send-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  border: none;
  border-radius: 10px;
  color: #000;
  cursor: pointer;
  transition: .2s;
  flex-shrink: 0;
}
.send-btn:hover { filter: brightness(1.1); transform: scale(1.05); }
.send-btn:active { transform: scale(.97); }

/* Emoji picker */
.emoji-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 16px;
  right: 16px;
  max-width: 340px;
  background: rgba(4,10,22,.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,.5);
  z-index: 50;
}
.emoji-item {
  border-radius: 6px;
  padding: 4px;
  text-align: center;
  transition: .15s;
}
.emoji-item:hover { background: rgba(255,123,0,.15); transform: scale(1.2); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .auth-card { padding: 35px 25px; }
  .auth-card h1 { font-size: 1.8rem; }

  .main-container { height: calc(100vh - 200px); }

  .sidebar { width: 60px; padding: 10px 6px; }
  .sidebar-title span:first-child { display: none; }
  .user-item { padding: 6px; justify-content: center; font-size: 0; }
  .user-item .status-dot { margin: 0; }

  .message-bubble { max-width: 90%; }

  .app-header { top: 0; }
  .app-header .logo { font-size: 1rem; }
}
