/* home-desktop.css */
:root {
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-hover: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.2);
    --blur-sm: blur(8px);
    --blur-md: blur(10px);
    --blur-lg: blur(20px);
    --primary: #0044cc;
    --text-muted: #888;
    --text-light: #ccc;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 2rem;
    --header-bg: rgba(10, 10, 10, 0.75);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    background: #000;
    color: #fff;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    padding-bottom: 50px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
body::-webkit-scrollbar { display: none; }
a { color: inherit; text-decoration: none; }

/* ---------- هدر شیشه‌ای ---------- */
header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    background: var(--header-bg);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    padding: 3px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-img { height: 44px; }
.menu {
    display: flex;
    gap: 22px;
    list-style: none;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-right: auto;
}
.menu a {
    color: #bbb;
    font-weight: 400;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.menu a:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }

/* کادر جستجوی شیشه‌ای */
.search-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 6px 16px;
    width: 200px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.search-box:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    color: #fff;
}
.search-icon {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    position: relative;
    transition: border-color 0.2s;
}
.search-box:hover .search-icon { border-color: #fff; }
.search-icon::after {
    content: '';
    position: absolute;
    bottom: -2px; right: -4px;
    width: 6px; height: 2px;
    background: var(--text-muted);
    transform: rotate(45deg);
    transition: background 0.2s;
}
.search-box:hover .search-icon::after { background: #fff; }

.user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: #2a2a2a;
    background-size: cover;
    background-position: center;
    border: 1.5px solid rgba(255,255,255,0.15);
    transition: border-color 0.3s, transform 0.3s;
    flex-shrink: 0;
}
.user-avatar:hover {
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.08);
}
.login-btn {
    background: rgba(255,255,255,0.1);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--glass-border-hover);
    padding: 8px 18px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    color: #ddd;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    white-space: nowrap;
}
.login-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

/* دکمهٔ خرید اشتراک – با انیمیشن چرخشی دور حاشیه */
.subscribe-btn {
    position: relative;
    background: #0044cc;
    color: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    box-shadow: none;
    overflow: hidden;
    z-index: 1;
}
.subscribe-btn::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, #0044cc, #ffffff, #0044cc, #ffffff, #0044cc);
    animation: rotate-border 4s linear infinite;
    z-index: -1;
    opacity: 0.9;
    filter: blur(6px);
}
.subscribe-btn::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: #0044cc;
    z-index: -1;
}
@keyframes rotate-border {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.subscribe-btn:hover {
    background: #003399;
}

/* ---------- اسلایدر بنرها (فقط محو با ارتفاع داینامیک) ---------- */
.banner-section {
    position: relative;
    width: 100%;
    margin-top: -10px;
    margin-bottom: 30px;
    background: #000;
}
.banner-scroll {
    position: relative;
    width: 100%;
    overflow: hidden;
    transition: height 0.4s ease; /* نرم‌ شدن تغییر ارتفاع */
    height: auto; /* در ابتدا auto – با JS مقدار دهی می‌شود */
}
.banner-scroll a, .banner-scroll .banner-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.banner-scroll a.active, .banner-scroll .banner-slide.active {
    opacity: 1;
    pointer-events: auto;
}
.banner-scroll img {
    width: 100%;
    height: auto;  /* ارتفاع طبیعی تصویر */
    display: block;
}
.banner-fade {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to top, #000, transparent);
    pointer-events: none;
    z-index: 5;
}
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20,20,20,0.55);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border-hover);
    border-radius: 50%;
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s, border-color 0.3s;
    color: #fff;
    font-size: 30px;
    user-select: none;
}
.banner-arrow:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}
.banner-next { left: 15px; }
.banner-prev { right: 15px; }

/* ---------- بخش فیلتر پیشرفته (زیر بنر) ---------- */
.filter-bar {
    background: rgba(30, 30, 35, 0.85);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 25px 30px 25px;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
}
.filter-item {
    flex: 1 1 0;
    min-width: 120px;
    position: relative;
}
.filter-item .filter-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 400;
    letter-spacing: 0.3px;
}
.filter-item .filter-selector {
    background: rgba(255,255,255,0.06);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    min-height: 40px;
}
.filter-item .filter-selector:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}
.filter-item .filter-selector .arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.filter-item .filter-selector.active .arrow {
    transform: rotate(180deg);
}
.filter-item .filter-selector .selected-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.filter-item .filter-selector .selected-count {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

/* منوی کشویی هر فیلتر */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 6px 0;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 300;
    box-shadow: 0 8px 30px rgba(0,0,0,0.7);
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}
.filter-dropdown::-webkit-scrollbar {
    width: 4px;
}
.filter-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.filter-dropdown::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}
.filter-dropdown.open {
    display: block;
}
.filter-dropdown .option {
    padding: 8px 16px;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.filter-dropdown .option:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.filter-dropdown .option .check {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.filter-dropdown .option.selected .check {
    background: var(--primary);
    border-color: var(--primary);
}
.filter-dropdown .option.selected .check::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
}
.filter-dropdown .option .label-text {
    flex: 1;
}
.filter-dropdown .option .badge-max {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    padding: 0 8px;
    border-radius: 10px;
}

/* دکمه اعمال فیلتر */
.filter-apply {
    flex: 0 0 auto;
    min-width: 110px;
    margin-top: 22px;
}
.filter-apply-btn {
    background: #0044cc;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    width: 100%;
    min-height: 40px;
    font-family: 'Vazirmatn', sans-serif;
    letter-spacing: 0.3px;

}
.filter-apply-btn:hover {
    background: #003399;
    transform: scale(1.02);
}
.filter-apply-btn:active {
    transform: scale(0.97);
}

/* پیغام مینیمال برای انتخاب حداکثر ۳ مورد */
.filter-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 20px;
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 13px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.filter-toast.show {
    opacity: 1;
}

/* ---------- سطرهای فیلم ---------- */
.film-row { margin: 35px 25px; }
.row-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}
.row-header h2 {
    color: #fff; font-weight: 600; font-size: 20px;
    border-right: 4px solid var(--primary);
    padding-right: 12px;
}
.view-more {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    padding: 6px 16px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    white-space: nowrap;
}
.view-more:hover {
    background: var(--glass-bg-hover);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.scroll-wrapper { position: relative; }
.scroll-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(20,20,20,0.55);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 50%;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 25;
    font-size: 24px;
    transition: background 0.3s, border-color 0.3s;
    user-select: none;
}
.scroll-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
}
.scroll-left { right: -20px; }
.scroll-right { left: -20px; }

.film-row .scroll {
    display: flex; gap: 20px; overflow-x: auto;
    padding: 0 45px 25px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}
.film-row .scroll::-webkit-scrollbar { display: none; }

.fade-left, .fade-right {
    position: absolute; top: 0; bottom: 0;
    width: 50px; z-index: 20; pointer-events: none;
}
.fade-left {
    right: 0;
    background: linear-gradient(to left, #000, transparent);
}
.fade-right {
    left: 0;
    background: linear-gradient(to right, #000, transparent);
}

.film-card {
    min-width: 160px; border-radius: var(--radius-md);
    overflow: visible; flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    transition: opacity 0.3s;
}
.film-card:hover { opacity: 0.85; }
.film-card img {
    width: 100%; height: 210px; object-fit: cover;
    border-radius: var(--radius-md); display: block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: opacity 0.3s;
}
.film-card:hover img { opacity: 0.9; }
.film-card .info { padding: 10px 5px; }
.film-card h3 {
    font-size: 14px; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: 500; color: #fff;
}
.film-card .en-title {
    font-size: 11px; color: #999; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.film-card .year { font-size: 12px; color: #777; }

/* ---------- نوار پایین شیشه‌ای ---------- */
.bottom-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(10,10,10,0.8);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 28px; z-index: 100;
}
.bottom-left, .bottom-right { display: flex; gap: 10px; align-items: center; }
.bottom-pill {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px 14px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-light);
    transition: background 0.3s, color 0.3s;
    white-space: nowrap;
}
.bottom-pill:hover {
    background: var(--glass-bg-hover);
    color: #fff;
}
.bottom-right .bottom-pill {
    background: var(--glass-bg);
    font-weight: 500;
}
.bottom-right .bottom-pill:hover { background: rgba(255,255,255,0.18); }

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; bottom: 110%;
    background: rgba(0,0,0,0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    padding: 4px 0; min-width: 160px;
    display: none; z-index: 200;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block; padding: 8px 16px;
    color: var(--text-light); font-size: 13px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.dropdown-menu a:hover { background: rgba(255,255,255,0.1); color: #fff; }

.bottom-right .dropdown-menu {
    right: auto;
    left: 0;
}

.bottom-right .dropdown-menu a::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}
.bottom-right .dropdown-menu a:nth-child(1)::before { background: #E4405F; }
.bottom-right .dropdown-menu a:nth-child(2)::before { background: #ED145B; }
.bottom-right .dropdown-menu a:nth-child(3)::before { background: #00A859; }
.bottom-right .dropdown-menu a:nth-child(4)::before { background: #FFD700; }
.bottom-right .dropdown-menu a:nth-child(5)::before { background: #FF5722; }

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 12px;
    }
    .filter-item {
        min-width: unset;
        width: 100%;
    }
    .filter-apply {
        width: 100%;
    }
    .filter-dropdown {
        max-height: 160px;
    }
    .banner-arrow {
        width: 40px; height: 40px;
        font-size: 20px;
    }
    .scroll-btn {
        width: 36px; height: 36px;
        font-size: 18px;
    }
    .film-row .scroll {
        padding: 0 20px 20px;
    }
    .film-card {
        min-width: 120px;
    }
    .film-card img {
        height: 160px;
    }
    header {
        flex-wrap: wrap;
        padding: 8px 16px;
        gap: 12px;
    }
    .menu {
        gap: 12px;
        flex-wrap: wrap;
    }
    .header-actions {
        margin-right: 0;
        width: 100%;
        justify-content: flex-start;
    }
    .search-box {
        width: 140px;
    }
}
@media (max-width: 480px) {
    .filter-bar {
        margin: 0 10px 20px 10px;
        padding: 12px;
    }
    .filter-item .filter-selector {
        font-size: 12px;
        padding: 6px 10px;
        min-height: 34px;
    }
    .filter-apply-btn {
        font-size: 13px;
        padding: 8px 14px;
        min-height: 34px;
    }
    .film-card {
        min-width: 100px;
    }
    .film-card img {
        height: 130px;
    }
}