/* ==========================================================================
   REDES CONSULTORA - LINKTREE DESIGN SYSTEM
   Modern, Sleek, Responsive & Accessible
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --card-bg: rgba(22, 30, 49, 0.7);
  --card-border: rgba(148, 163, 184, 0.12);
  --card-hover-bg: rgba(30, 41, 69, 0.85);
  --card-hover-border: rgba(56, 189, 248, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-whatsapp: #22c55e;
  --accent-amber: #f59e0b;
  --accent-linkedin: #0a66c2;
  --accent-instagram: #e1306c;

  --glow-1: rgba(56, 189, 248, 0.15);
  --glow-2: rgba(99, 102, 241, 0.12);

  --btn-control-bg: rgba(30, 41, 59, 0.6);
  --btn-control-border: rgba(148, 163, 184, 0.2);
  --btn-control-hover: rgba(51, 65, 85, 0.8);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px -3px rgba(56, 189, 248, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.82);
  --card-border: rgba(148, 163, 184, 0.3);
  --card-hover-bg: rgba(255, 255, 255, 0.98);
  --card-hover-border: rgba(14, 165, 233, 0.6);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;

  --glow-1: rgba(56, 189, 248, 0.2);
  --glow-2: rgba(99, 102, 241, 0.18);

  --btn-control-bg: rgba(255, 255, 255, 0.8);
  --btn-control-border: rgba(203, 213, 225, 0.8);
  --btn-control-hover: #ffffff;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px -3px rgba(14, 165, 233, 0.25);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark light;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 48px;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glows */
.glow-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

.glow-1 {
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 380px;
  background: radial-gradient(circle, var(--glow-1) 0%, transparent 70%);
  animation: pulseSphere 12s infinite alternate ease-in-out;
}

.glow-2 {
  bottom: -150px;
  right: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--glow-2) 0%, transparent 70%);
}

@keyframes pulseSphere {
  0% { transform: translateX(-50%) scale(0.95); opacity: 0.6; }
  100% { transform: translateX(-48%) scale(1.1); opacity: 0.85; }
}

/* Layout Wrapper */
.main-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Top Action Controls */
.top-controls {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-btn {
  background: var(--btn-control-bg);
  border: 1px solid var(--btn-control-border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  background: var(--btn-control-hover);
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Theme Icon Visibility */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Profile Header */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  gap: 16px;
}

.avatar-container {
  position: relative;
}

.avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.avatar-ring:hover {
  transform: scale(1.05) rotate(2deg);
}

.avatar-content {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-emblem {
  width: 60px;
  height: 60px;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.title-with-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 380px;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-size: 0.8rem;
  font-weight: 600;
  color: #22c55e;
  margin-top: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

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

/* Link Cards */
.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

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

/* Featured WhatsApp Card */
.card-featured {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), var(--card-bg));
}

.card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  35%, 100% { left: 100%; }
}

/* Icon Box inside cards */
.card-icon-box {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.link-card:hover .card-icon-box {
  transform: scale(1.08);
}

/* Specific Accent colors */
.whatsapp-accent { color: var(--accent-whatsapp); background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.25); }
.blue-accent { color: var(--accent-cyan); background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.25); }
.purple-accent { color: var(--accent-purple); background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.25); }
.amber-accent { color: var(--accent-amber); background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); }
.linkedin-accent { color: #0077b5; background: rgba(10, 102, 194, 0.12); border-color: rgba(10, 102, 194, 0.25); }
.instagram-accent { color: #e1306c; background: rgba(225, 48, 108, 0.12); border-color: rgba(225, 48, 108, 0.25); }
.mail-accent { color: #38bdf8; background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.25); }

/* Card Content */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.card-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.link-card:hover .card-title {
  color: var(--accent-cyan);
}

.card-featured:hover .card-title {
  color: var(--accent-whatsapp);
}

.card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-popular {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

/* Card Arrow Icon */
.card-arrow {
  color: var(--text-muted);
  opacity: 0.5;
  transition: var(--transition);
}

.link-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(3px);
  color: var(--accent-cyan);
}

/* Social Strip (Bottom Quick Icons) */
.social-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  backdrop-filter: blur(10px);
  margin-top: 8px;
}

.social-icon-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition);
}

.social-icon-link:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

/* Footer */
.profile-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.copyright {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
}

.creator-credit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modal for Services */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

.close-modal-btn:hover {
  color: var(--text-main);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.service-icon {
  font-size: 1.4rem;
}

.service-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.service-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-primary-action {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
}

.btn-primary-action:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 16px 12px 36px;
  }
  
  h1 {
    font-size: 1.45rem;
  }

  .tagline {
    font-size: 0.88rem;
  }

  .link-card {
    padding: 14px 14px;
    gap: 12px;
  }

  .card-icon-box {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card-desc {
    font-size: 0.8rem;
  }
}
