/* ==========================================================================
   SwiftSnip Vault - Modern Soundboard Styling
   ========================================================================== */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111726;
  --bg-card: rgba(23, 31, 48, 0.7);
  --bg-card-hover: rgba(30, 41, 64, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(139, 92, 246, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand-primary: #8b5cf6;
  --brand-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --brand-glow: 0 0 24px rgba(139, 92, 246, 0.35);
  
  --color-gaming: #10b981;
  --color-memes: #ec4899;
  --color-sfx: #f59e0b;
  --color-music: #8b5cf6;
  --color-movies: #3b82f6;
  --color-streamers: #ef4444;
  --color-anime: #f43f5e;
  --color-animals: #84cc16;
  --color-tech: #06b6d4;
  --color-voices: #f97316;
  --color-viral: #6366f1;

  --copyright-warning: #f59e0b;
  --copyright-safe: #10b981;

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

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.4));
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Live Search */
.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 2.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: none;
  border-radius: var(--radius-full);
}

.search-clear:hover {
  color: var(--text-primary);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-nav.active {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.badge-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.btn-stop {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-stop:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Volume control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.volume-slider {
  width: 70px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* ==========================================================================
   Hero Section & Live Statistics
   ========================================================================== */
.hero-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.hero-header {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.hero-title span {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
}

/* Stats Ribbon */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.05);
}

.stat-info .stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Filter Bar & Category Chips
   ========================================================================== */
.controls-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.category-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary) transparent;
}

.category-chips::-webkit-scrollbar {
  height: 4px;
}

.category-chips::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-full);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.chip.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.chip-count {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.25);
}

/* Secondary Controls */
.secondary-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.select-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.select-input option {
  background: #111726;
  color: #fff;
}

.select-input:focus {
  border-color: var(--brand-primary);
}

/* Copyright Toggle Pills */
.copyright-pill-group {
  display: inline-flex;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.2rem;
}

.cr-pill {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cr-pill.active {
  background: var(--brand-primary);
  color: #fff;
}

.cr-pill.active.pill-safe {
  background: #10b981;
}

.cr-pill.active.pill-warning {
  background: #f59e0b;
  color: #000;
}

/* Results Count */
.results-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-summary strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Sound Cards Grid
   ========================================================================== */
.sounds-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

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

.sound-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.sound-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.sound-card.playing {
  border-color: var(--brand-primary);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* 3D Circular Instant Button */
.button-stage {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-ring {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.sound-card.playing .button-ring {
  border-color: var(--brand-primary);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.4;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

.instant-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.12s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  z-index: 2;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4), 0 12px 20px rgba(0, 0, 0, 0.3);
}

.instant-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.45), 0 15px 25px rgba(0, 0, 0, 0.35);
  filter: brightness(1.1);
}

.instant-btn:active,
.sound-card.playing .instant-btn {
  transform: translateY(6px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Sound Details */
.sound-info {
  width: 100%;
  text-align: center;
  margin-bottom: 1rem;
}

.sound-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.7rem;
  text-decoration: none;
}

.sound-title:hover {
  color: #c4b5fd;
}

.sound-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.badge-cat {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-cat:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.badge-cr {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-cr.cr-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.badge-cr.cr-safe {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Specific Action Toolbar */
.card-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.action-btn.active-fav {
  color: #ef4444;
}

.action-btn.active-loop {
  color: var(--brand-primary);
}

/* Waveform Visualizer Animation */
.waveform-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 14px;
}

.sound-card:not(.playing) .waveform-bars {
  display: none;
}

.wave-bar {
  width: 3px;
  height: 100%;
  background: #fff;
  border-radius: 2px;
  animation: wave-anim 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes wave-anim {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* ==========================================================================
   Categorized View (Grouped Sections)
   ========================================================================== */
.categorized-view {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.category-section {
  background: rgba(17, 23, 38, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(8px);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-category-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-category-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ==========================================================================
   Pagination & Load More
   ========================================================================== */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 3rem;
}

.btn-page {
  padding: 0.65rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-page:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  animation: slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes slide-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .nav-actions {
    flex-wrap: wrap;
  }
  .sounds-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
  }
  .sound-card {
    padding: 0.9rem;
  }
  .button-stage {
    width: 75px;
    height: 75px;
  }
  .button-ring {
    width: 75px;
    height: 75px;
  }
  .instant-btn {
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
  }
}
