/* ==========================================================================
   BIFRÖST NETWORK S.A.S. - Linktree Stylesheet
   Brand Colors:
     - Electric Blue: #0011FF
     - Radiant Orange: #FE5000
   Font Family: General Sans (Official Brand Typography)
   ========================================================================== */

/* 1. Official Typography Setup */
@font-face {
  font-family: 'General Sans';
  src: url('../assets/fonts/GeneralSans_Complete/Fonts/WEB/fonts/GeneralSans-Variable.woff2') format('woff2'),
       url('../assets/fonts/GeneralSans_Complete/Fonts/WEB/fonts/GeneralSans-Variable.woff') format('woff'),
       url('../assets/fonts/GeneralSans_Complete/Fonts/WEB/fonts/GeneralSans-Variable.ttf') format('truetype');
  font-weight: 200 700;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'General Sans';
  src: url('../assets/fonts/GeneralSans_Complete/Fonts/WEB/fonts/GeneralSans-VariableItalic.woff2') format('woff2'),
       url('../assets/fonts/GeneralSans_Complete/Fonts/WEB/fonts/GeneralSans-VariableItalic.woff') format('woff');
  font-weight: 200 700;
  font-display: swap;
  font-style: italic;
}

/* 2. Color System & Design Tokens */
:root {
  /* Brand Constants */
  --bifrost-blue: #0011FF;
  --bifrost-blue-glow: rgba(0, 17, 255, 0.28);
  --bifrost-orange: #FE5000;
  --bifrost-orange-glow: rgba(254, 80, 0, 0.32);
  --whatsapp-color: #25D366;
  --whatsapp-dark: #128C7E;
  --whatsapp-glow: rgba(37, 211, 102, 0.35);

  /* Light Theme (Default for [data-theme="light"]) */
  --bg-gradient: radial-gradient(135% 100% at 50% 0%, #EBF1FD 0%, #F5F7FD 45%, #F0F4FC 100%);
  --bg-dots: radial-gradient(rgba(0, 17, 255, 0.06) 1.5px, transparent 1.5px);
  --ambient-orb-1: radial-gradient(circle, rgba(0, 17, 255, 0.12) 0%, transparent 70%);
  --ambient-orb-2: radial-gradient(circle, rgba(254, 80, 0, 0.1) 0%, transparent 65%);

  --card-bg: rgba(255, 255, 255, 0.85);
  --card-hover-bg: rgba(255, 255, 255, 0.98);
  --card-border: rgba(0, 17, 255, 0.12);
  --card-hover-border: rgba(0, 17, 255, 0.35);
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --card-hover-shadow: 0 14px 30px -4px rgba(0, 17, 255, 0.12), 0 6px 12px -2px rgba(0, 17, 255, 0.06);

  --text-primary: #0B1120;
  --text-secondary: #334155;
  --text-muted: #64748B;

  --badge-bg: rgba(0, 17, 255, 0.08);
  --badge-text: #0011FF;
  --badge-border: rgba(0, 17, 255, 0.18);

  --control-bg: rgba(255, 255, 255, 0.85);
  --control-border: rgba(15, 23, 42, 0.1);
  --control-hover: rgba(255, 255, 255, 1);
  --control-text: #0B1120;

  --footer-border: rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-gradient: radial-gradient(135% 100% at 50% 0%, #0c1124 0%, #060814 50%, #030409 100%);
  --bg-dots: radial-gradient(rgba(255, 255, 255, 0.06) 1.5px, transparent 1.5px);
  --ambient-orb-1: radial-gradient(circle, rgba(0, 17, 255, 0.22) 0%, transparent 70%);
  --ambient-orb-2: radial-gradient(circle, rgba(254, 80, 0, 0.16) 0%, transparent 65%);

  --card-bg: rgba(15, 21, 38, 0.75);
  --card-hover-bg: rgba(21, 29, 52, 0.9);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover-border: rgba(0, 17, 255, 0.5);
  --card-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.5);
  --card-hover-shadow: 0 16px 36px -4px rgba(0, 17, 255, 0.25), 0 0 20px rgba(0, 17, 255, 0.15);

  --text-primary: #FFFFFF;
  --text-secondary: #CBD5E1;
  --text-muted: #8493A8;

  --badge-bg: rgba(0, 17, 255, 0.2);
  --badge-text: #6B7CFF;
  --badge-border: rgba(0, 17, 255, 0.4);

  --control-bg: rgba(255, 255, 255, 0.08);
  --control-border: rgba(255, 255, 255, 0.15);
  --control-hover: rgba(255, 255, 255, 0.18);
  --control-text: #FFFFFF;

  --footer-border: rgba(255, 255, 255, 0.08);
}

/* 3. Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'General Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #060814;
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
  transition: background-image 0.4s ease, color 0.3s ease;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 4. Ambient Background (Fiber-optic network inspiration) */
.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-size: 28px 28px;
  background-image: var(--bg-dots);
  mask-image: radial-gradient(ellipse at 50% 20%, rgba(0,0,0,0.85) 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, rgba(0,0,0,0.85) 20%, transparent 80%);
  opacity: 0.65;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}

.ambient-orb-top {
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 550px;
  height: 400px;
  background: var(--ambient-orb-1);
}

.ambient-orb-bottom {
  bottom: 5%;
  right: -100px;
  width: 400px;
  height: 400px;
  background: var(--ambient-orb-2);
}

/* 5. App Shell & Layout */
.app-container {
  width: 100%;
  max-width: 480px;
  padding: 1.5rem 1.25rem 2.5rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 6. Top Control Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  position: relative;
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #10B981;
  opacity: 0.6;
  animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.top-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.icon-btn:hover {
  background: var(--control-hover);
  transform: translateY(-1px);
  border-color: var(--bifrost-blue);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--bifrost-blue);
  outline-offset: 2px;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 7. Profile / Header */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo-wrapper {
  position: relative;
  margin-bottom: 1.25rem;
  padding: 0.5rem;
}

.brand-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bifrost-blue-glow) 0%, var(--bifrost-orange-glow) 60%, transparent 80%);
  filter: blur(20px);
  opacity: 0.7;
  pointer-events: none;
  animation: halo-float 6s ease-in-out infinite alternate;
}

@keyframes halo-float {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 0.85; }
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: 175px;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.12));
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.verified-badge {
  display: inline-flex;
  color: #0011FF;
}

[data-theme="dark"] .verified-badge {
  color: #4361EE;
}

.brand-tagline {
  font-size: 0.925rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.45;
}

.brand-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.feature-tag {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(0, 17, 255, 0.06);
  border: 1px solid rgba(0, 17, 255, 0.12);
  color: var(--text-secondary);
}

[data-theme="dark"] .feature-tag {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* 8. Links Section */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

/* Base Link Card */
.link-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.link-card:focus-visible {
  outline: 2px solid var(--bifrost-blue);
  outline-offset: 3px;
}

.link-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-3px) scale(1.01);
}

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

/* Link Card Content Structure */
.card-icon-container {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  position: relative;
  transition: transform 0.25s ease;
}

.link-card:hover .card-icon-container {
  transform: scale(1.08) rotate(-2deg);
}

.card-text-container {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-arrow {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  margin-left: 0.75rem;
  transition: all 0.25s ease;
}

[data-theme="dark"] .card-arrow {
  background: rgba(255, 255, 255, 0.06);
}

.link-card:hover .card-arrow {
  color: var(--text-primary);
  background: var(--bifrost-blue);
  color: #FFFFFF;
  transform: translateX(3px);
}

/* ==========================================================================
   9. PRIMARY HERO CTA: WHATSAPP (DESTACADO SOBRE LOS DEMÁS)
   ========================================================================== */
.link-card.primary-whatsapp {
  padding: 1.35rem 1.35rem 1.25rem;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.12) 0%, rgba(0, 17, 255, 0.08) 100%), var(--card-bg);
  border: 1.5px solid rgba(37, 211, 102, 0.45);
  box-shadow: 0 8px 30px -4px rgba(37, 211, 102, 0.25), 0 0 25px -5px rgba(37, 211, 102, 0.15);
  position: relative;
  overflow: visible;
}

[data-theme="dark"] .link-card.primary-whatsapp {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.16) 0%, rgba(0, 17, 255, 0.14) 100%), rgba(16, 26, 42, 0.85);
  border-color: rgba(37, 211, 102, 0.55);
  box-shadow: 0 10px 35px -4px rgba(37, 211, 102, 0.3), 0 0 35px rgba(37, 211, 102, 0.2);
}

/* Floating Priority Banner */
.priority-ribbon {
  position: absolute;
  top: -11px;
  left: 20px;
  background: linear-gradient(90deg, #10B981, #25D366);
  color: #FFFFFF;
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
}

.priority-ribbon svg {
  animation: lightning-wiggle 2.5s ease-in-out infinite;
}

@keyframes lightning-wiggle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(6deg); }
}

.primary-whatsapp .card-icon-container {
  width: 54px;
  height: 54px;
  min-width: 54px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.primary-whatsapp:hover {
  border-color: #25D366;
  box-shadow: 0 16px 40px -4px rgba(37, 211, 102, 0.4), 0 0 30px rgba(37, 211, 102, 0.3);
  transform: translateY(-4px) scale(1.02);
}

.primary-whatsapp .card-title {
  font-size: 1.075rem;
  font-weight: 700;
  color: var(--text-primary);
}

.online-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.14);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

[data-theme="dark"] .online-tag {
  color: #34D399;
  background: rgba(16, 185, 129, 0.22);
}

.primary-whatsapp .card-subtitle {
  color: var(--text-secondary);
  font-weight: 500;
}

.primary-whatsapp .card-arrow {
  background: #25D366;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
}

.primary-whatsapp:hover .card-arrow {
  background: #128C7E;
  transform: translateX(4px);
}

/* Secondary Cards Custom Icons */
.web-card .card-icon-container {
  background: linear-gradient(135deg, #0011FF 0%, #3B82F6 100%);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(0, 17, 255, 0.25);
}

.instagram-card .card-icon-container {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(214, 36, 159, 0.25);
}

/* 10. Direct Action CTA Bar */
.action-banner {
  margin-top: 0.5rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(0, 17, 255, 0.04);
  border: 1px dashed rgba(0, 17, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .action-banner {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

.action-banner-text {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.action-banner-text strong {
  color: var(--text-primary);
  display: block;
  font-weight: 600;
}

.action-banner-phone {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--bifrost-orange);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: rgba(254, 80, 0, 0.1);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.action-banner-phone:hover {
  background: var(--bifrost-orange);
  color: #FFFFFF;
}

/* 11. Footer */
.app-footer {
  margin-top: auto;
  padding-top: 2.5rem;
  text-align: center;
  border-top: 1px solid var(--footer-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.footer-isp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--bifrost-blue);
  font-weight: 600;
  margin-top: 0.25rem;
}

[data-theme="dark"] .footer-isp-badge {
  color: #6B7CFF;
}

/* 12. Floating Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  color: #FFFFFF;
  padding: 0.75rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .toast-notice {
  background: rgba(11, 17, 32, 0.92);
  color: #FFFFFF;
}

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

/* 13. Responsive Adaptations */
@media (max-width: 400px) {
  .app-container {
    padding: 1.25rem 1rem 2rem;
  }
  .brand-logo {
    width: 155px;
  }
  .link-card {
    padding: 1rem 1.1rem;
  }
  .card-icon-container {
    width: 44px;
    height: 44px;
    min-width: 44px;
    margin-right: 0.85rem;
  }
  .card-title {
    font-size: 0.95rem;
  }
  .card-subtitle {
    font-size: 0.75rem;
  }
}

/* 14. Motion Reduction (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
