/* Hatim Tone - Night Sky Premium Theme */

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
  background: radial-gradient(circle at top, #1A1448 0, #0D0B1E 40%, #05030B 100%);
  color: #e5e7eb;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

/* ========== TOP BAR ========== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(90deg, #0D0B1Eee, #1A1448ee);
  border-bottom: 1px solid rgba(148,163,184,0.3);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 35px rgba(0,0,0,0.75);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.logo a {
  background: linear-gradient(135deg,#f9fafb,#FFD56A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav a {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: 0.15s ease;
}

.nav a:hover {
  border-color: rgba(255,213,106,0.8);
  background: radial-gradient(circle at top, rgba(55,43,143,0.8), rgba(10,10,40,0.95));
  box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}

.nav-active {
  border-color: rgba(255,213,106,0.9);
  background: radial-gradient(circle at top, rgba(55,43,143,0.9), rgba(10,10,40,0.98));
}

/* ========== HERO (HOME) ========== */
main {
  margin-top: 1.6rem;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 2rem;
  margin-bottom: 2.2rem;
  align-items: center;
}

.home-hero-text {
  min-width: 0;
}

.home-hero-title {
  font-size: 2.1rem;
  line-height: 1.3;
  margin-bottom: 0.7rem;
  color: #f9fafb;
  text-shadow: 0 0 12px rgba(0,0,0,0.8);
}

.home-hero-subtitle {
  font-size: 0.98rem;
  line-height: 1.9;
  color: #d1d5db;
  margin-bottom: 1.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.hero-primary {
  background: linear-gradient(135deg,#4f46e5,#9f67ff);
  color: #f9fafb;
  border-color: rgba(159,103,255,0.9);
  box-shadow: 0 15px 35px rgba(0,0,0,0.9);
}

.hero-primary:hover {
  background: linear-gradient(135deg,#6d63ff,#b48bff);
}

.hero-secondary {
  background: transparent;
  border-color: rgba(148,163,184,0.9);
  color: #e5e7eb;
}

.hero-secondary:hover {
  background: rgba(15,23,42,0.95);
}

/* HERO stats */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-stat {
  min-width: 110px;
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow: 0 10px 25px rgba(0,0,0,0.85);
}

.hero-stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #FFD56A;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.hero-last {
  flex: 1;
}

.hero-last-link {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.hero-last-link:hover {
  color: #FFD56A;
}

/* HERO visual mock player */
.home-hero-visual {
  display: flex;
  justify-content: center;
}

.hero-player-mock {
  width: 100%;
  max-width: 380px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(56,189,248,0.6), transparent 55%),
    radial-gradient(circle at bottom, rgba(129,140,248,0.7), transparent 60%),
    #020617;
  border: 1px solid rgba(148,163,184,0.5);
  box-shadow:
    0 22px 60px rgba(0,0,0,0.95),
    inset 0 0 0 1px rgba(15,23,42,0.9);
  overflow: hidden;
}

.hero-player-header {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem;
}

.hero-player-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(15,23,42,0.95);
  box-shadow: 0 0 0 1px rgba(148,163,184,0.7);
}

.hero-player-body {
  padding: 1rem 1rem 1.1rem;
}

.hero-player-wave {
  height: 78px;
  border-radius: 16px;
  background-image: linear-gradient(
    90deg,
    rgba(15,23,42,1),
    rgba(56,189,248,0.9),
    rgba(129,140,248,0.9),
    rgba(15,23,42,1)
  );
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

.hero-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
}

.hero-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg,#4f46e5,#9f67ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  box-shadow: 0 12px 25px rgba(15,23,42,0.9);
  font-size: 1.1rem;
}

.hero-circle-sm {
  width: 26px;
  height: 26px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.7);
}

.hero-player-caption {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: #e5e7eb;
  opacity: 0.9;
}

/* ========== HOME SECTIONS / CARDS ========== */
.home-section-card {
  margin-bottom: 1.6rem;
  border-radius: 20px;
  padding: 1.1rem 1.25rem 1.3rem;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.45), transparent 60%),
    radial-gradient(circle at bottom right, rgba(8,145,178,0.42), transparent 60%),
    rgba(5,5,25,0.97);
  border: 1px solid rgba(148,163,184,0.45);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.95),
    inset 0 0 0 1px rgba(15,23,42,0.9);
}

.home-section-header h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.home-section-header p {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Category chips */
.category-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.category-chip {
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  cursor: pointer;
  transition: 0.16s ease;
}

.category-chip:hover {
  border-color: rgba(255,213,106,0.9);
  box-shadow: 0 10px 25px rgba(0,0,0,0.85);
}

.category-chip-active {
  background: linear-gradient(135deg,#4f46e5,#9f67ff);
  border-color: rgba(159,103,255,0.95);
}

/* Files list + cards */
.files-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 60%),
    radial-gradient(circle at bottom right, rgba(129,140,248,0.22), transparent 65%),
    rgba(15,23,42,0.98);
  border: 1px solid rgba(15,23,42,0.95);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.98),
    inset 0 0 0 1px rgba(15,23,42,0.85);
  cursor: grab;
  transition: 0.16s ease;
}

.file-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,213,106,0.9);
  box-shadow: 0 20px 45px rgba(0,0,0,0.98);
}

.file-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}

.file-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.file-card-title {
  font-size: 0.98rem;
  margin-bottom: 0.05rem;
}

.file-card-sub {
  font-size: 0.78rem;
  color: #9ca3af;
}

.file-card-handle {
  font-size: 1rem;
  color: #9ca3af;
  cursor: grab;
}

.file-card-meta {
  font-size: 0.78rem;
  color: #9ca3af;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.file-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

/* Drag states */
.file-card.dragging {
  opacity: 0.8;
  transform: scale(0.99);
}

.file-card.drop-before::before,
.file-card.drop-after::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  border-bottom: 2px dashed rgba(255,213,106,0.9);
}

.file-card.drop-before::before {
  top: -0.1rem;
}

.file-card.drop-after::after {
  bottom: -0.1rem;
}

/* ========== ULTRA PLAYER (PLAY PAGE) ========== */

.player-shell {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr);
  gap: 1.5rem;
}

.track-header {
  margin-bottom: 0.8rem;
}

.track-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.track-title span {
  color: #FFD56A;
}

.track-meta {
  font-size: 0.8rem;
  color: #9ca3af;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ht-player-wrapper {
  margin-top: 0.8rem;
}

.ht-title {
  font-size: 1.3rem;
  text-align: center;
  color: #FFD56A;
  text-shadow: 0 0 10px rgba(255,213,106,0.4);
  margin-bottom: 1rem;
  font-weight: 700;
}

.ht-player-card {
  padding: 1.4rem 1.5rem 1.6rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(82,63,187,0.7), transparent 60%),
    radial-gradient(circle at bottom right, rgba(14,165,233,0.4), transparent 60%),
    rgba(5,5,25,0.96);
  border: 1px solid rgba(148,163,184,0.45);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.95),
    inset 0 0 0 1px rgba(15,23,42,0.9);
}

.ht-audio {
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}

/* Controls */
.ht-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.ht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  background: radial-gradient(circle at top, rgba(55,43,143,0.7), rgba(17,24,39,0.95));
  color: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.ht-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.85);
  border-color: rgba(255,213,106,0.85);
}

.ht-main-btn {
  background: linear-gradient(135deg, #4c46e5, #9f67ff);
  box-shadow: 0 0 20px rgba(159,103,255,0.6);
}

.ht-main-btn:hover {
  background: linear-gradient(135deg, #675dff, #b48bff);
}

.ht-red {
  background: radial-gradient(circle at top, #b91c1c, #7f1d1d);
  border-color: rgba(239,68,68,0.8);
}

.ht-gray {
  background: rgba(15,23,42,0.8);
}

.ht-gold {
  background: linear-gradient(135deg, #FFD56A, #c9a441);
  color: #111827;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(255,213,106,0.65);
}

.ht-gold:hover {
  background: linear-gradient(135deg, #f7c84e, #b48b2c);
}

.ht-num {
  width: 54px;
  padding: 0.3rem 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.95);
  color: #e5e7eb;
  font-size: 0.8rem;
}

/* Tempo & Seek */
.ht-tempo-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  font-size: 0.85rem;
}

.ht-tempo-box span {
  white-space: nowrap;
}

.ht-slider {
  flex: 1;
  accent-color: #FFD56A;
}

.ht-tempo-value {
  color: #FFD56A;
  font-weight: 600;
}

.ht-seek {
  width: 100%;
  margin-top: 0.9rem;
  accent-color: #FFD56A;
}

/* Note area */
.ht-note-card {
  background: radial-gradient(circle at top, rgba(37,99,235,0.35), transparent 55%),
              radial-gradient(circle at bottom, rgba(14,116,144,0.35), transparent 60%),
              rgba(15,23,42,0.98);
  border-radius: 18px;
  padding: 0.65rem 0.75rem;
  margin-top: 1.1rem;
  border: 1px solid rgba(148,163,184,0.5);
  box-shadow:
      0 16px 45px rgba(0,0,0,0.9),
      inset 0 0 0 1px rgba(15,23,42,0.8);
}

#note-canvas {
  width: 100%;
  display: block;
}

/* قائمة المقامات */
.ht-maqam-list {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.maqam-chip {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  transition: 0.18s ease;
}

.maqam-chip-active {
  border-color: rgba(255,213,106,0.95);
  background: linear-gradient(135deg,#4f46e5,#9f67ff);
  box-shadow: 0 0 16px rgba(159,103,255,0.7);
}

/* Analysis info (صندوق صغير تحت المقامات) */
.ht-analysis-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 0.9rem;
  font-size: 0.86rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.7);
}

.ht-analysis-info p span {
  color: #FFD56A;
}

.ht-loop-info {
  margin-top: 0.9rem;
  padding: 0.55rem 0.7rem;
  text-align: center;
  border-radius: 999px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.7);
  color: #FFD56A;
  font-size: 0.85rem;
}

/* Generic .btn (لباقي الصفحات .btn القديمة) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  background: radial-gradient(circle at top, rgba(55,43,143,0.7), rgba(17,24,39,0.95));
  color: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.85);
  border-color: rgba(255,213,106,0.85);
}

.btn.secondary {
  background: rgba(15,23,42,0.9);
}

.btn.danger {
  background: radial-gradient(circle at top, #b91c1c, #7f1d1d);
  border-color: rgba(239,68,68,0.8);
}

.btn.small {
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(15,23,42,1);
  background: #020617;
}

.footer .container {
  padding-block: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-hero-visual {
    order: -1;
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 0.9rem;
  }

  /* الهيدر في الموبايل: غير ثابت وأصغر */
  .top-bar {
    position: static;
    box-shadow: 0 8px 18px rgba(0,0,0,0.7);
  }
  .logo {
    font-size: 1rem;
  }
  .nav a {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
  }

  .hero-actions {
    flex-direction: column;
  }
  .hero-stats {
    flex-direction: column;
  }

  .ht-controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ht-controls-row .ht-btn,
  .ht-controls-row .ht-num {
    width: 100%;
    justify-content: center;
  }

  .ht-analysis-info {
    font-size: 0.8rem;
  }
}
