/* ================================================
   Traviux UI: tokens compartidos, vidrio y menú lateral
   Paleta: azul Traviux -> cian del logo; el índigo solo
   cierra el brillo difuminado de hover y activo.
   ================================================ */

@font-face {
  font-family: "Phosphor-Fill";
  src: url("https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/fill/Phosphor-Fill.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

:root {
  --tx-brand-700: #154f99;
  --tx-brand-600: #1a61b8;
  --tx-brand-500: #1a85c8;
  --tx-cyan-500: #00a9d6;
  --tx-cyan-400: #00bce5;
  --tx-indigo-500: #6366f1;

  --tx-gradient-brand: linear-gradient(135deg, #1a61b8 0%, #1686cc 55%, #00b0da 100%);
  --tx-gradient-glow: linear-gradient(90deg, #00bce5 0%, #3b82f6 52%, #6366f1 100%);
  --tx-gradient-soft: linear-gradient(135deg, rgba(26, 97, 184, 0.12), rgba(0, 188, 229, 0.1));

  --tx-success: #0e9f77;
  --tx-warning: #c27a12;
  --tx-danger: #d93f4c;

  --tx-ink: #0f1c2e;
  --tx-ink-2: #334155;
  --tx-ink-muted: #64748b;
  --tx-ink-subtle: #94a3b8;
  --tx-brand-ink: #1a61b8;
  --tx-on-brand: #ffffff;

  --tx-glass: rgba(255, 255, 255, 0.6);
  --tx-glass-strong: rgba(255, 255, 255, 0.84);
  --tx-glass-soft: rgba(255, 255, 255, 0.36);
  --tx-glass-border: rgba(255, 255, 255, 0.78);
  --tx-hairline: rgba(15, 40, 80, 0.09);
  --tx-hover: rgba(26, 97, 184, 0.055);
  --tx-active: rgba(26, 97, 184, 0.09);
  --tx-blur: blur(24px) saturate(170%);

  --tx-shadow-sm: 0 1px 2px rgba(15, 40, 80, 0.05), 0 6px 16px -8px rgba(15, 40, 80, 0.16);
  --tx-shadow-md: 0 22px 48px -22px rgba(16, 52, 110, 0.3);
  --tx-shadow-brand: 0 10px 24px -10px rgba(26, 97, 184, 0.55);
  --tx-inset: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --tx-focus-ring: 0 0 0 3px rgba(0, 169, 214, 0.28);

  --tx-radius-sm: 10px;
  --tx-radius-md: 12px;
  --tx-radius-lg: 16px;
  --tx-radius-xl: 22px;

  --tx-glow-blur: 14px;
  --tx-glow-hover: 0.2;
  --tx-glow-active: 0.36;
}

html.dark,
html[data-bs-theme="dark"] {
  --tx-ink: #eef3fa;
  --tx-ink-2: #cbd5e1;
  --tx-ink-muted: #94a3b8;
  --tx-ink-subtle: #64748b;
  --tx-brand-ink: #6cc8f2;

  --tx-glass: rgba(20, 27, 42, 0.58);
  --tx-glass-strong: rgba(26, 35, 54, 0.82);
  --tx-glass-soft: rgba(255, 255, 255, 0.035);
  --tx-glass-border: rgba(255, 255, 255, 0.08);
  --tx-hairline: rgba(255, 255, 255, 0.08);
  --tx-hover: rgba(255, 255, 255, 0.05);
  --tx-active: rgba(56, 160, 230, 0.12);

  --tx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px -10px rgba(0, 0, 0, 0.55);
  --tx-shadow-md: 0 26px 60px -24px rgba(0, 0, 0, 0.75);
  --tx-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --tx-glow-hover: 0.24;
  --tx-glow-active: 0.42;
}

/* Iconos de línea: los animados de Font Awesome necesitan caja propia */
.ph {
  display: inline-block;
}

/* ================================================
   Patrón de brillo difuminado (hover y activo)
   ================================================ */
.tx-glow,
.menu-item,
.tx-menu-row {
  position: relative;
  isolation: isolate;
}

.tx-glow::after,
.menu-item::after,
.tx-menu-row::after {
  position: absolute;
  inset: 3px 8px;
  z-index: -1;
  content: "";
  border-radius: inherit;
  background: var(--tx-gradient-glow);
  filter: blur(var(--tx-glow-blur));
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}

.tx-glow:hover::after,
.menu-item:hover::after,
.tx-menu-row:hover::after {
  opacity: var(--tx-glow-hover);
}

.tx-glow.is-active::after,
.menu-item.active::after {
  opacity: var(--tx-glow-active);
}

/* ================================================
   Botones de marca reutilizables
   ================================================ */
.traviux-menu-primary {
  border: 0;
  background: var(--tx-gradient-brand);
  color: var(--tx-on-brand);
  box-shadow: var(--tx-shadow-brand), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.traviux-menu-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 28px -12px rgba(26, 97, 184, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.traviux-menu-text {
  color: var(--tx-brand-ink);
}

.tx-icon-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--tx-hairline);
  border-radius: var(--tx-radius-sm);
  background: var(--tx-glass-soft);
  color: var(--tx-ink-2);
  font-size: 16px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tx-icon-btn:hover,
.tx-icon-btn:focus-visible {
  border-color: color-mix(in srgb, var(--tx-brand-500) 30%, transparent);
  background: var(--tx-hover);
  color: var(--tx-brand-ink);
  outline: none;
}

.tx-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--tx-hairline);
  border-radius: 999px;
  background: var(--tx-glass-soft);
  color: var(--tx-ink-2);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tx-chip i {
  font-size: 14px;
}

.tx-chip:hover,
.tx-chip:focus-visible {
  border-color: color-mix(in srgb, var(--tx-brand-500) 32%, transparent);
  background: var(--tx-hover);
  color: var(--tx-brand-ink);
  outline: none;
}

/* ================================================
   Menú lateral
   ================================================ */
#sideMenu {
  width: min(320px, 88vw);
  border-left: 1px solid var(--tx-glass-border);
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(0, 188, 229, 0.12), transparent 60%),
    radial-gradient(90% 40% at 100% 100%, rgba(99, 102, 241, 0.1), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.8), rgba(242, 247, 255, 0.68));
  box-shadow: -24px 0 60px -30px rgba(16, 52, 110, 0.35), inset 1px 0 0 rgba(255, 255, 255, 0.6);
  color: var(--tx-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  scrollbar-width: thin;
  scrollbar-color: var(--tx-hairline) transparent;
}

html.dark #sideMenu,
html[data-bs-theme="dark"] #sideMenu {
  border-left-color: rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(0, 188, 229, 0.12), transparent 60%),
    radial-gradient(90% 40% at 100% 100%, rgba(99, 102, 241, 0.14), transparent 60%),
    linear-gradient(160deg, rgba(14, 20, 33, 0.82), rgba(8, 12, 22, 0.76));
  box-shadow: -24px 0 70px -30px rgba(0, 0, 0, 0.85), inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.tx-side-menu-inner {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 20px;
}

/* Deja libre la esquina del botón flotante que abre y cierra el menú */
.tx-side-menu-head {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 6px;
  color: var(--tx-ink-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  body:has(#aiHome) .tx-side-menu-head {
    display: none;
  }
}

/* Tarjeta de perfil */
.tx-profile-card {
  padding: 14px;
  border: 1px solid var(--tx-glass-border);
  border-radius: 18px;
  background: var(--tx-glass);
  box-shadow: var(--tx-shadow-sm), var(--tx-inset);
}

.tx-profile-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 44px;
}

.tx-profile-copy {
  min-width: 0;
  flex: 1;
}

.tx-profile-name {
  overflow: hidden;
  margin: 0;
  color: var(--tx-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-profile-role {
  display: block;
  margin-top: 2px;
  color: var(--tx-ink-muted);
  font-size: 12px;
  font-weight: 500;
}

.tx-profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.profile-avatar-button {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: var(--tx-gradient-brand);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-avatar-button:hover,
.profile-avatar-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--tx-focus-ring);
  outline: none;
}

.profile-avatar-button img {
  width: 100%;
  height: 100%;
  border: 2px solid var(--tx-glass-strong);
  border-radius: 999px;
  background: var(--tx-glass-strong);
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--tx-brand-600);
  color: #ffffff;
  font-size: 11px;
}

html.dark .profile-avatar-edit,
html[data-bs-theme="dark"] .profile-avatar-edit {
  border-color: #121a2a;
}

.profile-avatar-button.is-uploading::before {
  position: absolute;
  inset: 2px;
  content: "";
  border-radius: 999px;
  background: rgba(7, 19, 24, 0.68);
}

.profile-avatar-button.is-uploading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  content: "";
  border: 3px solid rgba(255, 255, 255, 0.36);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: profile-avatar-spin 900ms linear infinite;
}

@keyframes profile-avatar-spin {
  to { transform: rotate(360deg); }
}

.tx-profile-card #theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
}

.tx-profile-card {
  position: relative;
}

/* Plan */
.profile-plan-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-plan-label {
  color: var(--tx-ink-muted);
  font-size: 11px;
  font-weight: 600;
}

.profile-plan-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--tx-brand-500) 26%, transparent);
  border-radius: 999px;
  background: var(--tx-active);
  color: var(--tx-brand-ink);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-plan-badge i {
  font-size: 14px;
}

.profile-plan-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(26, 97, 184, 0.6);
}

.profile-plan-badge.is-premium {
  border-color: rgba(180, 115, 16, 0.4);
  background: linear-gradient(135deg, #fff1a8 0%, #f7c84b 45%, #dca21e 100%);
  color: #573500;
  box-shadow: 0 8px 18px -10px rgba(196, 137, 20, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Selector de tipo de negocio */
.tx-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--tx-hairline);
  border-radius: 14px;
  background: var(--tx-glass-soft);
}

.tx-segmented.hidden {
  display: none;
}

.tx-segmented-option {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--tx-ink-muted);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.tx-segmented-option i {
  font-size: 16px;
}

.tx-segmented-option:hover {
  color: var(--tx-ink);
}

.tx-segmented-option.is-active {
  border-color: var(--tx-glass-border);
  background: var(--tx-glass-strong);
  color: var(--tx-brand-ink);
  box-shadow: var(--tx-shadow-sm);
}

.tx-segmented-option.is-active i {
  font-family: "Phosphor-Fill" !important;
}

/* Selector de hotel */
.tx-field-label {
  display: block;
  margin: 0 4px 6px;
  color: var(--tx-ink-muted);
  font-size: 11px;
  font-weight: 650;
}

.tx-select {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--tx-hairline);
  border-radius: var(--tx-radius-md);
  background: var(--tx-glass-strong);
  color: var(--tx-ink);
  font-size: 13px;
}

.tx-select:focus {
  border-color: var(--tx-cyan-500);
  box-shadow: var(--tx-focus-ring);
  outline: none;
}

/* Secciones y elementos del menú */
.tx-menu-nav {
  display: flex;
  flex-direction: column;
}

.menu-category {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 12px 4px;
}

.menu-group:first-child .menu-category {
  margin-top: 2px;
}

.menu-category-title {
  margin: 0;
  color: var(--tx-ink-subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.menu-category-title i {
  font-size: 12px;
}

.menu-category-line {
  display: none;
}

.tx-menu-list {
  display: grid;
  gap: 2px;
}

.menu-item,
.tx-menu-row {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--tx-radius-md);
  background: transparent;
  color: var(--tx-ink-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.menu-item.hidden,
.tx-menu-row.hidden {
  display: none;
}

.menu-item > i,
.tx-menu-row > i {
  width: 20px;
  flex: 0 0 20px;
  color: var(--tx-ink-muted);
  font-size: 18px;
  text-align: center;
  transition: color 220ms ease, transform 220ms ease;
}

.menu-item:hover,
.tx-menu-row:hover,
.menu-item:focus-visible,
.tx-menu-row:focus-visible {
  background: var(--tx-hover);
  color: var(--tx-ink);
  outline: none;
}

.menu-item:hover > i,
.tx-menu-row:hover > i {
  color: var(--tx-brand-ink);
  transform: scale(1.06);
}

.menu-item:focus-visible,
.tx-menu-row:focus-visible {
  box-shadow: var(--tx-focus-ring);
}

.menu-item.active {
  border-color: var(--tx-glass-border);
  background: var(--tx-glass-strong);
  color: var(--tx-ink);
  font-weight: 600;
  box-shadow: var(--tx-shadow-sm), var(--tx-inset);
}

.menu-item.active > i {
  color: var(--tx-brand-ink);
  font-family: "Phosphor-Fill" !important;
}

/* Interruptor dentro de una fila del menú */
.tx-switch {
  position: relative;
  width: 32px;
  height: 18px;
  flex: 0 0 32px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--tx-hairline);
  box-shadow: inset 0 0 0 1px var(--tx-hairline);
  transition: background 200ms ease;
}

.tx-switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  content: "";
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 40, 80, 0.3);
  transition: transform 200ms ease;
}

.tx-menu-row.is-on .tx-switch {
  background: var(--tx-gradient-brand);
}

.tx-menu-row.is-on .tx-switch::after {
  transform: translateX(14px);
}

.tx-menu-row.is-on > i {
  color: var(--tx-brand-ink);
}

.tx-menu-row.is-danger {
  color: var(--tx-danger);
}

.tx-menu-row.is-danger > i {
  color: currentColor;
}

.tx-menu-row.is-danger::after {
  background: linear-gradient(90deg, #f87171, #d93f4c);
}

html.dark .tx-menu-row.is-danger,
html[data-bs-theme="dark"] .tx-menu-row.is-danger {
  color: #f87171;
}

.trial-locked {
  opacity: 0.5 !important;
}

.trial-locked::before {
  content: "PRO";
  order: 3;
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--tx-active);
  color: var(--tx-brand-ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* Ayuda y pie del menú */
.tx-menu-footer {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--tx-hairline);
}

.tx-help-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--tx-glass-border);
  border-radius: var(--tx-radius-lg);
  background: var(--tx-glass);
  box-shadow: var(--tx-shadow-sm), var(--tx-inset);
  color: var(--tx-ink);
  text-align: left;
  cursor: pointer;
}

.tx-help-card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--tx-gradient-soft);
  color: var(--tx-brand-ink);
  font-size: 18px;
}

.tx-help-card strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.tx-help-card small {
  display: block;
  margin-top: 2px;
  color: var(--tx-ink-muted);
  font-size: 11.5px;
}

.tx-help-card > .ph-caret-right {
  margin-left: auto;
  color: var(--tx-ink-subtle);
}

/* ================================================
   Botón de menú y accesos rápidos
   ================================================ */
#menu-toggle-btn {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

#quickAccessNavbar .tx-quick-bar {
  border: 1px solid var(--tx-glass-border);
  background: var(--tx-glass);
  box-shadow: var(--tx-shadow-sm), var(--tx-inset);
  backdrop-filter: var(--tx-blur);
  -webkit-backdrop-filter: var(--tx-blur);
}

#quickAccessNavbar .tx-quick-btn {
  color: var(--tx-ink-2);
  font-size: 19px;
}

#quickAccessNavbar .tx-quick-btn:not(:disabled):hover {
  background: var(--tx-hover);
  color: var(--tx-brand-ink);
}

/* Isotipo 3D: el lienzo es más grande que el botón para que
   las figuras y el salto no se corten dentro de la barra */
#quickAccessNavbar .tx-logo3d {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

#quickAccessNavbar .tx-logo3d:active {
  cursor: grabbing;
}

#quickAccessNavbar .tx-logo3d:focus-visible {
  outline: none;
  box-shadow: var(--tx-focus-ring);
}

.tx-logo3d__fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.35); /* el ícono trae mucho margen propio */
  transition: opacity 0.25s ease;
}

.tx-logo3d.is-3d .tx-logo3d__fallback {
  opacity: 0;
}

.tx-logo3d__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 180%;
  height: 180%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#quickAccessNavbar .tx-quick-sep {
  width: 1px;
  height: 22px;
  background: var(--tx-hairline);
}

/* Guest navigation previews are decorative; inert removes pointer and keyboard access. */
#sideMenu .menu-item.tx-menu-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
  background: transparent;
}
#sideMenu .menu-item.tx-menu-locked > * {
  filter: blur(3px);
  opacity: .45;
}
#sideMenu .menu-item.tx-menu-locked::after {
  content: '🔒';
  position: absolute;
  inset: 50% 14px auto auto;
  transform: translateY(-50%);
  z-index: 0;
  background: none;
  filter: none;
  transition: none;
  font-size: 12px;
  opacity: .65;
}
.tx-guest-menu-notice {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--tx-hairline);
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
}
.tx-guest-menu-notice p { margin: 4px 0 8px; }
.tx-guest-menu-notice a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
