/* ==========================================================================
   1. General Layout & Main Container
   ========================================================================== */

.live-search-container {
    border-radius: 15px;
    font-family: inherit;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   2. Search Input Group
   ========================================================================== */

.search-input-group {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 0 auto 30px auto;
}

.search-input-group input {
    width: 100%;
    border: 2px solid var(--bs-info);
    color: #fff;
    padding: 1rem 4rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input-group input:focus {
    /* رنگ بنفش هاور/فوکوس */
    /* box-shadow: 0 0 0 0.25rem rgba(139, 61, 255, 0.5); */
    /* border-color: #8b3dff; */
}

.search-input-group .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary);
    font-size: 1.2rem;
}

.search-input-group .clear-icon, 
.search-input-group .spinner-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    cursor: pointer;
}

/* ==========================================================================
   3. Search Results Section
   ========================================================================== */

.search-results-wrapper {
    background-color: #1e1e2d;
    border-radius: 15px;
    padding: 20px;
    position: relative;
}

.results-title {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a2a35;
    padding-bottom: 10px;
}

/* Mobile-First Grid Layout for Results */
.results-list-container {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr)); /* 1 ستون در موبایل */
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Individual Result Item */
.result-item-wrapper {
    width: 100%;
    min-width: 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #1a1a24;
    border-radius: 10px;
    padding: 10px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s;
    overflow: hidden;
}

.result-item:hover {
    background-color: #252535;
}

.result-item .item-image-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.result-item .item-image-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.result-item .item-info {
    flex-grow: 1;
    text-align: right;
    min-width: 0;
}

.result-item .item-title,
.result-item .item-subtitle {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-item .item-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-item .item-subtitle {
    font-size: 12px;
    color: #aaa;
}

.result-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139, 61, 255, 0.8);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* ==========================================================================
   4. Category Filters Section
   ========================================================================== */

.category-filters-wrapper {
    max-width: 100%;
    margin: 0 auto 30px auto;
    overflow: hidden;
}

.categorySwiper .swiper-slide {
    width: auto !important; /* برای دکمه‌های با عرض متغیر */
}
.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #1a1a24;
    color: #ffffff;
    border: 1px solid #32323b;
    padding: 17px 30px;
    height: 3.6rem;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #252535;
    color: #fff;
}

.filter-btn.active {
    background-color: #252535;
    border-color: #8b3dff;
    color: #fff;
}

.filter-btn i {
    font-size: 16px;
    color: #8b3dff;
}

/* ==========================================================================
   5. Singers Section
   ========================================================================== */

.singers-section-wrapper {
    margin: 30px 0;
    padding: 15px;
}

.singers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.singers-header .section-title {
    color: #fff;
    font-size: 16px;
}

.singers-header .view-all-link {
    color: #8c8cbe;
    font-size: 12px;
    text-decoration: none;
}

.singers-swiper {
    height: 250px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
}

/* Mobile-First Styles for Singer Card (Vertical Layout) */
.singer-card {
    width: 100%;
    display: flex;
    flex-direction: column; /* چیدمان عمودی: تصویر بالای نام */
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    height: 100%;
    box-sizing: border-box;
    /* پس زمینه و padding از .result-item الگوبرداری شده */
    background: transparent;
    padding: 5px;
}

.singer-card:hover {
    background: #2a2a40;
    border-radius: 12px;
}

.singer-img-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: 8px; /* فاصله بین تصویر و نام */
}

.singer-img-wrapper img.singer-thumb { /* برای افزایش اولویت نسبت به کلاس دیگر */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.singer-card .singer-name {
    color: #fff;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.3;
}

/* ==========================================================================
   6. General Swiper Styles (Pagination)
   ========================================================================== */

.live-search-container .swiper-pagination {
    position: absolute;
    bottom: -30px !important;
    left: 50% !important;
    transform: translateX(-50%);
    /* width: auto !important; */
}

.live-search-container .swiper-pagination-bullet {
    background: #9494af;
    opacity: 0.5;
    width: 6px;
    height: 6px;
    transition: all 0.3s ease;
}

.live-search-container .swiper-pagination-bullet-active {
    background: #ffffff;
    opacity: 1;
}

.live-search-container .swiper-pagination-bullet-active-next,
.live-search-container .swiper-pagination-bullet-active-prev {
    opacity: 0.7;
}

.live-search-container .swiper-pagination-bullet-active-next-next,
.live-search-container .swiper-pagination-bullet-active-prev-prev {
    opacity: 0.4;
}


/* ==========================================================================
   7. Responsive Styles (Consolidated Media Queries)
   ========================================================================== */

/* --- Very Small Mobile (<= 480px) --- */
@media (max-width: 480px) {
    .category-filters-wrapper .filter-btn {
        padding: 0;
        height: 60px;
        width: 60px;
        font-size: 0.7rem;
    }
    
    .category-filters-wrapper .filter-btn > svg {
        width: 100%;
        height: 32%;
    }
}

/* --- Tablet & Up (>= 768px) --- */
@media (min-width: 768px) {
    /* Search Results Grid */
    .results-list-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Singers Swiper: 1 row */
    .singers-swiper .swiper-slide {
        height: 100% !important;
    }

    /* Singer Card Layout: Horizontal */
    .singer-card {
        flex-direction: row; /* چیدمان افقی */
        text-align: right;
        background: #1e1e2d; /* پس زمینه اصلی برای حالت افقی */
        border-radius: 12px;
        padding: 10px 15px;
    }
    
    .singer-card:hover {
        background: #2a2a40;
    }

    .singer-img-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 0;
        margin-left: 10px;
    }
    
    .singer-card .singer-name {
        font-size: 14px;
        font-weight: bold;
    }
}

/* --- Small Desktop & Up (>= 1024px) --- */
@media (min-width: 1024px) {
    /* Search Results Grid */
    .results-list-container {
        grid-template-columns: repeat(4, minmax(0, 1fr)); 
    }

    /* Singers Swiper: 2 rows again */
    /* 20px spaceBetween from JS -> 1 row of space */
    .singers-swiper .swiper-slide {
        height: calc((100% - 20px) / 2) !important;
    }
}

/* --- Large Desktop & Up (>= 1200px) --- */
@media (min-width: 1200px) {
    /* Search Results Grid */
    .results-list-container {
        grid-template-columns: repeat(5, minmax(0, 1fr)); 
    }
}

/* --- Mobile Default Height for Singers Swiper (2 rows) --- */
/* This is outside media queries but applies to mobile */
/* 15px spaceBetween from JS -> 1 row of space */
.singers-swiper .swiper-slide {
    height: calc((100% - 15px) / 2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
