/* ============================================================
   style.css — Musicatea Enhanced
   Premium dark theme with smooth UX
   Font: Cairo (Arabic-first)
============================================================ */
 
/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:         #09090b;
  --bg2:        #0f0f12;
  --bg3:        #141418;
  --surface:    rgba(255,255,255,0.035);
  --surface2:   rgba(255,255,255,0.06);
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);
  --gold:       #c8a45a;
  --gold-light: #e2c07a;
  --gold-dim:   rgba(200,164,90,0.12);
  --text:       #ede8dc;
  --text-muted: rgba(237,232,220,0.55);
  --text-dim:   rgba(237,232,220,0.28);
  --red:        #c46060;
  --green:      #7ecfa0;
  --radius:     12px;
  --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
 
/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 16px; 
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { 
  text-decoration: none; 
  color: inherit;
  transition: color 0.3s var(--ease);
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { 
  background: rgba(200,164,90,0.3); 
  border-radius: 3px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(200,164,90,0.5); }
::selection { background: var(--gold-dim); color: var(--gold-light); }
 
/* ── Navigation ────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; height: 70px;
  background: rgba(9,9,11,0.9);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}

.site-nav.scrolled {
  height: 64px;
  background: rgba(9,9,11,0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav-logo {
  font-size: 1.35rem; 
  font-weight: 900; 
  color: var(--gold-light);
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease);
}

.nav-logo:hover {
  transform: scale(1.05);
}

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

.nav-links a {
  color: var(--text-muted); 
  font-size: 0.9rem; 
  font-weight: 500;
  padding: 8px 16px; 
  border-radius: 9px;
  transition: all 0.3s var(--ease);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--gold);
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover { 
  color: var(--text); 
  background: var(--surface2);
}

.nav-links a.active { 
  color: var(--gold-light); 
  background: var(--gold-dim);
}

.nav-links a.active::after {
  transform: translateX(-50%) scaleX(1);
}
 
/* ── Page hero areas ───────────────────────────────────── */
.page-hero {
  padding: 60px 5% 48px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  animation: fadeInUp 0.6s var(--ease);
}

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

.page-hero h1 { 
  font-size: clamp(1.8rem, 4vw, 2.6rem); 
  font-weight: 900; 
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p { 
  color: var(--text-muted); 
  max-width: 580px; 
  font-size: 1rem;
  line-height: 1.8;
}
 
/* ── Filters bar ───────────────────────────────────────── */
.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 20px 5%; border-bottom: 1px solid var(--border);
  background: var(--bg); position: sticky; top: 70px; z-index: 100;
  transition: all 0.3s var(--ease);
}

.filters select,
.filters input[type="text"] {
  background: var(--surface); 
  border: 1px solid var(--border);
  border-radius: 10px; 
  padding: 10px 16px;
  color: var(--text); 
  font-family: inherit; 
  font-size: 0.9rem;
  outline: none; 
  transition: all 0.3s var(--ease);
  -webkit-appearance: none;
}

.filters select:hover,
.filters input[type="text"]:hover {
  border-color: rgba(200,164,90,0.3);
  background: var(--surface2);
}

.filters select:focus,
.filters input[type="text"]:focus {
  border-color: rgba(200,164,90,0.5);
  box-shadow: 0 0 0 4px rgba(200,164,90,0.08);
  transform: translateY(-1px);
}

.filters select option { background: var(--bg3); }
 
/* ── List / grid ───────────────────────────────────────── */
#list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 32px 5%;
}
 
/* ── Card ──────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; 
  flex-direction: column; 
  gap: 0;
  transition: all 0.4s var(--ease);
  animation: fadeInScale 0.5s var(--ease) backwards;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  border-color: rgba(200,164,90,0.3);
}

.card-header { margin-bottom: 14px; }

.card-title-row {
  display: flex; 
  align-items: flex-start;
  justify-content: space-between; 
  gap: 10px; 
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.05rem; 
  font-weight: 700; 
  line-height: 1.35;
  color: var(--text);
  transition: color 0.3s;
}

.card:hover .card-title {
  color: var(--gold-light);
}

.card-composer { 
  font-size: 0.85rem; 
  color: var(--text-muted);
  transition: color 0.3s;
}

.card:hover .card-composer {
  color: var(--text);
}

.card-performer { 
  font-size: 0.8rem; 
  color: var(--text-dim); 
  margin-top: 3px;
}

.card-meta {
  display: flex; 
  align-items: center; 
  gap: 10px;
  margin-bottom: 16px; 
  flex-wrap: wrap;
}

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

.card-tonic {
  font-size: 0.76rem; 
  padding: 3px 10px; 
  border-radius: 100px;
  background: var(--surface2); 
  border: 1px solid var(--border2);
  color: var(--text-dim);
  transition: all 0.3s;
}

.card:hover .card-tonic {
  background: var(--gold-dim);
  border-color: rgba(200,164,90,0.3);
  color: var(--gold);
}
 
/* Maqam link in cards */
.maqam-link {
  color: var(--gold); 
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

.maqam-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 1px;
  background: var(--gold-light);
  transition: width 0.3s var(--ease);
}

.maqam-link:hover { 
  color: var(--gold-light);
}

.maqam-link:hover::after {
  width: 100%;
}
 
/* Badges */
.badge {
  font-size: 0.7rem; 
  font-weight: 700; 
  padding: 4px 10px;
  border-radius: 100px; 
  white-space: nowrap; 
  flex-shrink: 0;
  letter-spacing: 0.04em;
  transition: all 0.3s var(--ease);
}

.badge-song {
  background: rgba(200,164,90,0.12); 
  color: var(--gold);
  border: 1px solid rgba(200,164,90,0.22);
}

.card:hover .badge-song {
  background: rgba(200,164,90,0.2);
  border-color: rgba(200,164,90,0.4);
}

.badge-inst {
  background: rgba(126,207,160,0.1); 
  color: var(--green);
  border: 1px solid rgba(126,207,160,0.2);
}

.card:hover .badge-inst {
  background: rgba(126,207,160,0.15);
  border-color: rgba(126,207,160,0.3);
}
 
/* Download button */
.download-btn {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  margin-top: auto; 
  padding: 11px 0;
  background: var(--gold-dim); 
  border: 1px solid rgba(200,164,90,0.22);
  border-radius: 10px; 
  color: var(--gold-light);
  font-size: 0.88rem; 
  font-weight: 600; 
  font-family: inherit;
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

.download-btn:hover {
  background: rgba(200,164,90,0.22);
  border-color: rgba(200,164,90,0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200,164,90,0.2);
}

.download-btn svg {
  transition: transform 0.3s var(--ease);
}

.download-btn:hover svg {
  transform: translateY(2px);
}
 
/* Legacy download class */
a.download {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  margin-top: 14px; 
  padding: 11px 0;
  background: var(--gold-dim); 
  border: 1px solid rgba(200,164,90,0.22);
  border-radius: 10px; 
  color: var(--gold-light);
  font-size: 0.88rem; 
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

a.download:hover {
  background: rgba(200,164,90,0.22);
  border-color: rgba(200,164,90,0.45);
  transform: translateY(-2px);
}
 
/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 14px;
  padding: 80px 20px; 
  color: var(--text-dim); 
  font-size: 0.95rem;
  text-align: center;
  animation: fadeIn 0.5s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
 
/* ── System toggle ─────────────────────────────────────── */
.system-toggle {
  display: flex; 
  gap: 4px; 
  background: var(--surface);
  border: 1px solid var(--border); 
  border-radius: 11px; 
  padding: 5px;
}

.system-toggle-btn {
  padding: 8px 20px; 
  border-radius: 8px; 
  font-size: 0.9rem;
  font-family: inherit; 
  color: var(--text-muted);
  transition: all 0.3s var(--ease); 
  cursor: pointer; 
  border: none; 
  background: none;
}

.system-toggle-btn:hover {
  color: var(--text);
  background: var(--surface2);
}

.system-toggle-btn.active {
  background: var(--gold-dim); 
  color: var(--gold-light);
  border: 1px solid rgba(200,164,90,0.25);
  transform: scale(1.02);
}
 
/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 5%; 
  margin-top: 80px;
  display: flex; 
  align-items: center;
  justify-content: space-between; 
  flex-wrap: wrap; 
  gap: 16px;
  color: var(--text-dim); 
  font-size: 0.85rem;
  background: var(--bg2);
}

.footer-logo { 
  font-weight: 900; 
  font-size: 1.1rem; 
  color: var(--gold-light);
}
 
/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  #list { 
    grid-template-columns: 1fr; 
    padding: 24px 4%; 
    gap: 16px;
  }
  .filters { 
    padding: 16px 4%; 
    top: 64px;
    gap: 10px;
  }
  .site-nav { 
    padding: 0 4%;
    height: 64px;
  }
  .nav-links a { 
    padding: 7px 12px; 
    font-size: 0.85rem;
  }
  .nav-logo {
    font-size: 1.2rem;
  }
}

/* ── Smooth scroll animations ─────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation-delay: calc(var(--card-index, 0) * 0.05s);
  }
}
