* {
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  margin: 0;
  padding-bottom: 110px;
  background: #0f0f1a;
  color: #fff;
}

/* ================= HEADER ================= */
.topbar {
  background: linear-gradient(90deg, #7c3aed, #9333ea);
  padding: 14px;
  text-align: center;
  font-size: 18px;
}

/* ================= SEARCH ================= */
.search-box {
  padding: 12px;
  display: flex;
  gap: 8px;
}

.search-box input {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 16px;
  border: none;
  outline: none;
}

#searchBtn {
  padding: 0 16px;
  border-radius: 10px;
  border: none;
  background: #7c3aed;
  color: white;
  font-size: 14px;
  cursor: pointer;
}
#searchBtn:active {
  transform: scale(0.97);
}

/* ================= SONGS GRID ================= */
/* موبایل → 3 ستون */
#songs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px;
}

/* تبلت */
@media (min-width: 768px) {
  #songs {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* دسکتاپ بزرگ */
@media (min-width: 1200px) {
  #songs {
    grid-template-columns: repeat(5, 1fr);
  }
}

.song {
  background: #1c1c2b;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s;
}

.song img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.song-title {
  padding: 8px 6px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* playing */
.song.playing {
  outline: 2px solid #1db954;
  transform: scale(1.03);
}

.song.playing .song-title {
  color: #1db954;
  font-weight: bold;
}

/* ================= MINI PLAYER ================= */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  padding: 42px 12px 12px; /* فضای کافی برای تایمر + seek */
  backdrop-filter: blur(18px);
  background: rgba(30, 30, 40, 0.75);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 999;

  direction: ltr;
  touch-action: pan-y;
}

/* ================= PROGRESS + TIME (TOP FLOAT) ================= */
.progress-wrap {
  position: absolute;
  top: 6px;               /* 👈 بالای پلیر */
  left: 12px;
  right: 12px;
}

.time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  opacity: .7;
  margin-bottom: 6px;     /* فاصله از seekbar */
}

/* seekbar */
#progress {
  width: 100%;
  height: 3px;
  appearance: none;
  background: rgba(255,255,255,.35);
  border-radius: 5px;
}

#progress::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
}

/* ================= CONTENT ================= */
.mini-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* left */
.mini-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-left img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.mini-text {
  overflow: hidden;
  direction: rtl;
  text-align: right;
}

#player-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#player-artist {
  font-size: 12px;
  opacity: .6;
}


/* ================= MINI CONTENT ================= */
.mini-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* left */
.mini-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-left img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.mini-text {
  overflow: hidden;
  direction: rtl;
  text-align: right;
}

#player-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#player-artist {
  font-size: 12px;
  opacity: .6;
}

/* ================= CONTROLS ================= */
.mini-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: .85;
}

.icon-btn.active {
  color: #7c3aed;
}

.icon-btn.play {
  width: 46px;
  height: 46px;
  background: #7c3aed;
}

.icon-btn.play svg {
  opacity: 1;
}

/* ================= AUDIO ================= */
audio {
   position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ================= NO RESULT ================= */
.no-result {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 10px;
  font-size: 15px;
  opacity: .7;
}










/* Song page focus */

.song-dark {
  background: #050505;
}

.song-focus {
  padding: 40px 20px;
  text-align: center;
}

.song-cover-big {
  width: 280px;
  max-width: 90%;
  border-radius: 20px;
  margin-bottom: 20px;
}

.play-main-btn {
  background: #7c3aed;
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 18px;
  cursor: pointer;
}

.divider {
  margin: 40px 0;
  border: none;
  height: 1px;
  background: #222;
}











/* وقتی تیک خورد، کل پاپ‌آپ مخفی شود */

#close-popup:checked + .app-popup{
  display:none;
}

.app-popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:99999;
}

.popup-box{
  background:#fff;
  width:90%;
  max-width:420px;
  border-radius:16px;
  padding:26px 22px 28px;
  text-align:center;
  box-shadow:0 20px 40px rgba(0,0,0,.25);
}

.popup-header{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:12px;
}

.popup-icon{
  width:40px;
  height:40px;
  border-radius:8px;
}

.popup-box h3{
  margin:0;
  font-size:20px;
  color:#111;
}

.popup-text{
  font-size:14px;
  line-height:1.9;
  color:#444;
  margin:10px 0 18px;
}

.download-btn{
  display:block;
  background:#34a853;
  color:#fff;
  padding:12px;
  border-radius:10px;
  text-decoration:none;
  font-weight:bold;
}

.close-text{
  display:inline-block;
  margin-top:14px;
  font-size:14px;
  color:#777;
  cursor:pointer;
}
.close-text:hover{
  color:#000;
  text-decoration:underline;
}





.app-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;

  animation: showPopup 0.4s ease forwards;
  animation-delay: 10s; /* ← این همون ۱۰ ثانیه است */
}

/* وقتی کاربر بستش */
#close-popup:checked ~ .app-popup {
  display: none;
}

@keyframes showPopup {
  to {
    opacity: 1;
    visibility: visible;
  }
}









.menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  margin-left: 10px;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -260px;
  width: 250px;
  height: 100%;
  background: #111;
  color: #fff;
  transition: right 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar.active {
  right: 0;
}

.sidebar-content {
  padding: 20px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid #222;
}

.sidebar li:hover {
  color: #7c3aed;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 900;
}

.overlay.active {
  display: block;
}



