:root {
    --sc-orange: #f50;
    --sc-dark: #121212;
    --sc-gray: #282828;
    --text-main: #fff;
    --text-muted: #999;
}

/* ریست کلی */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Vazirmatn', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--sc-dark); color: var(--text-main); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* لایه بندی اصلی */
.app-container { display: flex; min-height: 100vh; }

/* سایدبار دسکتاپ */
.sidebar {
    width: 240px; background: var(--sc-gray); height: 100vh; position: fixed; right: 0; top: 0;
    padding: 20px; border-left: 1px solid #333; display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
}
.logo { font-size: 1.5rem; color: var(--sc-orange); font-weight: bold; margin-bottom: 30px; text-align: center; }
.nav-item {
    display: flex; align-items: center; gap: 15px; padding: 12px 15px; border-radius: 4px;
    cursor: pointer; transition: 0.2s; margin-bottom: 5px; color: var(--text-muted);
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(255, 85, 0, 0.2); color: var(--sc-orange); font-weight: bold; }

/* بخش اصلی */
.main-area {
    margin-right: 240px; flex: 1; padding: 20px; padding-bottom: 150px; width: 100%;
    display: flex; flex-direction: column;
}

/* هدر و جستجو */
.top-bar {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
    position: sticky; top: 0; background: var(--sc-dark); padding: 10px 0; z-index: 10;
}
.search-wrapper { position: relative; width: 100%; max-width: 500px; }
.search-input {
    width: 100%; padding: 12px 45px 12px 15px; border-radius: 20px; border: none;
    background: #fff; color: #000; outline: none; font-size: 16px;
}
.search-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #aaa; }

/* --- گرید آهنگ‌ها (اصلاح شده برای سایز مناسب) --- */
.song-grid {
    display: grid;
    /* در دسکتاپ: حداقل 180 پیکسل، در موبایل: حداقل 140 پیکسل */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

/* کارت آهنگ */
.song-card {
    background: var(--sc-gray); border-radius: 4px; overflow: hidden; cursor: pointer;
    transition: 0.3s; position: relative;
}
.song-card:hover { transform: translateY(-5px); box-shadow: 0 4px 20px rgba(0,0,0,0.5); }

/* تصویر آهنگ (مربع شکل) */
.card-artwork {
    width: 100%; padding-bottom: 100%; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #333, #222);
}
.card-artwork i {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 3rem; color: rgba(255,255,255,0.1);
}

/* دکمه پلی روی عکس */
.card-play-btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 50px; height: 50px; background: var(--sc-orange); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: white;
    opacity: 0; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.song-card:hover .card-play-btn { opacity: 1; }

/* اطلاعات آهنگ */
.card-info { padding: 10px; }
.card-artist { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* دکمه‌های لایک و اضافه کردن */
.card-actions { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; opacity: 0; transition: 0.2s; z-index: 2; }
.song-card:hover .card-actions { opacity: 1; }
.action-btn-sm {
    width: 32px; height: 32px; background: rgba(0,0,0,0.7); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.1); color: white;
}
.action-btn-sm.liked { color: var(--sc-orange); border-color: var(--sc-orange); }

/* --- پلیر پایین صفحه --- */
.player-sticky {
    position: fixed; bottom: 0; left: 0; right: 0; background: #000; z-index: 1000;
    border-top: 1px solid #333; padding: 10px 240px 10px 20px; display: none;
}

/* نوار پیشرفت */
.progress-wrapper { direction: ltr; width: 100%; height: 3px; background: #333; cursor: pointer; }
.progress-fill { height: 100%; background: var(--sc-orange); width: 0%; }

/* کنترل‌های پلیر */
.player-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ctrl-btn { background: none; border: none; color: #ccc; font-size: 1rem; cursor: pointer; }
.ctrl-btn.active { color: var(--sc-orange); }
.play-main {
    width: 42px; height: 42px; border-radius: 50%; background: var(--sc-orange);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    color: white; border: none; cursor: pointer;
}

/* --- منوی پایین موبایل --- */
.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
    background: #000; border-top: 1px solid #222; z-index: 1001;
    justify-content: space-around; align-items: center;
}
.mob-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: 0.65rem; color: #666; cursor: pointer;
}
.mob-nav-item.active { color: var(--sc-orange); }
.mob-nav-item i { font-size: 1.2rem; }

/* --- مودال‌ها --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none; justify-content: center; align-items: center; z-index: 2000; padding: 20px; }
.modal-box { background: var(--sc-gray); padding: 30px; border-radius: 8px; width: 100%; max-width: 350px; position: relative; }
.modal-input { width: 100%; margin-bottom: 15px; padding: 12px; border-radius: 4px; border: 1px solid #444; background: #333; color: white; direction: ltr; text-align: right; }
.modal-btn { width: 100%; padding: 12px; background: var(--sc-orange); border: none; color: white; font-weight: bold; border-radius: 4px; cursor: pointer; }

/* --- ریسپانسیو (موبایل) --- */
@media (max-width: 992px) {
    .sidebar { display: none; }
    .main-area { margin-right: 0; padding: 15px; padding-bottom: 140px; } /* فضا برای پلیر و منو */
    
    /* تنظیم گرید برای موبایل: 2 ستون */
    .song-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    /* پلیر بالای منوی موبایل */
    .player-sticky { padding: 10px 15px; bottom: 60px; }
    
    /* نمایش منوی موبایل */
    .mobile-nav { display: flex; }
}