/* ==========================================================================
   AMRAP MUSIC LINKTREE - MODERN ELEGANT STYLESHEET
   ========================================================================== */

/* 1. VARIABILI CSS & PALETTE COLORI */
:root {
  /* Palette Colori Dark Luxury */
  --bg-main: #090a0f;
  --bg-surface: rgba(20, 24, 34, 0.72);
  --bg-surface-hover: rgba(28, 34, 48, 0.9);
  --bg-surface-active: rgba(36, 44, 62, 0.95);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.24);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);

  /* Music Platform Brand Gradients */
  --icon-spotify: linear-gradient(135deg, #1db954, #1ed760);
  --icon-apple: linear-gradient(135deg, #fc3c44, #f94c57);
  --icon-beatport: linear-gradient(135deg, #01ff95, #00b368);
  --icon-yt: linear-gradient(135deg, #e50914, #ff0000);
  --icon-deezer: linear-gradient(135deg, #a238ff, #ff007a);
  --icon-tidal: linear-gradient(135deg, #001220, #00b4d8);
  --icon-amazon: linear-gradient(135deg, #00a8e1, #0077b6);

  /* Dimensioni & Spaziature */
  --container-max-w: 520px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transizioni */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 16px) env(safe-area-inset-bottom, 24px) env(safe-area-inset-left, 16px);
}

/* 3. EFFETTI DI SFONDO (AMBIENT GLOWS) */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.bg-glow-1 {
  top: -80px;
  left: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  animation: floatGlow 12s ease-in-out infinite alternate;
}

.bg-glow-2 {
  bottom: 8%;
  right: -100px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #01ff95 0%, rgba(1, 255, 149, 0) 70%);
  opacity: 0.22;
  animation: floatGlow 15s ease-in-out infinite alternate-reverse;
}

.bg-glow-3 {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.16) 0%, rgba(0, 0, 0, 0) 70%);
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(45px, 35px) scale(1.18); }
}

/* 4. CONTENITORE PRINCIPALE */
.tree-container {
  width: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* 5. TOP BAR & CONDIVIDI */
.top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.share-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.share-btn:active {
  transform: scale(0.92);
}

/* 6. PROFILO & HEADER */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.2rem;
}

.avatar-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.avatar-ring {
  padding: 4px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #1db954, #6366f1, #fc3c44, #01ff95);
  background-size: 300% 300%;
  animation: gradientShift 6s ease infinite;
  box-shadow: 0 8px 26px var(--accent-glow);
  transition: transform var(--transition-normal);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.avatar-wrapper:hover .avatar-ring {
  transform: scale(1.05);
}

.avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #181c28, #0e111a);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-main);
  overflow: hidden;
}

.music-vinyl-icon {
  font-size: 2.5rem;
  color: #f8fafc;
  animation: spinVinyl 10s linear infinite;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.status-badge {
  position: absolute;
  bottom: 5px;
  right: 6px;
  width: 15px;
  height: 15px;
  background-color: #10b981;
  border: 3px solid var(--bg-main);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.release-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 0.6rem;
}

.profile-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.profile-bio {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
  font-weight: 400;
}

/* 7. LISTA LINK & CASELLE ELEGANTI */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* Luce riflessa soffusa su hover */
.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

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

.link-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.05);
}

.link-card:active {
  transform: scale(0.98);
  background: var(--bg-surface-active);
}

/* Spotify Card Featured */
.link-card.link-featured {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.15), rgba(99, 102, 241, 0.1));
  border-color: rgba(29, 185, 84, 0.45);
  box-shadow: 0 6px 22px rgba(29, 185, 84, 0.2);
}

.link-card.link-featured:hover {
  border-color: rgba(29, 185, 84, 0.8);
  box-shadow: 0 10px 28px rgba(29, 185, 84, 0.35);
}

/* ICON BOX */
.icon-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #ffffff;
  transition: transform var(--transition-fast);
}

.brand-svg {
  width: 22px;
  height: 22px;
  display: block;
}

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

/* Music Platform Specific Accents */
.icon-accent-spotify  { background: var(--icon-spotify);  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.4); }
.icon-accent-apple    { background: var(--icon-apple);    box-shadow: 0 4px 14px rgba(252, 60, 68, 0.4); }
.icon-accent-beatport { background: var(--icon-beatport); color: #000; box-shadow: 0 4px 14px rgba(1, 255, 149, 0.4); }
.icon-accent-yt       { background: var(--icon-yt);       box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4); }
.icon-accent-deezer   { background: var(--icon-deezer);   box-shadow: 0 4px 14px rgba(162, 56, 255, 0.4); }
.icon-accent-tidal    { background: var(--icon-tidal);    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.4); }
.icon-accent-amazon   { background: var(--icon-amazon);   box-shadow: 0 4px 14px rgba(0, 168, 225, 0.4); }

/* LINK TEXT */
.link-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.link-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.link-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ACTION TAG & ARROW */
.link-action {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.action-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.link-card:hover .action-tag {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.link-arrow {
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}

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

/* 8. TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

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

/* 10. MEDIA QUERIES / RESPONSIVITY */

/* Smartphone piccoli (< 380px) */
@media (max-width: 380px) {
  .tree-container {
    padding: 1rem 0.85rem 2rem 0.85rem;
  }
  .profile-name {
    font-size: 1.5rem;
  }
  .icon-box {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 1.15rem;
  }
  .link-title {
    font-size: 0.95rem;
  }
  .link-subtitle {
    font-size: 0.72rem;
  }
  .action-tag {
    display: none; /* Risparmia spazio sui telefoni piccolissimi */
  }
  .link-card {
    padding: 0.85rem 0.95rem;
    gap: 0.75rem;
  }
}

/* Schermi Desktop & Tablet */
@media (min-width: 768px) {
  body {
    padding-top: 40px;
    padding-bottom: 50px;
  }
  .tree-container {
    padding: 2rem 1.5rem 3.5rem 1.5rem;
  }
  .link-card {
    padding: 1.05rem 1.3rem;
  }
}
