/* ==========================================================================
   Estilos Premium para Landing Page Linktree (Optimizado para Móviles & Ads)
   ========================================================================== */

/* Variables CSS por defecto (pueden ser modificadas dinámicamente desde JS) */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-color: #0f0f10;
  --bg-image: none;
  --bg-blur: 20px;
  
  /* Tarjeta Central */
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  
  /* Colores de Textos */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  
  /* Botones de Enlace (Por defecto Glassmorphic) */
  --btn-bg: rgba(255, 255, 255, 0.08);
  --btn-border: rgba(255, 255, 255, 0.12);
  --btn-text: #ffffff;
  --btn-hover-bg: rgba(255, 255, 255, 0.15);
  --btn-hover-border: rgba(255, 255, 255, 0.25);
  --btn-hover-text: #ffffff;
  --btn-radius: 16px;
  --btn-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  
  /* Redes Sociales */
  --social-icon-color: rgba(255, 255, 255, 0.8);
  --social-icon-hover: #ffffff;
  
  /* Toast */
  --toast-bg: rgba(20, 20, 22, 0.95);
  --toast-text: #ffffff;
  --toast-border: rgba(255, 255, 255, 0.1);
}

/* Reset de estilos */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fondo Dinámico con Desenfoque (Efecto Glassmorphism Profundo) */
.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: var(--bg-color);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background 0.5s ease;
}

.bg-blur-filter {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  backdrop-filter: blur(var(--bg-blur)) brightness(0.65);
  -webkit-backdrop-filter: blur(var(--bg-blur)) brightness(0.65);
}

/* Estructura Principal */
.app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

/* Tarjeta de Contenido Estilo Teléfono en Escritorio */
.profile-card {
  width: 100%;
  max-width: 580px;
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 32px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Cabecera / Perfil */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
  width: 100%;
}

.avatar-container {
  position: relative;
  margin-bottom: 20px;
}

.avatar-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-img:hover {
  transform: scale(1.05) rotate(3deg);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.profile-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 90%;
  line-height: 1.5;
  font-weight: 400;
}

/* Enlaces / Lista de Botones */
.links-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

/* Enlace Individual */
.link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 24px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  border-radius: var(--btn-radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--btn-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.link-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: 0.75s;
  opacity: 0;
}

.link-btn:hover::after {
  left: 125%;
  opacity: 1;
}

.link-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  color: var(--btn-hover-text);
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.link-btn:active {
  transform: translateY(-1px) scale(1);
}

.link-icon-left {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.link-title {
  flex-grow: 1;
  text-align: center;
  padding: 0 16px;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.link-icon-right {
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
}

.link-btn:hover .link-icon-right {
  opacity: 1;
}

/* Animación Pulse Especial para Enlaces Destacados (Highlighted) */
.link-highlighted {
  animation: pulseGlow 2s infinite ease-in-out;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Redes Sociales */
.socials-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 24px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--social-icon-color);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-btn:hover {
  transform: translateY(-5px) scale(1.1);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--social-icon-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Pie de página */
.footer-container {
  margin-top: auto;
  padding-top: 24px;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-container a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* Botones Superiores Flotantes (Compartir y Logo Cliente) */
.header-actions {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  width: calc(100% - 48px);
  z-index: 10;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Vista de Escritorio: Código QR de Previsualización */
.qr-desktop-card {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 100;
  transition: all 0.3s ease;
  animation: qrFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.qr-desktop-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

.qr-code-img {
  width: 110px;
  height: 110px;
  background: white;
  padding: 6px;
  border-radius: 10px;
}

.qr-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Notificación Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: var(--toast-text);
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Animaciones */
@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes qrFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1), 0 0 0 0px rgba(255, 255, 255, 0.2);
  }
  70% {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15), 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1), 0 0 0 0px rgba(255, 255, 255, 0);
  }
}

/* ==========================================================================
   Responsive Design & Breakpoints
   ========================================================================== */

/* Ocultar el código QR en móviles y tablets en formato vertical */
@media (max-width: 992px) {
  .qr-desktop-card {
    display: none;
  }
}

/* Estilos para móviles (Pantallas pequeñas) */
@media (max-width: 576px) {
  .app-container {
    padding: 0;
    align-items: flex-start;
  }
  
  .profile-card {
    border-radius: 0;
    border: none;
    min-height: 100vh;
    padding: 48px 24px 32px 24px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }
  
  .avatar-img {
    width: 96px;
    height: 96px;
  }
  
  .profile-name {
    font-size: 1.35rem;
  }
  
  .profile-tagline {
    font-size: 0.9rem;
    max-width: 100%;
  }
  
  .link-btn {
    padding: 14px 20px;
    font-size: 0.95rem;
  }
  
  .bg-blur-filter {
    backdrop-filter: blur(12px) brightness(0.6);
    -webkit-backdrop-filter: blur(12px) brightness(0.6);
  }
}
