/* =================================================================
 * BIO PAGE DESIGN SYSTEM - ULTRA PREMIUM GLASSMORPHISM & ANIMATIONS
 * Optimized for Cloudflare CDN & High DPI Screens
 * ================================================================= */

:root {
  /* --- DARK THEME (DEFAULT) --- */
  --bg-main: #0a0912;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1538 0%, #0d0a1b 45%, #05040a 100%);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-bg: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(168, 85, 247, 0.45);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  --card-hover-shadow: 0 20px 40px -15px rgba(168, 85, 247, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
  
  --pill-bg: rgba(255, 255, 255, 0.05);
  --pill-border: rgba(255, 255, 255, 0.1);
  --pill-active-bg: linear-gradient(135deg, #a855f7, #6366f1);
  --pill-active-text: #ffffff;

  --toast-bg: rgba(18, 16, 32, 0.9);
  
  --backdrop-blur: blur(16px);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, #eef2ff 0%, #e0e7ff 50%, #f1f5f9 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(224, 231, 255, 0.9);
  --card-hover-bg: rgba(255, 255, 255, 0.98);
  --card-hover-border: rgba(99, 102, 241, 0.6);
  --card-shadow: 0 12px 30px -5px rgba(99, 102, 241, 0.12), inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  --card-hover-shadow: 0 22px 40px -10px rgba(99, 102, 241, 0.25), inset 0 1px 0 0 rgba(255, 255, 255, 1);
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --pill-bg: rgba(255, 255, 255, 0.9);
  --pill-border: rgba(203, 213, 225, 0.8);
  --pill-active-bg: linear-gradient(135deg, #6366f1, #3b82f6);
  --pill-active-text: #ffffff;
  
  --toast-bg: rgba(255, 255, 255, 0.98);
}

/* --- RESET & GLOBAL BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
  padding: 40px 20px 60px;
}

/* --- AMBIENT BACKGROUND --- */
.ambient-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transition: opacity 0.5s ease;
}

.ambient-glow-1 {
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(99, 102, 241, 0) 70%);
}

.ambient-glow-2 {
  bottom: -150px;
  right: 10%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, rgba(59, 130, 246, 0) 70%);
}

/* --- MAIN CONTAINER --- */
.container {
  width: 100%;
  max-width: 640px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-bounce);
  box-shadow: var(--card-shadow);
}

.nav-btn:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.25);
}

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

.icon-svg {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.profile-theme-btn {
  position: absolute;
  top: 50%;
  right: -58px;
  margin-top: -19px;
  z-index: 2;
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

.avatar-container > .profile-theme-btn:hover {
  transform: scale(1.06);
}

/* --- PROFILE HEADER CARD --- */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: 24px;
  padding: 26px 24px 22px;
  text-align: center;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-normal);
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

/* Avatar Wrapper */
.avatar-container {
  position: relative;
  margin-bottom: 28px;
}

.avatar-img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: var(--transition-bounce);
}

.avatar-container:hover .avatar-img {
  transform: scale(1.05) rotate(2deg);
  border-color: var(--accent-purple);
}

/* Status Ring LED Dot */
.status-badge {
  position: absolute;
  bottom: -14px;
  right: 50%;
  transform: translateX(50%);
  background: var(--bg-main);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

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

/* Name & Title */
.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.verified-icon {
  color: #38bdf8;
  width: 1.2rem;
  height: 1.2rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.profile-handle {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.profile-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.profile-bio {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 14px;
}

/* Social Icon Bar */
.socials-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  text-decoration: none;
  transition: var(--transition-bounce);
  position: relative;
}

.social-link:hover {
  transform: translateY(-4px) scale(1.1);
  color: #ffffff;
  background: var(--social-color, var(--accent-purple));
  border-color: var(--social-color, var(--accent-purple));
  box-shadow: 0 8px 20px var(--social-shadow, rgba(168, 85, 247, 0.35));
}

/* --- LINK CARDS LIST --- */
.links-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* --- TURNSTILE GATE --- */
.turnstile-gate {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px 14px;
  padding: 18px 20px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
}

.turnstile-gate-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--accent-emerald);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  font-size: 1.4rem;
}

.turnstile-gate-copy h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  line-height: 1.3;
}

.turnstile-gate-copy p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.turnstile-widget {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.turnstile-gate.is-error .turnstile-gate-icon {
  color: #ef4444;
}

.turnstile-gate.is-preview .turnstile-widget {
  display: none;
  min-height: 0;
}

.link-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--card-shadow);
  transition: var(--transition-normal);
  overflow: hidden;
  cursor: pointer;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transition: left 0.6s ease;
}

.link-card:hover::before {
  left: 100%;
}

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

.link-card.highlight {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  animation: border-glow 3s infinite alternate ease-in-out;
}

@keyframes border-glow {
  0% { border-color: rgba(168, 85, 247, 0.4); box-shadow: 0 0 15px rgba(168, 85, 247, 0.2); }
  100% { border-color: rgba(6, 182, 212, 0.6); box-shadow: 0 0 25px rgba(6, 182, 212, 0.35); }
}

.link-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.link-primary-action {
  color: inherit;
  text-decoration: none;
}

.link-primary-action::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.link-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-purple);
  flex-shrink: 0;
  transition: var(--transition-bounce);
}

.link-card:hover .link-icon-box {
  background: var(--accent-gradient);
  color: #ffffff;
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 6px 15px rgba(168, 85, 247, 0.35);
}

.link-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.link-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  color: #ffffff;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.link-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.link-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  z-index: 2;
}

.link-action-btn:hover {
  color: var(--accent-purple);
  background: var(--pill-bg);
}

.link-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition-bounce);
}

.link-card:hover .link-arrow {
  color: var(--accent-purple);
  transform: translateX(4px);
}

/* --- FOOTER SECTION --- */
.footer {
  text-align: center;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--toast-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  padding: 12px 22px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

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

.toast-icon {
  color: var(--accent-emerald);
  width: 1.1rem;
  height: 1.1rem;
}

/* --- RESPONSIVE ADAPTATIONS --- */
@media (max-width: 480px) {
  body {
    padding: 24px 14px 40px;
    background-attachment: scroll;
  }

  .profile-card {
    padding: 24px 18px 20px;
  }

  .profile-theme-btn {
    top: 50%;
    right: -52px;
  }

  .avatar-img {
    width: 84px;
    height: 84px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .link-card {
    padding: 14px 16px;
  }

  .link-icon-box {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
