/* ==========================================================================
   Wassim Bannour & ProjectLink - Linktree Design System
   ========================================================================== */

:root {
  --bg-main: #07090e;
  --bg-card: rgba(16, 23, 38, 0.65);
  --bg-card-hover: rgba(22, 32, 54, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.35);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-cyan: #00f0ff;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(0, 240, 255, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 60px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient dynamic background glows */
.ambient-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.glow-1 {
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
}

.glow-2 {
  background: radial-gradient(circle, var(--accent-purple), transparent 70%);
  bottom: 0;
  right: -100px;
}

.noise-bg {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

/* Main Container */
.tree-container {
  width: 100%;
  max-width: 580px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Top bar */
.top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.icon-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Profile Card */
.profile-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 18px;
}

.avatar-glow {
  position: absolute;
  inset: -6px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.6;
  animation: pulse-glow 3s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  from { opacity: 0.4; transform: scale(0.95); }
  to { opacity: 0.8; transform: scale(1.05); }
}

.avatar-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
}

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

.avatar-initials {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 28px;
  background: linear-gradient(135deg, #ffffff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
}

.status-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: #0d121c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.profile-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.profile-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag svg {
  width: 12px;
  height: 12px;
  color: var(--accent-cyan);
}

.profile-bio {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 440px;
  margin: 0 auto;
}

/* Link Groups */
.links-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
  margin-bottom: 2px;
}

.group-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

/* Link Cards */
.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 240, 255, 0.15);
}

.link-card:hover::before {
  opacity: 1;
}

/* Highlight Card (PenguinTech) */
.highlight-card {
  border-color: rgba(0, 240, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(16, 23, 38, 0.8));
}

.highlight-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 35px -5px rgba(0, 240, 255, 0.3);
}

/* Card Icons */
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease;
}

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

.card-icon svg {
  width: 22px;
  height: 22px;
}

.cyan-glow { color: var(--accent-cyan); background: rgba(0, 240, 255, 0.12); }
.purple-glow { color: var(--accent-purple); background: rgba(168, 85, 247, 0.12); }
.blue-glow { color: var(--accent-blue); background: rgba(59, 130, 246, 0.12); }
.dark-glow { color: #fff; background: rgba(255, 255, 255, 0.1); }
.amber-glow { color: var(--accent-amber); background: rgba(245, 158, 11, 0.12); }
.facebook-glow { color: #1877f2; background: rgba(24, 119, 242, 0.12); }
.insta-glow { color: var(--accent-pink); background: rgba(236, 72, 153, 0.12); }
.green-glow { color: var(--accent-green); background: rgba(16, 185, 129, 0.12); }
.red-glow { color: #ef4444; background: rgba(239, 68, 68, 0.12); }

/* Card Contents */
.card-content {
  flex: 1;
  min-width: 0;
}

.card-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.card-desc {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.featured-badge {
  background: var(--accent-cyan);
  color: #000;
}

.pdf-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.online-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Arrow */
.card-arrow {
  color: var(--text-muted);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.card-arrow svg {
  width: 18px;
  height: 18px;
}

.link-card:hover .card-arrow {
  color: var(--accent-cyan);
  transform: translate(2px, -2px);
}

/* Save Contact Button */
.contact-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.action-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: all 0.25s ease;
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  box-shadow: 0 10px 25px rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* Footer */
.tree-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.location-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0d121c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.qr-wrapper {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 20px;
}

.btn-primary {
  width: 100%;
  padding: 12px 18px;
  background: var(--accent-cyan);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(13, 18, 28, 0.95);
  border: 1px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(12px);
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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

.toast-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
}

/* Mobile optimizations */
@media (max-width: 480px) {
  body {
    padding: 24px 12px 40px;
  }
  .profile-name {
    font-size: 22px;
  }
  .link-card {
    padding: 12px 14px;
    gap: 12px;
  }
  .card-icon {
    width: 38px;
    height: 38px;
  }
  .card-icon svg {
    width: 18px;
    height: 18px;
  }
}
