/* ==========================================================
   IFIX MEDICAL SOLUTIONS — Link Hub
   Estética: "Dark Tech Medical" · Glassmorphism refinado
   Paleta original conservada · Efectos automáticos sobrios
   ========================================================== */

/* ----------------------------------------------------------
   1. VARIABLES & PALETA
   ---------------------------------------------------------- */
:root {
  --brand-blue: #0056b3;
  --brand-cyan: #00d2ff;
  --bg-dark: #07101d;

  /* CRISTAL OSCURO: Resalta perfectamente sobre la imagen nítida */
  --glass-bg: rgba(5, 15, 30, 0.65);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-hover: rgba(10, 25, 45, 0.85);

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --wpp: #25d366;

  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ----------------------------------------------------------
   2. BASE
   ---------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  color: var(--text-primary);
  background: var(--bg-dark);
  position: relative;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   3. FONDOS — Imagen 100% nítida con paneo animado
   ---------------------------------------------------------- */
.bg-image {
  position: fixed;
  inset: -5%;
  width: 110%;
  height: 110%;
  background-image: url('../img/fondo_redes_sociales.jpg');
  background-size: cover;
  background-position: center;
  z-index: -3;
  animation: slowPan 28s ease-in-out infinite alternate;
  opacity: 1;
}

/* Sombra en los extremos (arriba y abajo) para no perder legibilidad,
   dejando el centro de la imagen totalmente transparente y limpio */
.bg-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
  rgba(3, 11, 24, 0.8) 0%,
  rgba(3, 11, 24, 0.2) 25%,
  transparent 50%,
  rgba(3, 11, 24, 0.4) 75%,
  rgba(3, 11, 24, 0.95) 100%
  );
  pointer-events: none;
}

/* ----------------------------------------------------------
   4. CONTENEDOR
   ---------------------------------------------------------- */
.app-container {
  width: 100%;
  max-width: 480px;
  padding: 54px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

/* ----------------------------------------------------------
   5. CABECERA
   ---------------------------------------------------------- */
.profile-section {
  text-align: center;
  width: 100%;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeDown 1s var(--ease-soft) forwards;
}

.avatar-glow {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 20px;
  border-radius: 50%;
  padding: 3px;
  background: var(--bg-dark);
  box-shadow: 0 0 26px rgba(0, 210, 255, 0.28);
  animation: floatingAvatar 5s ease-in-out infinite, pulseGlow 3.5s ease-in-out infinite alternate;
}

.avatar-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from var(--angle),
  var(--brand-cyan), var(--brand-blue), transparent 55%, var(--brand-cyan));
  animation: spinAngle 6s linear infinite;
  z-index: -1;
}

.avatar-container {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.brand-name {
  font-family: 'Sora', sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, var(--brand-cyan), #ffffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineText 6s linear infinite;
  filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.8)) drop-shadow(0px 0px 10px rgba(0, 0, 0, 0.5));
}

.brand-subtitle {
  font-size: 12.5px;
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.9), 0px 0px 8px rgba(0, 0, 0, 0.6);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #b6f5d0;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.22);
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wpp);
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: livePing 2s ease-out infinite;
}

.divider {
  width: 44px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-cyan), transparent);
  margin: 22px auto 0;
  border-radius: 2px;
  box-shadow: 0 0 12px var(--brand-cyan);
}

/* ----------------------------------------------------------
   6. BOTONES GLASSMORPHISM
   ---------------------------------------------------------- */
.links-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.glass-btn {
  --net: var(--brand-cyan);
  --net-ink: #062235;
  --net-soft: rgba(0, 210, 255, 0.14);
  --net-glow: rgba(0, 210, 255, 0.45);

  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 15px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease),
  border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  opacity: 0;
  transform: translateY(22px);
  animation: fadeUp 0.7s var(--ease-soft) forwards;
  animation-delay: var(--delay);
}

.glass-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s var(--ease);
  pointer-events: none;
}

.glass-btn:hover::after { left: 130%; }

.btn-icon-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  color: var(--brand-cyan);
  font-size: 18px;
  transition: all 0.4s var(--ease);
}

.btn-text {
  flex-grow: 1;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.btn-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-arrow {
  color: rgba(255, 255, 255, 0.22);
  font-size: 13px;
  transition: all 0.4s var(--ease);
}

.glass-btn:hover {
  background: var(--glass-hover);
  border-color: var(--net);
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35), 0 0 18px var(--net-soft);
}

.glass-btn:hover .btn-icon-wrapper {
  background: var(--net);
  color: var(--net-ink);
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 0 16px var(--net-glow);
}

.glass-btn:hover .btn-arrow {
  color: var(--net);
  transform: translateX(4px);
}

/* ----------------------------------------------------------
   6b. PALETAS DE MARCA POR RED
   ---------------------------------------------------------- */
.net-instagram {
  --net: #d62976;
  --net-ink: #ffffff;
  --net-soft: rgba(214, 41, 118, 0.22);
  --net-glow: rgba(214, 41, 118, 0.5);
}
.net-instagram:hover .btn-icon-wrapper {
  background: linear-gradient(45deg,
  #feda75 0%, #fa7e1e 28%, #d62976 55%, #962fbf 78%, #4f5bd5 100%);
  color: #ffffff;
}

.net-facebook {
  --net: #1877f2;
  --net-ink: #ffffff;
  --net-soft: rgba(24, 119, 242, 0.22);
  --net-glow: rgba(24, 119, 242, 0.5);
}

.net-tiktok {
  --net: #25f4ee;
  --net-ink: #06201f;
  --net-soft: rgba(37, 244, 238, 0.2);
  --net-glow: rgba(37, 244, 238, 0.5);
}
.net-tiktok:hover {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35),
  -3px 0 14px rgba(254, 44, 85, 0.28),
  3px 0 14px rgba(37, 244, 238, 0.22);
}

.net-linkedin {
  --net: #0a66c2;
  --net-ink: #ffffff;
  --net-soft: rgba(10, 102, 194, 0.22);
  --net-glow: rgba(10, 102, 194, 0.5);
}

/* ----------------------------------------------------------
   7. BOTONES DESTACADOS
   ---------------------------------------------------------- */
.feature-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle),
  transparent 0deg,
  var(--ring-color) 60deg,
  transparent 130deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spinAngle 5s linear infinite;
  pointer-events: none;
}

/* --- Contáctanos / WhatsApp --- */
.whatsapp-highlight {
  --ring-color: var(--wpp);
  background: var(--glass-bg);
  border-color: rgba(37, 211, 102, 0.35);
  animation: fadeUp 0.7s var(--ease-soft) forwards,
  gentlePulse 3s ease-in-out infinite alternate 1.2s;
}

.whatsapp-highlight .wpp-icon {
  color: var(--wpp);
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.15);
}

.wpp-icon .live-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--wpp);
  border: 2px solid var(--bg-dark);
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  animation: livePing 2s ease-out infinite;
}

.whatsapp-highlight:hover {
  background: var(--glass-hover);
  border-color: var(--wpp);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4), 0 0 22px rgba(37, 211, 102, 0.25);
}

.whatsapp-highlight:hover .wpp-icon {
  background: var(--wpp);
  color: #042a14;
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.5);
}

/* --- Sitio Web Oficial --- */
.website-highlight {
  --ring-color: var(--brand-cyan);
  background: linear-gradient(135deg, rgba(0, 86, 179, 0.28), rgba(0, 210, 255, 0.06));
  border-color: rgba(0, 210, 255, 0.28);
}

.website-highlight .btn-icon-wrapper {
  color: var(--brand-cyan);
  background: rgba(0, 210, 255, 0.14);
  border-color: rgba(0, 210, 255, 0.22);
}

.website-highlight .shine {
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-20deg);
  animation: shimmerSlide 4.5s ease-in-out infinite 2s;
  pointer-events: none;
}

.website-highlight:hover {
  border-color: var(--brand-cyan);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35), 0 0 22px rgba(0, 210, 255, 0.28);
}

.website-highlight:hover .btn-icon-wrapper {
  background: var(--brand-cyan);
  color: #062235;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.5);
}

/* ----------------------------------------------------------
   8. PIE
   ---------------------------------------------------------- */
.app-footer {
  margin-top: 26px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-soft) forwards;
  animation-delay: 0.85s;
}

.app-footer i { color: var(--brand-cyan); }

/* ----------------------------------------------------------
   9. KEYFRAMES
   ---------------------------------------------------------- */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(28px); }  to { opacity: 1; transform: translateY(0); } }

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

@keyframes pulseGlow {
  from { box-shadow: 0 0 16px rgba(0, 210, 255, 0.16); }
  to   { box-shadow: 0 0 30px rgba(0, 210, 255, 0.4); }
}

@keyframes spinAngle { to { --angle: 360deg; } }

@keyframes livePing {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70%  { box-shadow: 0 0 0 9px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@keyframes gentlePulse {
  0%   { transform: scale(1); }
  100% { transform: scale(1.015); }
}

@keyframes slowPan {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.06) translate(-1.5%, -1.5%); }
}

@keyframes shineText { to { background-position: 200% center; } }

@keyframes shimmerSlide {
  0%   { left: -60%; }
  45%  { left: 160%; }
  100% { left: 160%; }
}

/* ----------------------------------------------------------
   9b. MODAL DESCARGA DE APP · Efecto "liquid glass"
   ---------------------------------------------------------- */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 9, 18, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-soft), visibility 0.45s var(--ease-soft);
}

.app-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ----- Tarjeta LIQUID GLASS ----- */
.app-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 34px 26px 26px;
  text-align: center;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
    radial-gradient(120% 90% at 20% 0%, rgba(0, 210, 255, 0.14), transparent 55%),
    rgba(10, 22, 40, 0.35);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(26px) scale(0.94);
  opacity: 0;
  transition: transform 0.5s var(--ease-soft), opacity 0.5s var(--ease-soft);
}

.app-modal-overlay.is-open .app-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.app-modal-hide {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.app-modal-hide:hover { background: rgba(255, 255, 255, 0.18); color: #fff; transform: rotate(90deg); }

.app-modal-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 30px;
  color: var(--brand-cyan);
  background: rgba(0, 210, 255, 0.14);
  border: 1px solid rgba(0, 210, 255, 0.28);
  box-shadow: 0 0 26px rgba(0, 210, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.app-modal-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 21px;
  color: #fff;
  margin-bottom: 8px;
}

.app-modal-sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 auto 22px;
  max-width: 280px;
}

.app-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.app-modal-later {
  display: block;
  margin: 18px auto 0;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.app-modal-later:hover { color: var(--text-secondary); }

/* ----- Botón flotante (estado minimizado) ----- */
.app-launcher {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(0, 210, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(0, 86, 179, 0.5);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 210, 255, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  transform: translateY(120%) scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.5s var(--ease-soft), opacity 0.5s var(--ease-soft),
              visibility 0.5s var(--ease-soft), box-shadow 0.3s var(--ease);
}

.app-launcher.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  animation: gentlePulse 3s ease-in-out infinite alternate 1s;
}

.app-launcher:hover {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 28px rgba(0, 210, 255, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.app-launcher i { font-size: 17px; color: var(--brand-cyan); }

/* ----- Botones de tienda (compartidos por modal y flotante) ----- */
.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  transition: all 0.3s var(--ease);
}
.app-store-btn:hover { transform: translateY(-2px); border-color: var(--brand-cyan); }
.app-store-btn i { font-size: 20px; }

.store-labels { display: flex; flex-direction: column; line-height: 1.1; }
.store-top { font-size: 8.5px; letter-spacing: 0.6px; color: var(--text-secondary); text-transform: uppercase; }
.store-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 13px; }

.store-ios:hover { box-shadow: 0 6px 16px rgba(255, 255, 255, 0.12); }
.store-android:hover { box-shadow: 0 6px 16px rgba(0, 210, 255, 0.2); }

/* En pantallas muy estrechas, compacta modal y flotante */
@media (max-width: 420px) {
  .app-modal { padding: 30px 20px 22px; border-radius: 24px; }
  .app-modal-icon { width: 58px; height: 58px; font-size: 26px; }
  .app-modal-title { font-size: 19px; }
  .app-modal-sub { font-size: 12.5px; }
  .app-modal-actions { flex-direction: column; }
  .app-store-btn { width: 100%; justify-content: center; }

  .app-launcher { padding: 11px 15px; font-size: 12.5px; }
}

/* ----------------------------------------------------------
   10. ACCESIBILIDAD
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .glass-btn, .qr-card, .profile-section, .app-footer { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------
   11. RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 420px) {
  .app-container { padding: 42px 16px 32px; }
  .avatar-glow { width: 98px; height: 98px; }
  .brand-name { font-size: 22px; }
  .brand-subtitle { font-size: 11.5px; letter-spacing: 1.6px; }
  .glass-btn { padding: 14px 15px; }
  .btn-text { font-size: 14px; }
  .btn-icon-wrapper { width: 38px; height: 38px; font-size: 16px; margin-right: 12px; }
  .qr-frame { width: 150px; height: 150px; }

  .bg-image {
    background-position: top center;
    top: -15% !important;
  }
}
