/* ══════════════════════════════════════════════════════════════
   SHEIK — Asistente de voz IA de Globalink
   Diseño propio: glassmorphism + degradados cyan/magenta/violeta.
   NO inspirado en el diseño de ninguna otra plataforma — solo en
   el concepto funcional de una llamada con avatar.
   ══════════════════════════════════════════════════════════════ */

:root {
  --sheik-cyan: #00e5ff;
  --sheik-magenta: #c639b8;
  --sheik-violet: #6a1fa8;
  --sheik-gradient: linear-gradient(135deg, var(--sheik-violet), var(--sheik-magenta), var(--sheik-cyan));
}

/* ── Botón flotante ──────────────────────────────────────────── */
#sheikFab {
  position: fixed;
  right: 18px;
  bottom: 90px; /* encima del nav inferior móvil / acceso a CTG */
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sheik-gradient);
  border: none;
  cursor: pointer;
  z-index: 7500;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(106, 31, 168, 0.45), 0 0 0 1px rgba(255,255,255,.08) inset;
  animation: sheikFabFloat 3.4s ease-in-out infinite;
  transition: transform .2s;
}
#sheikFab.sheik-visible { display: flex; }
#sheikFab:active { transform: scale(0.92); }
#sheikFab img, #sheikFab .sheik-fab-fallback {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.5);
}
#sheikFab .sheik-fab-fallback {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15); color: #fff; font-size: 20px;
}
#sheikFab .sheik-fab-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--sheik-cyan); opacity: .55;
  animation: sheikRingPulse 2.2s ease-out infinite;
}
@keyframes sheikFabFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes sheikRingPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.45); opacity: 0; } }

/* ── Overlay de llamada ──────────────────────────────────────── */
#sheikCallOverlay {
  position: fixed; left: 14px; top: 90px; z-index: 9500;
  width: 300px; height: 480px;
  min-width: 240px; min-height: 340px;
  max-width: min(420px, 92vw); max-height: min(640px, 80vh);
  background: radial-gradient(circle at 50% 15%, rgba(106,31,168,.4), rgba(8,6,20,.97) 70%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 0 16px 18px;
  color: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .2s ease;
  overflow: hidden;
}
#sheikCallOverlay.sheik-active { opacity: 1; transform: scale(1); }

/* Encabezado — agarre para mover + control táctil para cambiar el tamaño */
.sheik-mini-header {
  width: calc(100% + 32px); margin: 0 -16px 6px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: grab; touch-action: none; flex-shrink: 0;
}
.sheik-mini-header:active { cursor: grabbing; }
.sheik-mini-header__title {
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.85);
  display: flex; align-items: center; gap: 6px;
}
.sheik-mini-header__actions { display: flex; align-items: center; gap: 6px; }
.sheik-resize-handle {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.08); border: none; color: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  cursor: nwse-resize; touch-action: none;
}
.sheik-resize-handle:active { background: rgba(255,255,255,.18); }

.sheik-call-top { text-align: center; }
.sheik-call-status {
  font-size: 13px; letter-spacing: .4px; color: rgba(255,255,255,.65);
  margin-top: 6px; min-height: 18px;
}

/* ── Avatar de Sheik ─────────────────────────────────────────── */
.sheik-avatar-wrap {
  position: relative;
  width: 240px; height: 240px;
  display: flex; align-items: center; justify-content: center;
  margin: 10px auto;
}
.sheik-avatar-glow {
  position: absolute; inset: 0; border-radius: 24px;
  background: var(--sheik-gradient); filter: blur(22px); opacity: .55;
}
.sheik-avatar-ring {
  position: absolute; inset: -8px; border-radius: 28px;
  border: 2.5px solid transparent;
  background: var(--sheik-gradient) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .8;
}
.sheik-avatar-ring.sheik-state-listening { animation: sheikSpin 3s linear infinite; }
.sheik-avatar-ring.sheik-state-thinking { animation: sheikSpin 1.1s linear infinite; }
.sheik-avatar-ring.sheik-state-speaking { animation: sheikPulseRing .9s ease-in-out infinite; }
@keyframes sheikSpin { to { transform: rotate(360deg); } }
@keyframes sheikPulseRing { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.sheik-avatar-img, .sheik-avatar-fallback {
  width: 100%; height: 100%; border-radius: 22px; object-fit: contain;
  position: relative; z-index: 2;
  border: 3px solid rgba(255,255,255,.65);
  background: transparent;
}
/* Fondo ambiental estilo YouTube: copia del vídeo ampliada y desenfocada
   que rellena las franjas laterales con el color/luz del propio vídeo. */
.sheik-avatar-ambient {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; border-radius: 22px;
  object-fit: cover;                 /* llena todo, recortando */
  filter: blur(18px) saturate(1.4);  /* desenfoque + color vivo */
  transform: scale(1.15);            /* amplía para que el blur no deje bordes */
  opacity: .9; pointer-events: none;
}
.sheik-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1230, #0c0a1a);
  font-size: 36px;
}
.sheik-avatar-img.sheik-state-speaking, .sheik-avatar-fallback.sheik-state-speaking {
  animation: sheikTalk .42s ease-in-out infinite alternate;
}
@keyframes sheikTalk { from { transform: scale(1); } to { transform: scale(1.012); } }

/* Insignia de teléfono — aparece al conectar la llamada, simula que Sheik
   lo sostiene contra la oreja con un meneo suave y constante. */
.sheik-phone-badge {
  position: absolute; right: 8px; top: 8px; z-index: 5;
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#1faa59,#16c172);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
  opacity: 0; transform: scale(0.4) rotate(-18deg);
  transition: opacity .3s, transform .3s;
}
.sheik-phone-badge.sheik-phone-active {
  opacity: 1; transform: scale(1) rotate(-18deg);
  animation: sheikPhoneBob 1.8s ease-in-out infinite;
}
@keyframes sheikPhoneBob {
  0%, 100% { transform: scale(1) rotate(-18deg) translateY(0); }
  50% { transform: scale(1) rotate(-18deg) translateY(-4px); }
}

/* Ondas de voz (mientras Sheik habla) */
.sheik-waves { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; z-index: 3; }
.sheik-waves span {
  width: 4px; height: 10px; border-radius: 2px; background: var(--sheik-cyan);
  animation: sheikWave 0.9s ease-in-out infinite;
}
.sheik-waves span:nth-child(2) { animation-delay: .12s; }
.sheik-waves span:nth-child(3) { animation-delay: .24s; }
.sheik-waves span:nth-child(4) { animation-delay: .36s; }
@keyframes sheikWave { 0%,100% { height: 6px; } 50% { height: 20px; } }
.sheik-waves.sheik-hidden { display: none; }

/* Indicador "pensando" */
.sheik-thinking-dots { display: flex; gap: 5px; justify-content: center; margin-top: 8px; height: 8px; }
.sheik-thinking-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--sheik-magenta);
  animation: sheikDotBounce 1s ease-in-out infinite;
}
.sheik-thinking-dots span:nth-child(2) { animation-delay: .15s; }
.sheik-thinking-dots span:nth-child(3) { animation-delay: .3s; }
.sheik-thinking-dots.sheik-hidden { display: none; }
@keyframes sheikDotBounce { 0%,80%,100% { transform: translateY(0); opacity:.5; } 40% { transform: translateY(-6px); opacity:1; } }

/* ── Usuario (abajo) ──────────────────────────────────────────── */
.sheik-call-mid { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.sheik-user-avatar {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover;
  border: 2px solid rgba(255,255,255,.35);
  background: #0c0a1a;
}
.sheik-user-mic-state { font-size: 11px; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 6px; }
.sheik-mic-dot { width: 8px; height: 8px; border-radius: 50%; background: #444; transition: background .15s; }
.sheik-mic-dot.sheik-mic-active { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.8); animation: sheikMicPulse .8s ease-in-out infinite; }
@keyframes sheikMicPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* Subtítulos */
.sheik-subtitle-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
}
.sheik-subtitle {
  max-width: 100%; text-align: center; font-size: 12px; line-height: 1.35;
  color: rgba(255,255,255,.9); min-height: 16px; padding: 0 6px; flex: 1;
}
.sheik-transcript-toggle {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.55); font-size: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheik-transcript-toggle:active { background: rgba(255,255,255,.18); }

/* ── Controles ────────────────────────────────────────────────── */
.sheik-call-controls { display: flex; align-items: center; justify-content: center; gap: 18px; flex-shrink: 0; }
.sheik-ctrl-btn {
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  color: #fff; transition: transform .15s;
}
.sheik-ctrl-btn:active { transform: scale(0.9); }
.sheik-ctrl-call { background: linear-gradient(135deg,#1faa59,#16c172); box-shadow: 0 6px 20px rgba(31,170,89,.4); }
.sheik-ctrl-hangup { background: linear-gradient(135deg,#ef4444,#b91c1c); box-shadow: 0 6px 20px rgba(239,68,68,.4); }
.sheik-ctrl-mute { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); width: 42px; height: 42px; font-size: 15px; }
.sheik-ctrl-mute.sheik-muted { background: rgba(239,68,68,.25); border-color: rgba(239,68,68,.5); }
.sheik-mini-close {
  background: rgba(255,255,255,.1); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sheik-lang-btn {
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.1); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.sheik-lang-picker {
  position: fixed; z-index: 9900;
  background: rgba(20,12,35,.98); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.sheik-lang-option {
  width: 38px; height: 38px; border-radius: 10px; border: none;
  background: rgba(255,255,255,.06); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sheik-lang-option:active { background: rgba(255,255,255,.18); transform: scale(0.92); }

.sheik-premium-btn {
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ffd76a, #ff9d2f);
  color: #2a1500; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 0 rgba(255,180,60,.6);
  animation: sheikPremiumGlow 2.4s ease-in-out infinite;
}
@keyframes sheikPremiumGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,180,60,.5); }
  50% { box-shadow: 0 0 8px 3px rgba(255,180,60,.55); }
}

/* Tocar el avatar mientras habla = interrumpir */
.sheik-avatar-wrap.sheik-interruptible { cursor: pointer; }
.sheik-tap-hint {
  font-size: 11px; color: rgba(255,255,255,.5); margin-top: 4px; text-align: center;
  min-height: 14px;
}

/* ══════════════════════════════════════════════════════════════
   TIENDA SHEIK — panel, tarjetas, modal de pago
   ══════════════════════════════════════════════════════════════ */
#sheikStoreOverlay {
  position: fixed; left: 14px; top: 90px; z-index: 9600;
  width: 320px; height: 480px;
  max-width: 92vw; max-height: 80vh;
  background: linear-gradient(165deg, rgba(20,12,35,.98), rgba(8,6,20,.98));
  border: 1px solid rgba(255,180,60,.25);
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(0,0,0,.6);
  display: flex; flex-direction: column;
  color: #fff; font-family: 'Outfit', system-ui, sans-serif;
  opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .2s ease;
  overflow: hidden;
}
#sheikStoreOverlay.sheik-active { opacity: 1; transform: scale(1); }

.sheik-store-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sheik-store-tabs { display: flex; gap: 4px; padding: 8px 10px; flex-shrink: 0; overflow-x: auto; }
.sheik-store-tab {
  flex-shrink: 0; padding: 6px 10px; border-radius: 14px; border: none;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.6);
  font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.sheik-store-tab.active { background: linear-gradient(135deg,#ffd76a,#ff9d2f); color: #2a1500; }

.sheik-store-body { flex: 1; overflow-y: auto; padding: 10px 12px 14px; }
.sheik-store-spinner {
  width: 24px; height: 24px; margin: 30px auto;
  border: 3px solid rgba(255,255,255,.15); border-top-color: #ff9d2f; border-radius: 50%;
  animation: sheikSpin 0.8s linear infinite;
}

.sheik-store-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; padding: 10px; margin-bottom: 8px;
}
.sheik-store-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: rgba(0,0,0,.3); flex-shrink: 0; }
.sheik-store-card-voice .sheik-store-voice-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,180,60,.12); display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #ffb13c;
  border: none; cursor: pointer; font-family: inherit; transition: transform .15s, background .15s;
}
.sheik-store-card-voice .sheik-store-voice-icon:active { transform: scale(0.92); }
.sheik-store-card-voice .sheik-store-voice-icon.sheik-voice-playing {
  background: rgba(255,180,60,.28); animation: sheikPremiumGlow 1s ease-in-out infinite;
}
.sheik-store-card-voice .sheik-store-voice-icon.sheik-voice-loading { opacity: .7; cursor: wait; }
.sheik-store-card-info { flex: 1; min-width: 0; }
.sheik-store-card-name { font-size: 12px; font-weight: 700; color: #fff; }
.sheik-store-voice-meta { font-size: 10px; color: rgba(255,255,255,.45); margin-top: 2px; }
.sheik-store-voice-personality { font-size: 10px; color: rgba(255,255,255,.6); font-style: italic; margin-top: 3px; }
.sheik-store-price { font-size: 11px; color: #ffb13c; font-weight: 700; margin-top: 3px; }
.sheik-store-price-free { color: #4caf50; }
.sheik-store-price-eur { color: rgba(255,255,255,.4); font-weight: 400; }
.sheik-store-badge-premium {
  font-size: 8px; font-weight: 800; background: linear-gradient(135deg,#ffd76a,#ff9d2f);
  color: #2a1500; padding: 2px 6px; border-radius: 8px; vertical-align: middle;
}
.sheik-store-badge-free {
  font-size: 8px; font-weight: 800; background: rgba(76,175,80,.2); color: #4caf50;
  padding: 2px 6px; border-radius: 8px; vertical-align: middle;
}

.sheik-store-btn {
  flex-shrink: 0; padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08); color: #fff; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.sheik-store-btn-buy { background: linear-gradient(135deg,#ffd76a,#ff9d2f); color: #2a1500; border: none; }
.sheik-store-btn-applied { background: rgba(76,175,80,.15); color: #4caf50; border-color: rgba(76,175,80,.3); }

.sheik-store-history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,.04); border-radius: 12px; padding: 10px; margin-bottom: 8px;
}

.sheik-store-modal-overlay {
  position: fixed; inset: 0; z-index: 9700;
  background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.sheik-store-modal {
  background: rgba(20,12,35,.98); border: 1px solid rgba(255,180,60,.3);
  border-radius: 18px; padding: 22px; width: 100%; max-width: 280px;
  color: #fff; font-family: 'Outfit', system-ui, sans-serif; text-align: center;
}
.sheik-store-cancel {
  background: none; border: none; color: rgba(255,255,255,.4);
  font-size: 11px; margin-top: 10px; cursor: pointer; font-family: inherit;
}

