/* ========================================
   PLAYLIST APP — Premium Dark UI
   ======================================== */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-border: rgba(255, 255, 255, 0.08);

  --text-primary: #f0f0f5;
  --text-secondary: #8b8b9e;
  --text-muted: #5a5a6e;

  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-spotify: #1db954;
  --accent-youtube: #ff0033;
  --accent-like: #ef4444;

  --gradient-primary: linear-gradient(135deg, #a855f7, #06b6d4);
  --gradient-warm: linear-gradient(135deg, #ec4899, #a855f7);
  --gradient-spotify: linear-gradient(135deg, #1db954, #1ed760);
  --gradient-youtube: linear-gradient(135deg, #ff0033, #ff4466);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-purple: 0 0 30px rgba(168, 85, 247, 0.15);
  --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.15);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Ambient Background --- */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-pink);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

/* --- App Container --- */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoPulse 3s ease-in-out infinite;
}

.logo-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-purple);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.3)); }
  50% { filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.4)); }
}

.logo-text h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.track-count-badge {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-base);
}

.track-count-badge #trackCount {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Push Notifications Button --- */
.push-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: 8px 14px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.push-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.08);
}

.push-btn.enabled {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.push-btn.enabled svg {
  stroke: var(--accent-cyan);
}

/* --- Auth Button --- */
.auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: 8px 18px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-btn:hover {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.08);
}

.auth-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.auth-btn.logged-in {
  padding: 5px 14px 5px 5px;
}

.auth-btn.logged-in .auth-btn-text {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Add Section --- */
.add-section {
  margin-bottom: 20px;
}

.add-form {
  position: relative;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
}

.input-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 12px;
}

.input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  padding: 12px 12px 12px 0;
  min-width: 0;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.add-btn {
  flex-shrink: 0;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

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

.add-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.input-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 4px;
}

/* --- Search & Filter --- */
.filter-section {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.search-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: var(--transition-base);
}

.search-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 10px;
}

.search-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 11px 0;
  min-width: 0;
}

.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.search-clear:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.search-clear[hidden] {
  display: none;
}

.filter-wrapper {
  flex-shrink: 0;
}

.user-filter {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 11px 36px 11px 14px;
  cursor: pointer;
  transition: var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b9e' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 140px;
}

.user-filter:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.user-filter option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* --- Tracks Grid --- */
.tracks-section {
  position: relative;
}

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* --- Track Card --- */
.track-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
  animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(16px);
}

@keyframes cardAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.track-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.track-card:hover .track-cover-overlay {
  opacity: 1;
}

.track-cover-wrapper {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-secondary);
}

.track-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.track-card:hover .track-cover {
  transform: scale(1.05);
}

.track-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-base);
}

.play-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: var(--transition-base);
}

.track-card:hover .play-icon {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

.track-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(168, 85, 247, 0.1));
  color: var(--text-muted);
}

.track-info {
  padding: 16px;
}

.track-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.track-artist {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

/* --- Added Info (User + Date) --- */
.track-added-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.track-added-by {
  font-weight: 500;
  color: var(--text-secondary);
}

.track-added-info .track-date::before {
  content: '·';
  margin-right: 6px;
}

.track-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.track-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.source-badge.spotify {
  background: rgba(29, 185, 84, 0.12);
  color: var(--accent-spotify);
}

.source-badge.youtube {
  background: rgba(255, 0, 51, 0.12);
  color: var(--accent-youtube);
}

.source-badge.unknown {
  background: rgba(139, 139, 158, 0.12);
  color: var(--text-secondary);
}

/* --- Like Button --- */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.like-btn:hover {
  color: var(--accent-like);
  background: rgba(239, 68, 68, 0.08);
}

.like-btn.liked {
  color: var(--accent-like);
}

.like-btn.like-pop {
  animation: likePop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes likePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.like-count {
  min-width: 8px;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 2;
}

.track-card:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
}

/* --- Loading State --- */
.loading-state {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.loading-pulse {
  aspect-ratio: 0.82;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-pulse:nth-child(2) { animation-delay: 0.15s; }
.loading-pulse:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.15; }
}

.loading-state[hidden] {
  display: none;
}

/* --- Auth Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.25s ease;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(168, 85, 247, 0.08);
  animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: flex;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.modal-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-tab:hover {
  color: var(--text-primary);
}

.modal-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 12px 14px;
  transition: var(--transition-base);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: #f87171;
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.form-error[hidden] {
  display: none;
}

.auth-submit-btn {
  width: 100%;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success {
  border-color: rgba(29, 185, 84, 0.3);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.toast.removing {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

/* --- Card Remove Animation --- */
.track-card.removing {
  animation: cardRemove 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes cardRemove {
  to {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .app-container {
    padding: 24px 16px 60px;
  }

  .header {
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .logo-text h1 {
    font-size: 1.4rem;
  }

  .filter-section {
    flex-direction: column;
    gap: 10px;
  }

  .user-filter {
    width: 100%;
  }

  .tracks-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .loading-state {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .track-info {
    padding: 12px;
  }

  .track-title {
    font-size: 0.85rem;
  }

  .track-artist {
    font-size: 0.75rem;
  }

  .blob-1 {
    width: 300px;
    height: 300px;
  }

  .blob-2 {
    width: 250px;
    height: 250px;
  }

  .blob-3 {
    width: 200px;
    height: 200px;
  }

  .toast-container {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  .toast {
    max-width: 100%;
  }

  .delete-btn {
    opacity: 1;
  }

  .modal {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .tracks-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .loading-state {
    grid-template-columns: 1fr 1fr;
  }

  .add-btn {
    padding: 12px 20px;
  }

  .input-wrapper {
    padding-left: 14px;
  }

  .header-right {
    gap: 8px;
  }

  .track-count-badge {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .auth-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .track-added-info {
    font-size: 0.68rem;
  }

  .track-meta-left {
    gap: 4px;
  }
}
