/* --------------------------------------------------------
   فونت
-------------------------------------------------------- */
@font-face{
  font-family:'Nastaliq';
  src:url('/fonts/IranNastaliq.ttf') format('truetype');
}

/* --------------------------------------------------------
   پایه
-------------------------------------------------------- */
*{
  box-sizing:border-box;
}

html{
  overflow-y:scroll;
}

body{
  margin:0;
  direction:rtl;
  font-family:'Vazirmatn', sans-serif;
  background:url('/images/background.webp') center/cover no-repeat fixed;
  color:#FFD700;
  padding-bottom:70px;
}

/* --------------------------------------------------------
   اسکرول طلایی
-------------------------------------------------------- */
body::-webkit-scrollbar{
  width:16px;
}

body::-webkit-scrollbar-track{
  background:rgba(0,0,0,0.6);
  border-radius:12px;
}

body::-webkit-scrollbar-thumb{
  background:linear-gradient(
    180deg,
    #fff8c0,
    #FFD700,
    #ffb700,
    #FFD700,
    #fff8c0
  );
  border-radius:12px;
  border:3px solid rgba(0,0,0,0.5);
  box-shadow:0 0 10px rgba(255,215,0,.8);
}

body::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg,#ffffff,#FFD700,#ffc400,#FFD700);
  box-shadow:0 0 18px rgba(255,215,0,1);
}

/* --------------------------------------------------------
   عنوان
-------------------------------------------------------- */
header{
  padding:15px;
  text-align:center;
  font-size:34px;
  border-bottom:1px solid #444;
  font-family:'Nastaliq';
}

.copyright-note{
font-size:20px;
color:#888;
opacity:0.8;
display:block;
margin-top:2px;
}

/* --------------------------------------------------------
   کانتینر
-------------------------------------------------------- */
.musicPage{
  width:100%;
  max-width:1400px;
  margin:auto;
  padding:20px 20px 40px;
}

/* --------------------------------------------------------
   جستجو
-------------------------------------------------------- */
#search{
  position:sticky;
  top:20px;
  z-index:4;

  width:640px;
  margin:0 auto 20px;
  display:block;

  padding:12px 14px;
  border-radius:20px;
  border:none;
  outline:none;

  background:rgba(0,0,0,0.9);
  color:#FFD700;
  font-size:14px;

  box-shadow:
    0 0 10px rgba(255,215,0,.2),
    inset 0 0 8px rgba(0,0,0,.6);

  transition:.3s;
}

#search:focus{
  box-shadow:
    0 0 15px rgba(255,215,0,.6),
    0 0 30px rgba(255,215,0,.4);
}

/* --------------------------------------------------------
   گالری
-------------------------------------------------------- */
.gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:16px;
  padding:0 10px 40px;
}

/* --------------------------------------------------------
   کارت آلبوم
-------------------------------------------------------- */
.album{
  background:rgba(0,0,0,.65);
  border:1px solid rgba(255,215,0,.25);
  border-radius:14px;
  padding:10px;
  text-align:center;
  cursor:pointer;

  box-shadow:0 6px 20px rgba(0,0,0,.6);
  transition:.3s;

  min-width:0;                 /* مهم برای موبایل */
}

.album.open{
  z-index:2; /* بالاتر از بقیه کارت‌ها */
}

.album.show{
  opacity:1;
  transform:translateY(0);
  filter:blur(0);
}

/* --------------------------------------------------------
   هدر آلبوم
-------------------------------------------------------- */
.albumHeader{
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:8px;
  text-align:center;

  min-width:0; /* مهم */
}

.albumHeader h2{
  font-size:14px;
  margin:6px 0;

  white-space:nowrap;       /* جلوگیری از دو خط شدن */
  overflow:hidden;
  text-overflow:ellipsis;   /* ... */
}

/* --------------------------------------------------------
   کاور
-------------------------------------------------------- */
.coverBox{
  position:relative;
  overflow:hidden;
  border-radius:10px;
  aspect-ratio:1/1;
}

.coverBox img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:.4s;
}

.albumHeader:hover img{
  transform:scale(1.1);
}

/* --------------------------------------------------------
   دکمه پخش روی کاور
-------------------------------------------------------- */
.playOverlay{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%) scale(.7);

  background:rgba(0,0,0,.6);
  color:white;

  font-size:30px;
  width:60px;
  height:60px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:50%;
  opacity:0;
  transition:.3s;
}

.albumHeader:hover .playOverlay{
  opacity:1;
  transform:translate(-50%,-50%) scale(1);
}

/* --------------------------------------------------------
   فلش
-------------------------------------------------------- */
.arrow{
  opacity:.6;
  font-size:14px;
  transition:.3s;
}

.album.open .arrow{
  transform:rotate(180deg);
}

/* --------------------------------------------------------
   پنل ترک‌ها زیر گالری
-------------------------------------------------------- */

.tracksPanel{
  display:none;

  width:100%;
  max-width:1400px;
  margin:25px auto;

  background:rgba(0,0,0,0.95);
  border:1px solid #FFD700;
  border-radius:14px;

  padding:18px;

  box-shadow:0 15px 40px rgba(0,0,0,0.7);
  
  scroll-margin-top:250px;
}

/* وقتی باز شود */
.tracksPanel.open{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

/* --------------------------------------------------------
   ترک
-------------------------------------------------------- */
.track{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;

  padding:8px 10px;
  border-radius:8px;

  background:#111;
  border:1px solid rgba(255,215,0,0.2);

  font-size:12px;

  transition:.2s;
}

.track:hover{
  background:#1a1a1a;
  border-color:#FFD700;
}

.track.playing{
  background:#FFD700;
  color:black;
  font-weight:bold;
}

.track span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.track button{
  background:#111;
  border:1px solid #555;
  color:#FFD700;
  border-radius:6px;
  cursor:pointer;
}

/* --------------------------------------------------------
   پلیر
-------------------------------------------------------- */
#playerBar{
  direction:ltr;

  position:fixed;
  bottom:0;
  left:0;
  right:0;

  display:flex;
  align-items:center;
  gap:12px;

  background:rgba(0,0,0,0.9);

  padding:10px;
  border-top:1px solid #444;

  backdrop-filter:blur(var(--player-blur,0px));
  transition:backdrop-filter .3s;
  z-index:7;
}

#playerCover{
  width:55px;
  height:55px;
  border-radius:6px;
  object-fit:cover;
}

.playerInfo{

flex:1;

display:flex;

align-items:center;

gap:10px;

direction:ltr;

}

.time{

font-size:12px;

min-width:40px;

}

/* progress */

.progressContainer{

position:relative;

flex:1;

height:6px;

background:#333;

border-radius:3px;

cursor:pointer;

}

#progress{

position:absolute;

top:0;

left:0;

height:100%;

width:0%;

background:#FFD700;

border-radius:3px;

}

/* عنوان روی نوار */

#trackTitle{

position:absolute;

left:50%;

top:-25px;

transform:translateX(-50%);

font-size:12px;

white-space:nowrap;

pointer-events:none;

max-width:90%;

overflow:hidden;

text-overflow:ellipsis;

}

/* --------------------------------------------------------
   زمان
-------------------------------------------------------- */
.time{
  direction:ltr;
  display:flex;
  justify-content:space-between;
  font-size:12px;
  margin-top:4px;
}

/* --------------------------------------------------------
   کنترل‌ها
-------------------------------------------------------- */
.controls{
  display:flex;
  gap:6px;
}

.controls button{
  background:#111;
  border:1px solid #555;
  color:#FFD700;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
}

/* --------------------------------------------------------
   highlight
-------------------------------------------------------- */
mark{
  background:#FFD700;
  color:black;
  padding:0 3px;
  border-radius:3px;
}

.album{
transition:all .35s ease;
}

body.albumFocus .album{
opacity:.50;
transform:scale(.9);
filter:blur(.3px);
}

body.albumFocus .album.open{
opacity:1;
transform:scale(1);
filter:none;
z-index:1;
}

/* --------------------------------------------------------
   موبایل
-------------------------------------------------------- */
@media(max-width:768px){

  .gallery{
    grid-template-columns:repeat(2,1fr);
  }

  #search{
    width:250px;
  }

  #playerBar{
    flex-wrap:wrap;
  }

  .controls{
    width:100%;
    justify-content:center;
  }

}
