/* Componentes Reutilizables */

/* =========================================
   Botones
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 650;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97) !important;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #FFFFFF;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 2.5px solid rgba(67, 56, 202, 0.9);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 6px 20px rgba(99, 102, 241, 0.45);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    inset 0 2px 1.5px rgba(255, 255, 255, 0.55),
    0 10px 30px rgba(236, 72, 153, 0.65);
  color: #FFFFFF;
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid var(--color-border-light);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.3);
  color: var(--color-text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(99, 102, 241, 0.5);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 8px 24px rgba(99, 102, 241, 0.25);
}

.btn-accent {
  background: var(--color-accent);
  color: #FFFFFF;
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.45);
}
.btn-accent:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 40px rgba(236, 72, 153, 0.7);
  color: #FFFFFF;
}

.btn-danger {
  background-color: var(--color-danger);
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
  filter: brightness(1.1);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-primary);
  border-radius: var(--radius-full);
}
.btn-ghost:hover {
  background-color: var(--color-bg-hover);
  color: #FFFFFF;
}

.btn-sm {
  padding: 8px 18px;
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
}

.btn-lg {
  padding: 16px 36px;
  font-size: var(--text-lg);
  border-radius: var(--radius-full);
}

.btn-icon {
  padding: 12px;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
}

.btn-full {
  width: 100%;
}

.spinner {
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}

/* =========================================
   Tarjetas (Cards)
========================================= */
.card {
  background: rgba(18, 22, 36, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.25);
}

.card-hover:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.4);
  border-color: var(--color-primary);
}

.card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: #090C16;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image img {
  transform: scale(1.06);
}

.card-body {
  padding: var(--space-6);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: var(--space-2);
}

.card-text {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.card-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
}

/* =========================================
   Formularios
========================================= */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(13, 16, 28, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
  outline: none;
  background: rgba(18, 22, 38, 0.95);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23B0B0D0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 16px top 50%;
  background-size: 12px auto;
  padding-right: 40px;
}

.form-checkbox {
  accent-color: var(--color-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-error {
  display: block;
  color: var(--color-danger);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.form-hint {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.input-group {
  display: flex;
  align-items: center;
}
.input-group .form-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-icon-wrapper {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}
.input-icon-wrapper .form-input {
  padding-left: 48px;
}

/* =========================================
   Navegación (Navbar)
========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background-color: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-navbar);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

.navbar-link {
  color: var(--color-text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
}
.navbar-link:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-hover);
}
.navbar-link.active {
  color: var(--color-primary);
  background-color: var(--color-bg-surface);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-toggle {
  display: flex;
  background: none;
  border: none;
  color: var(--color-text-primary);
  padding: var(--space-2);
  cursor: pointer;
}

@media (min-width: 768px) {
  .navbar-nav { display: flex; }
  .navbar-toggle { display: none; }
}

.navbar-mobile {
  position: fixed;
  inset: 0;
  top: var(--navbar-height);
  background-color: var(--color-bg-body);
  z-index: var(--z-navbar);
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-base);
}
.navbar-mobile.open {
  transform: translateX(0);
}

/* =========================================
   Modales
========================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 90%;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xl);
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 {
  margin: 0;
}

.modal-body {
  padding: var(--space-6);
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* =========================================
   Tostadas (Toasts)
========================================= */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  min-width: 300px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: slideInRight var(--transition-base) forwards;
  position: relative;
}

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info { border-left-color: var(--color-info); }

.toast-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.toast-close:hover {
  color: var(--color-text-primary);
}

/* =========================================
   Insignias y Etiquetas (Badges / Tags)
========================================= */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: var(--color-bg-surface);
  color: var(--color-text-primary);
}

.badge-primary { background-color: rgba(108, 92, 231, 0.2); color: var(--color-primary-light); }
.badge-success { background-color: rgba(0, 184, 148, 0.2); color: var(--color-success); }
.badge-warning { background-color: rgba(253, 203, 110, 0.2); color: var(--color-warning); }
.badge-danger { background-color: rgba(225, 112, 85, 0.2); color: var(--color-danger); }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

/* =========================================
   Pestañas (Tabs)
========================================= */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-1);
}

.tab {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  position: relative;
  transition: color var(--transition-fast);
}

.tab:hover {
  color: var(--color-text-primary);
}

.tab.active {
  color: var(--color-primary-light);
  border-bottom: 2px solid var(--color-primary);
}

.tab-content {
  padding-top: var(--space-6);
}

/* =========================================
   Estadísticas
========================================= */
.stat-card {
  background-color: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
}

.stat-value {
  font-size: var(--text-3xl);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.stat-change {
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-danger); }

/* =========================================
   Tablas
========================================= */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background-color: var(--color-bg-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  padding: var(--space-4);
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: var(--color-bg-hover);
}

/* =========================================
   Paginación
========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  background-color: var(--color-bg-hover);
}

.page-btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* =========================================
   Avatar
========================================= */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  overflow: hidden;
  object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--text-lg); }
.avatar-xl { width: 96px; height: 96px; font-size: var(--text-2xl); }

/* =========================================
   Esqueletos de Carga (Skeletons)
========================================= */
.skeleton {
  background-color: var(--color-bg-surface);
  border-radius: var(--radius-md);
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-2);
  width: 100%;
}
.skeleton-text:last-child { width: 80%; }

.skeleton-heading {
  height: 28px;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-image {
  aspect-ratio: 16/9;
  width: 100%;
}

/* =========================================
   Estado Vacío (Empty State)
========================================= */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state-icon {
  font-size: 80px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.empty-state-text {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  max-width: 400px;
}

/* =========================================
   Menú Desplegable (Dropdown)
========================================= */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: var(--space-2) 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background-color var(--transition-fast);
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  background: none;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
}

.dropdown-item:hover {
  background-color: var(--color-bg-hover);
}

.dropdown-divider {
  border-top: 1px solid var(--color-border);
  margin: var(--space-2) 0;
}

/* =========================================
   Animaciones Globales
========================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fadeIn { animation: fadeIn var(--transition-base) forwards; }
.animate-slideUp { animation: slideUp var(--transition-base) forwards; }
.animate-scaleIn { animation: scaleIn var(--transition-base) forwards; }

/* =========================================
   Header y Navegación Narratix Premium
========================================= */
.narratix-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  z-index: var(--z-navbar, 300);
  background: rgba(9, 10, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-base);
  padding-top: env(safe-area-inset-top, 0px);
}

.narratix-nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.narratix-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
  min-width: 0;
}

.narratix-brand:hover {
  transform: scale(1.02);
}

.narratix-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.narratix-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #FFFFFF 30%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.narratix-brand-dot {
  color: var(--color-accent);
  -webkit-text-fill-color: var(--color-accent);
}

.narratix-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.narratix-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.narratix-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.narratix-nav-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.narratix-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.narratix-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FCD34D;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.narratix-btn-pwa-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.95rem 0.35rem 0.4rem;
  border-radius: var(--radius-full, 9999px);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.12) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #F8FAFC;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.narratix-btn-pwa-nav .pwa-nav-icon-bubble {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1 0%, #EC4899 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.55);
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.narratix-btn-pwa-nav:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(236, 72, 153, 0.25) 100%);
  border-color: rgba(236, 72, 153, 0.65);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4), 0 0 14px rgba(236, 72, 153, 0.3);
  color: #FFFFFF;
}

.narratix-btn-pwa-nav:hover .pwa-nav-icon-bubble {
  transform: scale(1.1);
}

.narratix-btn-pwa-nav:active {
  transform: translateY(0);
}

.narratix-mobile-pwa-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 0.6rem 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #F8FAFC;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.narratix-mobile-pwa-btn .pwa-nav-icon-bubble {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1 0%, #EC4899 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  flex-shrink: 0;
}

.narratix-mobile-pwa-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(236, 72, 153, 0.25) 100%);
  border-color: rgba(236, 72, 153, 0.6);
  color: #FFFFFF;
}

.narratix-btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-fast);
  border: none;
}

.narratix-btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.5);
  color: #fff;
}

.narratix-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.narratix-btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.narratix-user-menu,
.narratix-lang-menu {
  position: relative;
}

.narratix-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #F8FAFC;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.narratix-lang-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
  color: #FFFFFF;
}

.narratix-lang-dropdown {
  min-width: 170px;
}

.lang-dropdown-header {
  padding: 0.35rem 0.75rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.25rem;
}

.lang-option-item {
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.lang-option-item.active-lang {
  background: rgba(99, 102, 241, 0.16);
  color: #FFFFFF;
  font-weight: 700;
}

.narratix-mobile-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  margin-bottom: 0.35rem;
}

.mobile-lang-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #CBD5E1;
}

.mobile-lang-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mobile-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-lang-pill.active {
  background: var(--gradient-brand);
  border-color: rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
}

.narratix-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.narratix-user-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.narratix-avatar-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 1.5px;
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
}

.narratix-avatar-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-bg-body);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.narratix-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narratix-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 180px;
  background: rgba(18, 22, 36, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  animation: slideUp var(--transition-fast);
}

.narratix-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.narratix-dropdown.hidden {
  display: none;
}

.narratix-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.narratix-dropdown-item.admin-link {
  color: #FCD34D;
  border-top: 1px solid var(--color-border);
  margin-top: 0.3rem;
  padding-top: 0.65rem;
}

.narratix-dropdown-item.admin-link:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
}

.narratix-dropdown-item.danger {
  color: #F87171;
  border-top: 1px solid var(--color-border);
  margin-top: 0.3rem;
}

.narratix-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

.narratix-mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  padding: 0;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.narratix-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
}

.narratix-mobile-nav {
  display: none;
  flex-direction: column;
  padding: 1rem 1rem 1.5rem;
  background: rgba(9, 11, 20, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  max-height: calc(100vh - 65px);
  max-height: calc(100dvh - 65px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0.35rem;
}

.narratix-mobile-nav a {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border-bottom: none;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #E2E8F0;
  text-decoration: none;
  transition: all 0.2s ease;
}

.narratix-mobile-nav a:hover,
.narratix-mobile-nav a:active {
  background: rgba(99, 102, 241, 0.15);
  color: #FFFFFF;
}

@media (max-width: 768px) {
  .narratix-nav-links { display: none !important; }
  .narratix-mobile-toggle { display: flex !important; }
  .narratix-mobile-nav:not([hidden]) { display: flex; }

  .narratix-nav-container {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }

  .narratix-brand {
    gap: 0.5rem;
  }
  .narratix-brand-icon {
    width: 32px;
    height: 32px;
  }
  .narratix-brand-text {
    font-size: 1.25rem;
  }

  .narratix-nav-actions {
    gap: 0.45rem;
  }

  .narratix-lang-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }
  .narratix-lang-btn > svg {
    display: none !important;
  }

  /* Compactar botón PWA en la barra superior móvil */
  .narratix-btn-pwa-nav {
    padding: 0.35rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    justify-content: center;
  }
  .narratix-btn-pwa-nav .pwa-nav-text {
    display: none !important;
  }
  .narratix-btn-pwa-nav .pwa-nav-icon-bubble {
    width: 24px;
    height: 24px;
  }

  /* Ocultar el botón largo "Empezar Gratis" de la barra superior en pantallas móviles */
  .narratix-nav-actions .narratix-btn-glow {
    display: none !important;
  }

  /* Ajustar botón "Acceder" para que sea un pill compacto que nunca desborde */
  .narratix-nav-actions .narratix-btn-ghost {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
    white-space: nowrap;
  }

  /* Si el usuario está autenticado, compactar el menú de usuario */
  .narratix-user-btn {
    padding: 2px;
    border-radius: 50%;
    gap: 0;
  }
  .narratix-user-name,
  .narratix-user-btn > svg {
    display: none !important;
  }
  .narratix-avatar-ring {
    width: 32px;
    height: 32px;
  }

  /* Admin badge compact */
  .narratix-admin-badge span {
    display: none !important;
  }
  .narratix-admin-badge {
    padding: 0.35rem;
    width: 32px;
    height: 32px;
    justify-content: center;
    border-radius: 50%;
  }
}

@media (max-width: 380px) {
  .narratix-nav-container {
    padding: 0.55rem 0.65rem;
    gap: 0.35rem;
  }
  .narratix-brand-icon {
    width: 28px;
    height: 28px;
  }
  .narratix-brand-text {
    font-size: 1.1rem;
  }
  .narratix-nav-actions {
    gap: 0.35rem;
  }
  .narratix-nav-actions .narratix-btn-ghost {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }
  .narratix-btn-pwa-nav {
    width: 30px;
    height: 30px;
  }
}

/* Ocultar botones de instalar si la app está en modo PWA instalada */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .narratix-btn-pwa-nav,
  .narratix-mobile-pwa-btn,
  .pwa-install-banner,
  [data-pwa-install] {
    display: none !important;
  }
}

.is-pwa-standalone .narratix-btn-pwa-nav,
.is-pwa-standalone .narratix-mobile-pwa-btn,
.is-pwa-standalone .pwa-install-banner,
.is-pwa-standalone [data-pwa-install] {
  display: none !important;
}

/* =========================================
   Footer Narratix
========================================= */
.narratix-footer {
  margin-top: 6rem;
  padding: 4.5rem 0 3rem;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 16, 28, 0.8) 40%, rgba(9, 10, 16, 0.98) 100%);
  border-top: 1px solid var(--color-border);
}

.narratix-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
}

.narratix-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.narratix-footer-tagline {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
}

.narratix-badge-tech {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  width: fit-content;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s infinite;
}

.narratix-footer-col-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.narratix-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.narratix-footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.narratix-footer-links a:hover {
  color: #fff;
}

.narratix-footer-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.narratix-footer-copyright {
  color: #475569;
  font-size: 0.8rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .narratix-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .narratix-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =========================================
   Efectos Ambientales Globales (Cyber Orbs)
========================================= */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
  max-width: 100vw;
  overflow: hidden;
}

.ambient-glow-1 {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, transparent 70%);
  animation: globalOrbFloat1 16s ease-in-out infinite alternate;
}

.ambient-glow-2 {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.16) 0%, transparent 70%);
  animation: globalOrbFloat2 20s ease-in-out infinite alternate;
}

.ambient-glow-3 {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, transparent 70%);
  animation: globalOrbFloat1 18s ease-in-out infinite alternate-reverse;
}

@keyframes globalOrbFloat1 {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.08); }
  100% { transform: translateY(20px) scale(0.96); }
}

@keyframes globalOrbFloat2 {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(25px) scale(0.95); }
  100% { transform: translateY(-20px) scale(1.06); }
}

/* =========================================================================
   TRANSICIONES DINÁMICAS ENTRE PÁGINAS & VIEW TRANSITIONS API
   ========================================================================= */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: nxViewFadeOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

::view-transition-new(root) {
  animation: nxViewFadeIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes nxViewFadeOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.985) translateY(-8px); }
}

@keyframes nxViewFadeIn {
  from { opacity: 0; transform: scale(1.015) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.nx-page-transition-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366F1, #EC4899, #38BDF8);
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.8), 0 0 28px rgba(99, 102, 241, 0.6);
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.nx-page-transition-bar.is-active {
  width: 78%;
  opacity: 1;
}

.nx-page-transition-bar.is-complete {
  width: 100%;
  opacity: 0;
}

.nx-page-curtain {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(15, 20, 38, 0.55) 0%, rgba(5, 6, 10, 0.85) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99990;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.nx-page-curtain.is-leaving {
  opacity: 1;
}

body.nx-page-ready > main {
  animation: nxMainPageEnter 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

body.nx-page-leaving > main {
  opacity: 0;
  transform: translateY(-10px) scale(0.99);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes nxMainPageEnter {
  0% { opacity: 0; transform: translateY(14px) scale(0.992); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================================
   SPLASH SCREEN SVG ESPECTACULAR (4 SEGUNDOS AL ABRIR LA APP)
   ========================================================================= */
html.nx-splash-lock,
html.nx-splash-lock body {
  overflow: hidden !important;
}

.nx-splash-intro {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: radial-gradient(circle at 50% 42%, #11162B 0%, #060811 65%, #030408 100%);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.5rem;
  box-sizing: border-box;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nx-splash-intro.is-leaving {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.nx-splash-bg-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 72, 153, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(600px) rotateX(45deg);
  animation: nxSplashGridMove 4s linear infinite;
  pointer-events: none;
}

@keyframes nxSplashGridMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 96px; }
}

.nx-splash-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(75px);
  pointer-events: none;
}

.nx-splash-orb-1 {
  width: 340px;
  height: 340px;
  top: 12%;
  left: 18%;
  background: rgba(99, 102, 241, 0.35);
  animation: nxSplashOrbPulse 3.5s ease-in-out infinite alternate;
}

.nx-splash-orb-2 {
  width: 320px;
  height: 320px;
  bottom: 12%;
  right: 18%;
  background: rgba(236, 72, 153, 0.32);
  animation: nxSplashOrbPulse 3.8s ease-in-out infinite alternate-reverse;
}

.nx-splash-orb-3 {
  width: 240px;
  height: 240px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(56, 189, 248, 0.22);
}

@keyframes nxSplashOrbPulse {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.7; }
  100% { transform: scale(1.18) translate(15px, -15px); opacity: 1; }
}

.nx-splash-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 100%;
}

.nx-splash-svg-wrap {
  width: clamp(175px, 42vw, 235px);
  height: clamp(175px, 42vw, 235px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.nx-splash-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.45));
}

.nx-svg-ring-outer {
  transform-origin: 130px 130px;
  animation: nxSpinClockwise 6s linear infinite;
}

.nx-svg-ring-mid {
  transform-origin: 130px 130px;
  animation: nxSpinCounter 4.5s linear infinite;
}

@keyframes nxSpinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes nxSpinCounter {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.nx-svg-hex {
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
  animation: nxDrawStroke 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.nx-svg-branch {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: nxDrawStroke 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

.nx-svg-play-prism {
  transform-origin: 130px 130px;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation:
    nxDrawStroke 1.3s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards,
    nxPrismFloat 2.4s ease-in-out 0.3s infinite alternate;
}

.nx-svg-inner-n {
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
  animation: nxDrawStroke 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.85s forwards;
}

@keyframes nxDrawStroke {
  to { stroke-dashoffset: 0; }
}

@keyframes nxPrismFloat {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.04); }
}

.nx-svg-node,
.nx-svg-apex-dot {
  transform-origin: center;
  transform-box: fill-box;
  opacity: 0;
  animation: nxNodePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s forwards, nxNodePulse 1.6s ease-in-out 1.4s infinite alternate;
}

.nx-svg-node-2 { animation-delay: 1.05s, 1.55s; }
.nx-svg-node-3 { animation-delay: 0.75s, 1.25s; }
.nx-svg-apex-dot { animation-delay: 1.15s, 1.65s; }

@keyframes nxNodePop {
  0% { opacity: 0; transform: scale(0); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes nxNodePulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.26); }
}

.nx-svg-shockwave {
  transform-origin: 130px 130px;
  opacity: 0;
  animation: nxShockwaveExpand 2.2s cubic-bezier(0.16, 1, 0.3, 1) 0.7s infinite;
}

.nx-svg-shockwave-2 {
  animation-delay: 1.7s;
}

@keyframes nxShockwaveExpand {
  0% { transform: scale(0.6); opacity: 0.85; }
  100% { transform: scale(2.15); opacity: 0; }
}

.nx-splash-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(2.1rem, 7vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
  text-shadow: 0 0 28px rgba(99, 102, 241, 0.6);
}

.nx-splash-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) scale(0.85);
  animation: nxLetterReveal 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(0.55s + (var(--i, 0) * 0.08s));
}

.nx-splash-title .nx-splash-dot {
  color: #EC4899;
  text-shadow: 0 0 20px #EC4899;
}

@keyframes nxLetterReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nx-splash-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.72rem, 2.4vw, 0.86rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  backdrop-filter: blur(10px);
  opacity: 0;
  animation: nxLetterReveal 0.6s ease 1.35s forwards;
}

.nx-splash-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 12px #38BDF8;
  animation: pulse 1.2s infinite;
}

.nx-splash-progress-track {
  width: min(260px, 75vw);
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nx-splash-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #6366F1, #EC4899, #38BDF8);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.8);
  animation: nxSplashProgress4s 3.75s cubic-bezier(0.25, 0.8, 0.25, 1) 0.15s forwards;
}

@keyframes nxSplashProgress4s {
  0% { width: 0%; }
  35% { width: 42%; }
  75% { width: 84%; }
  100% { width: 100%; }
}

/* =========================================================================
   BARRA SOCIAL DIRECTA EN TARJETAS DE HISTORIAS (ME GUSTA, NO ME GUSTA, COMPARTIR)
   ========================================================================= */
.nx-card-social-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 4;
}

.nx-card-social-bar.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.nx-card-reactions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nx-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.38rem 0.72rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #CBD5E1;
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  line-height: 1;
  user-select: none;
}

.nx-social-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.nx-social-btn.nx-btn-like.is-active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(99, 102, 241, 0.28) 100%);
  border-color: rgba(236, 72, 153, 0.65);
  color: #F472B6;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.nx-social-btn.nx-btn-dislike.is-active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.nx-social-btn.nx-btn-share {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(56, 189, 248, 0.16) 100%);
  border-color: rgba(99, 102, 241, 0.4);
  color: #E0E7FF;
}

.nx-social-btn.nx-btn-share:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(236, 72, 153, 0.3) 100%);
  border-color: rgba(236, 72, 153, 0.55);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.nx-pop-anim {
  animation: nxButtonPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes nxButtonPop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* =========================================================================
   MODAL GLOBAL DE COMPARTIR Y NOTIFICACIÓN FLOTANTE
   ========================================================================= */
.nx-share-modal {
  position: fixed;
  inset: 0;
  z-index: 999995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.nx-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nx-share-dialog {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  background: linear-gradient(165deg, rgba(19, 24, 42, 0.98) 0%, rgba(10, 13, 24, 0.99) 100%);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 22px;
  padding: 1.65rem 1.4rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.28);
  color: #FFFFFF;
  animation: nxModalZoomIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

@keyframes nxModalZoomIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.nx-share-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #CBD5E1;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.nx-share-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.nx-share-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.nx-share-story-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 0.25rem;
}

.nx-share-story-creator {
  font-size: 0.85rem;
  color: #94A3B8;
  margin: 0 0 1.25rem;
}

.nx-share-networks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.nx-share-net-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #FFFFFF !important;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nx-share-net-btn:hover {
  transform: translateY(-2px);
}

.nx-net-wa { background: linear-gradient(135deg, #10B981, #059669); }
.nx-net-tg { background: linear-gradient(135deg, #0EA5E9, #0284C7); }
.nx-net-fb { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.nx-net-tw { background: linear-gradient(135deg, #334155, #0F172A); }

.nx-share-copy-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nx-share-url-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(6, 8, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  font-size: 0.82rem;
}

.nx-share-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--gradient-brand);
  border: none;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  flex-shrink: 0;
}

.nx-global-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 24px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.55);
  color: #FFFFFF;
  padding: 0.75rem 1.35rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 20px rgba(99, 102, 241, 0.35);
  z-index: 1000001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.nx-global-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 480px) {
  .nx-card-social-bar {
    gap: 0.35rem;
  }
  .nx-social-btn {
    padding: 0.36rem 0.58rem;
    font-size: 0.74rem;
  }
  .nx-share-copy-row {
    flex-direction: column;
  }
  .nx-share-copy-btn {
    width: 100%;
  }
}
