* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: #e0e0e0;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    direction: rtl;
}

#music-player-container {
    width: 95%;
    max-width: 400px;
    /* تغییر: تعیین حداقل ارتفاع برای جلوگیری از کوچک شدن کل اپ */
    min-height: 600px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    background: #0a0a0a;
    padding: 25px 20px;
    border-radius: 20px;
    border: 1px solid #222;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.app-title {
    color: #D4AF37;
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.4rem;
}

#song-title {
    color: #e6c56a;
    text-shadow: 0 0 6px rgba(230, 197, 106, 0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px; /* کمی بیشتر کردم */
    font-weight: bold;
    font-size: 1.2rem;
}


.scroll-text {
    animation: scrollText 8s linear infinite;
}

@keyframes scrollText {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.time-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 5px;
    color: #D4AF37;
    font-size: 14px;
    direction: ltr;
}

#progress-container {
    width: 100%;
    height: 6px;
    background: #222;
    position: relative;
    border-radius: 10px;
    direction: ltr;
}

#progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #D4AF37, #F9E2AF);
    border-radius: 10px;
}

#progress-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

#playlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    /* تغییر: تعیین ارتفاع ثابت یا حداقل ارتفاع برای این بخش */
    height: 250px; 
    /* اگر آهنگ‌ها بیشتر شد اسکرول بخورد، اگر کمتر بود فضای خالی بماند */
    overflow-y: auto;
    width: 100%;
    /* اختیاری: برای اینکه وقتی خالی است هم کمی ظاهر داشته باشد */
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
}
/* برای اینکه وقتی لیست خالی است، ظاهر بدی نداشته باشد */
#playlist:empty::after {
    content: "no remix";
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #555;
    font-size: 13px;
}
.song-item, .playlist-item {
    padding: 12px 16px;
    color: #e6c56a;
    margin: 0;
    line-height: 1.4;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* تغییر به سمت چپ */
    direction: ltr; /* انگلیسی/فینگلیش بودن متن */
    text-align: left;
}


.song-item:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
}

.song-item.active, .playlist-item.active {
    background: #D4AF37 !important;
    color: #000 !important;
    font-weight: bold;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

#playlist::-webkit-scrollbar { width: 4px; }
#playlist::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

/* اصلاح ساختار کنترل‌ها */
.controls {
    width: 100%;
    position: relative; /* برای اینکه قلب با absolute نسبت به این موقعیت بگیرد */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    min-height: 50px;
}

.controls-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
}
/* استایل جدید برای دکمه‌های کنترلی SVG */
.controls-center button {
    background: none;
    border: none;
    color: #D4AF37; /* رنگ طلایی دکمه‌ها */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: transform 0.2s, opacity 0.2s;
}

.controls-center button svg {
    width: 40px; /* اندازه دکمه‌های قبلی و بعدی */
    height: 40px;
    fill: currentColor; /* استفاده از رنگ طلایی تعریف شده در بالا */
}

#play-pause-btn svg {
    width: 55px; /* دکمه پخش وسط بزرگتر باشد */
    height: 55px;
}

.controls-center button:active {
    transform: scale(0.9); /* افکت کلیک شدن */
    opacity: 0.8;
}

/* اصلاح چیدمان برای اینکه دکمه‌ها در یک خط باشند */
.controls-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; /* فاصله بین دکمه‌ها */
    width: 100%;
}


.controls button:active {
    transform: scale(0.9);
}

/* دکمه قلب - استایل واحد و تمیز */
#like-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
    color: #D4AF37;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s;
    line-height: 1;
    font-family: sans-serif;
    padding: 5px;
}

#like-btn.liked {
    color: #ff4d4d;
}

#like-btn:active {
    transform: translateY(-50%) scale(1.3);
}

/* سایر بخش‌ها */
#volume-slider {
    width: 80%; 
    height: 6px; 
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    direction: ltr;
    --fill: 50%;
    background: linear-gradient(to right, #d4af37 var(--fill), #2a2a2a var(--fill));
    outline: none;
    margin: 20px auto;
    display: block;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4af37;
    border: 2px solid #fff2b0;
    cursor: pointer;
    margin-top: -5px; 
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

#volume-slider::-webkit-slider-runnable-track { height: 6px; background: transparent; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.playing-animation {
    animation: pulse 2s infinite;
    border-radius: 50%;
}

#menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 34px;
    height: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

#menu-btn span {
    width: 7px;
    height: 7px;
    background: #D4AF37;
    border-radius: 50%;
    display: block;
    transition: all 0.35s ease;
}

#menu-btn.active span { width: 22px; height: 3px; border-radius: 10px; }

#menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border-radius: 20px;
    pointer-events: none;
}

#menu-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }

#category-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    width: 150px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

#category-menu.show { visibility: visible; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.cat-item {
    padding: 12px 15px;
    color: #D4AF37;
    cursor: pointer;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.cat-item:hover { background: #D4AF37; color: #000; }

#visualizer {
    width: 100%;
    height: 60px;
    display: block;
    border-radius: 10px;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
}

.cat-item.active {
    background: #D4AF37 !important;
    color: #000 !important; /* رنگ متن را مشکی می‌کند */
    font-weight: bold;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

.cat-item[data-category="favorites"].active {
    color: #000 !important;
}

/* استایل کلی برای هاور شدن */
.cat-item:hover {
    background: #D4AF37;
    color: #000;
}
/* مخفی شدن ولوم در موبایل و تبلت */
@media (max-width: 768px) {
    #volume-slider {
        display: none !important;
    }
}
