/* =========================
   Layout & Header
   ========================= */

.site-header {
    padding: 24px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* اگر container عمومی دارید، این را با آن هماهنگ کنید */
.site-header .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
   Hero Section
   ========================= */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
    gap: 24px;
    align-items: start;
    margin-top: 8px;
}

.hero-card {
    background: radial-gradient(circle at top left, rgba(72, 61, 139, 0.55), transparent 60%),
                linear-gradient(135deg, rgba(25, 25, 35, 0.95), rgba(10, 10, 18, 0.98));
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.04), transparent 55%);
    pointer-events: none;
}

.hero-title {
    font-size: 1.7rem;
    line-height: 1.25;
    font-weight: 700;
    color: #ffffff;
}

.hero-desc {
    font-size: 0.94rem;
    line-height: 1.7;
    color: rgba(235, 240, 255, 0.78);
    max-width: 46rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

/* =========================
   Stats Cards
   ========================= */

.stat-card {
    background: linear-gradient(135deg, rgba(18, 18, 28, 0.95), rgba(18, 18, 36, 0.98));
    border-radius: 14px;
    padding: 14px 13px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.015);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f4f5ff;
}

.stat-label {
    font-size: 0.78rem;
    color: rgba(215, 220, 245, 0.75);
}

/* =========================
   Filters / Controls
   ========================= */

.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
}

/* اگر فیلترهای خاصی دارید، می‌توانیم بعداً برایشان استایل جزئی‌تر بنویسیم */

/* =========================
   Playlist Grid
   ========================= */

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

/* =========================
   Playlist Card (اصلی)
   ========================= */

.playlist-card {
    background: linear-gradient(145deg, #14141f, #111119);
    border-radius: 18px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.015);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
    position: relative;
    overflow: hidden;
}

.playlist-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(circle at top left, rgba(138, 180, 255, 0.2), transparent 60%);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.playlist-card:hover {
    transform: translateY(-4px);
    border-color: rgba(120, 190, 255, 0.55);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(120, 190, 255, 0.2);
    background: radial-gradient(circle at top left, rgba(26, 115, 232, 0.12), #111118);
}

.playlist-card:hover::before {
    opacity: 1;
}

/* هماهنگ با کلاس‌هایی که در PHP استفاده می‌شود */
.playlist-card__cover {
    border-radius: 14px;
    overflow: hidden;
    background: #1b1b27;
    position: relative;
    aspect-ratio: 1 / 1;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.72);
}

.playlist-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.playlist-card:hover .playlist-card__cover img {
    transform: scale(1.06);
    filter: brightness(1.06);
}

.playlist-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* عنوان خوانا، با کنتراست بالا */
.playlist-card__title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* توضیحات خوانا، با محدودیت خطوط برای جلوگیری از به‌هم‌ریختگی */
.playlist-card__description {
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(220, 225, 245, 0.78);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* اگر متادیتا مثل تعداد ترک یا مدت‌زمان دارید */
.playlist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 4px;
    font-size: 0.74rem;
    color: rgba(190, 198, 230, 0.82);
}

/* پایین کارت (مثلاً لینک، دکمه پخش و …) */
.playlist-footer {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.playlist-card__link {
    font-size: 0.78rem;
    font-weight: 600;
    color: #7bb1ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 999px;
    background: rgba(123, 177, 255, 0.08);
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.playlist-card__link:hover {
    background: rgba(123, 177, 255, 0.18);
    color: #dfe9ff;
}

/* =========================
   Search Form
   ========================= */

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(15, 15, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    max-width: 100%;
    width: 100%;
}

.search-form:focus-within {
    border-color: rgba(123, 177, 255, 0.8);
    box-shadow:
        0 0 0 1px rgba(123, 177, 255, 0.5),
        0 0 0 6px rgba(123, 177, 255, 0.18);
}

/* اینجا input را طوری تنظیم می‌کنیم که در موبایل هم جا شود */
.search-form__input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #f5f7ff;
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 8px 6px 8px 10px;
}

.search-form__input::placeholder {
    color: rgba(190, 198, 230, 0.68);
}

/* دکمه سرچ (متن + آیکون در دسکتاپ) */
.search-form__button {
    flex: 0 0 auto;
    border: none;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #f9fbff;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    transition:
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.search-form__button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow:
        0 10px 26px rgba(37, 99, 235, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.search-form__button:active {
    transform: translateY(0);
    box-shadow:
        0 4px 14px rgba(37, 99, 235, 0.48),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* متن دکمه */
.search-form__text {
    display: inline-block;
}

/* آیکون */
.search-form__icon {
    width: 17px;
    height: 17px;
    display: inline-block;
    color: currentColor;
}

/* =========================
   Responsive Breakpoints
   ========================= */

/* <= 980px */
@media (max-width: 980px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .playlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* <= 768px: کمی فشرده‌تر شدن و توجه به spacing */
@media (max-width: 768px) {
    .site-header {
        padding: 18px 0 10px;
    }

    .hero-card {
        padding: 18px 16px;
    }

    .playlist-grid {
        gap: 16px;
    }

    .playlist-card {
        padding: 9px;
    }
}

/* <= 640px */
@media (max-width: 640px) {
    .filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .playlist-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-title {
        font-size: 1.45rem;
    }

    .hero-desc {
        font-size: 0.9rem;
    }

    .playlist-card__title {
        font-size: 0.94rem;
    }

    .playlist-card__description {
        font-size: 0.8rem;
    }
}

/* =========================
   Small Phones – سرچ بار
   (حل مشکل رفتن متن زیر آیکون)
   ========================= */

@media (max-width: 480px) {
    .search-form {
        padding: 5px;
        gap: 6px;
    }

    .search-form__input {
        font-size: 0.78rem;        /* متن کوچک‌تر تا در یک خط جا شود */
        padding: 7px 4px 7px 6px;
    }

    /* فقط آیکون را نگه می‌داریم، متن دکمه حذف می‌شود */
    .search-form__text {
        display: none;
    }

    .search-form__button {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 999px;
        box-shadow:
            0 8px 20px rgba(37, 99, 235, 0.45),
            0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    .search-form__icon {
        width: 18px;
        height: 18px;
    }

    /* برای جلوگیری از رفتن دکمه به خط بعد */
    .search-form {
        flex-wrap: nowrap;
    }
}

/* =========================
   Extra Small (اختیاری، اگر لازم شد)
   ========================= */

@media (max-width: 360px) {
    .search-form__input {
        font-size: 0.74rem;
    }
}
