/* OXAHO Music - Global Styles
   Coherent with Studio Overdub dark DAW aesthetic
   Modern, musical, independent platform
*/

:root {
  /* Core Dark Theme (match Studio Overdub) */
  --bg-app: #0d0d0f;
  --bg-panel: #141416;
  --bg-panel-raised: #1a1a1e;
  --bg-card: #18181c;
  --bg-input: #0a0a0c;

  --border-subtle: #2a2a30;
  --border-medium: #3a3a42;

  --text-primary: #e8e8ec;
  --text-secondary: #9898a4;
  --text-muted: #5c5c68;

  /* Brand Accents */
  --accent: #a78bfa;       /* Musical purple (matches metro) */
  --accent-light: #c4b5fd;
  --accent-play: #4ade80;
  --accent-rec: #ef4444;
  --accent-hover: #8b5cf6;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', Consolas, monospace;

  /* Layout */
  --header-height: 72px;
  --container-max: 1280px;
  --radius: 8px;
  --transition: 150ms ease;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== HEADER / NAV ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  height: 30px;
  width: auto;
  display: block;
  flex-shrink: 0;
  vertical-align: middle; /* ensure proper alignment */
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1;
}

/* Responsive logo */
@media (max-width: 640px) {
  .logo-img {
    height: 26px;
  }
  .logo-text {
    font-size: 17px;
  }
  .logo {
    gap: 8px;
  }
}

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

.nav-link {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-panel);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-subtle);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

/* Form styles for inscription and profile edit */
.form {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-panel);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  margin-top: 24px;
}

.form-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Genre multi-select checkboxes - clean and modern */
.genre-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-input);
}

.genre-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.1s ease;
}

.genre-option:hover {
  background: var(--bg-panel);
}

.genre-option input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

#custom-genre-wrapper {
  margin-top: 12px;
  display: none;
}

#custom-genre-wrapper.show {
  display: block;
}

.btn-primary {
  background: var(--accent);
  color: #0d0d0f;
}

.btn-primary:hover {
  background: var(--accent-light);
  color: #0d0d0f;
}

.btn-secondary {
  background: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-panel-raised);
  border-color: var(--border-subtle);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #0d0d0f;
  cursor: pointer;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 6px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
  font-weight: 500;
}

@media (min-width: 768px) {
  .user-name {
    display: inline;
  }
}

/* User dropdown */
.nav-right {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.user-dropdown.show {
  display: flex;
}

.user-dropdown a,
.user-dropdown button {
  padding: 10px 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg-panel-raised);
}

.user-dropdown .dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Premium Audio Player for Tracks */
.track-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
}

.track-player .play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d0d0f;
  border: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.track-player .play-btn:hover {
  transform: scale(1.05);
}

.track-player .play-btn.playing {
  background: #ef4444;
}

.track-player .progress-container {
  flex: 1;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  min-width: 80px;
}

.track-player .progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  position: relative;
  transition: width 0.05s linear;
}

.track-player .progress-bar::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}

.track-player:hover .progress-bar::after {
  opacity: 1;
}

.track-player .time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}

/* Enhanced Premium Player */
.track-player {
  flex-wrap: wrap;
  gap: 8px;
}

.track-player .player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.track-player .waveform {
  width: 100%;
  height: 36px;
  background: #111;
  border-radius: 3px;
  margin: 4px 0;
}

.track-player .volume-container {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.track-player .volume-slider {
  width: 70px;
  accent-color: var(--accent);
}

.track-player .extra-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.track-player .like-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.track-player .like-btn.liked {
  color: #ef4444;
}

.track-player .download-btn,
.track-player .next-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}

.track-player .download-btn:hover,
.track-player .next-btn:hover {
  color: var(--accent);
}

.track-player .next-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* Accessibility: Keyboard focus styles (high contrast) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==================== FOOTER ==================== */
.footer {
  background: #0a0a0c;
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 32px;
  margin-top: 80px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.footer-col h4 {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-col a:hover {
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.social-links a {
  font-size: 18px;
  color: var(--text-muted);
}

.social-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

/* ==================== HERO & SECTIONS ==================== */
.hero {
  min-height: 520px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #0d0d0f 0%, #141416 100%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(167, 139, 250, 0.08) 0%, transparent 60%);
}

.hero-content {
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  margin: 0 0 16px;
  font-weight: 700;
}

.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 460px;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.section {
  padding: 64px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: 26px;
  margin: 0;
}

/* Consistent page headings for SEO and style */
h1 {
  font-size: 32px;
  margin-bottom: 8px;
  line-height: 1.2;
}

/* Cards */
.grid {
  display: grid;
  gap: 20px;
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), 
              border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Subtle animation for card covers */
.card-cover {
  transition: transform 0.3s ease, filter 0.2s ease;
}

.card:hover .card-cover {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.card-cover {
  height: 180px;
  background: linear-gradient(135deg, #2a2a30, #1a1a1e);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.15);
}

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

.card-title {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 15px;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Artist cards */
.artist-card .card-cover {
  height: 160px;
  border-radius: 999px;
  margin: 16px auto 0;
  width: 160px;
  font-size: 42px;
}

/* ==================== FORMS & SEARCH ==================== */
.search-bar {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 16px;
  max-width: 420px;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .hero h1 {
    font-size: 40px;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 420px;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

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

  h1 {
    font-size: 28px;
  }
}

/* ==========================================
   SUBTLE ANIMATIONS & LIFE
   ========================================== */

/* Fade-in for sections and hero */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section, .hero-content {
  animation: fadeInUp 0.6s ease forwards;
}

.section:nth-child(2) { animation-delay: 80ms; }
.section:nth-child(3) { animation-delay: 140ms; }
.section:nth-child(4) { animation-delay: 200ms; }

/* Button micro-interactions */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::after {
  left: 150%;
}

.btn-primary {
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.4);
}

/* Studio specific prominent button */
.btn-studio {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #0d0d0f;
  font-weight: 700;
  padding: 12px 26px;
  font-size: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-studio:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
  color: #0d0d0f;
}

/* Nav studio link */
.nav-link.studio-link {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent);
  font-weight: 600;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.nav-link.studio-link:hover {
  background: var(--accent);
  color: #0d0d0f;
  border-color: var(--accent);
}

/* Enhanced search in header */
.header-search {
  position: relative;
  margin-left: 12px;
  flex: 1;
  max-width: 280px;
}

.header-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 8px 14px 8px 36px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.header-search::before {
  content: '🔍';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.7;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  max-height: 240px;
  overflow-y: auto;
}

.search-suggestions.show {
  display: block;
}

.search-suggestions a {
  display: block;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.search-suggestions a:last-child {
  border-bottom: none;
}

.search-suggestions a:hover {
  background: var(--bg-panel-raised);
  color: var(--accent);
}

/* Filter buttons on discover */
.filter-btn {
  transition: all 0.15s ease;
}

.filter-btn.active {
  background: var(--accent);
  color: #0d0d0f;
  border-color: var(--accent);
}

/* Recommendations section */
.recommendations {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.recommendations h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Subtle section entry animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Staggered entrance on discover grid + sections (safe defaults) */
.discover-grid .card,
#discover-grid .card {
  animation: fadeIn 0.45s ease forwards;
}

#discover-grid .card:nth-child(1) { animation-delay: 40ms; }
#discover-grid .card:nth-child(2) { animation-delay: 90ms; }
#discover-grid .card:nth-child(3) { animation-delay: 140ms; }
#discover-grid .card:nth-child(4) { animation-delay: 190ms; }
#discover-grid .card:nth-child(5) { animation-delay: 240ms; }
#discover-grid .card:nth-child(6) { animation-delay: 290ms; }

/* Keep other grids visible and animated lightly */
.grid .card {
  animation: fadeIn 0.35s ease forwards;
  animation-delay: 30ms;
}

/* Header search responsive */
@media (max-width: 900px) {
  .header-search {
    max-width: 180px;
    margin-left: 6px;
  }
  .header-search input {
    padding: 7px 12px 7px 30px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .header-search {
    display: none; /* hide in mobile header to avoid crowding; discover page has its own */
  }
}