/* ==========================================
   COLLECTIONS PAGE - CLEAN DESIGN
   ========================================== */

.collections-page {
    background: transparent;
    min-height: 100vh;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    z-index: 1;
}

/* --- Pro Banner (Hero) ---
   همون تکنیکی که برای هدر صفحه‌ی tutorials پیاده شد اینجا هم اعمال شد:
   عکس هدر با یک ناحیه‌ی محوشونده (mask) تا ~۱/۳ ارتفاع صفحه (vh) ادامه پیدا می‌کنه و
   کارت‌های زیرش (breadcrumbs + لی‌اوت اصلی) با margin-bottom منفی روی همون ناحیه می‌شینن.
   نکته‌ی مهم: چون base.css سراسری `* { box-sizing: border-box }` گذاشته، اگه فقط
   padding-bottom اضافه می‌کردیم ارتفاع 420px همون‌قدر می‌موند و محتوای پایین هیرو (تایتل/دکمه‌ها)
   فشرده می‌شد. برای همین این المنت جداگانه box-sizing:content-box گرفته تا padding-bottom
   کاملاً «اضافه» بشه، نه اینکه از همون 420px کم بخوره. */
.collections-hero {
    position: relative;
    box-sizing: content-box;
    height: 420px;
    padding-bottom: 30vh;
    margin-bottom: -30vh;
    background-color: #0f1420;
    background-size: cover;
    background-position: center;
    overflow: visible;
    display: flex;
    align-items: flex-end;
    -webkit-mask-image: linear-gradient(to top, transparent 0, rgba(0,0,0,.55) 45%, #000 80%, #000 100%);
            mask-image: linear-gradient(to top, transparent 0, rgba(0,0,0,.55) 45%, #000 80%, #000 100%);
}

.collections-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 12, 20, 0.95) 0%, rgba(10, 12, 20, 0.7) 40%, rgba(10, 12, 20, 0.1) 100%);
}

.collections-hero__content {
    position: relative;
    z-index: 2;
    padding: 40px;
    max-width: 640px;
}

.collections-hero__badge {
    display: inline-block;
    background: #10b981;
    color: #06210f;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.collections-hero__title {
    font-size: 40px;
    font-weight: 900;
    color: #fff;
    margin: 0 0 12px 0;
    line-height: 1.15;
}

.collections-hero__desc {
    font-size: 16px;
    color: #cbd5e1;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.collections-hero__stats {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.collections-hero__stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.collections-hero__stat i {
    color: #10b981;
    font-size: 20px;
}

.collections-hero__stat-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.collections-hero__stat strong {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.collections-hero__stat span {
    font-size: 12px;
    color: #94a3b8;
}

.collections-hero__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 24px;
}

.collections-hero__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #10b981;
    background-size: cover;
    background-position: center;
    border: 1px solid #2a2a2e;
}

.collections-hero__author-name {
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
}

.collections-hero__author-name:hover {
    text-decoration: underline;
}

.collections-hero__actions {
    display: flex;
    gap: 12px;
}

/* --- Breadcrumbs --- */
.collections-breadcrumbs {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 24px 0;
}

.collections-breadcrumbs .breadcrumbs {
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 !important;
}

.collections-breadcrumbs .breadcrumbs__link {
    color: #cbd5e1 !important;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 13px;
    background: transparent !important;
}

.collections-breadcrumbs .breadcrumbs__link:hover {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.collections-breadcrumbs .breadcrumbs__current {
    color: #fff !important;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 6px;
}

.collections-breadcrumbs .breadcrumbs__separator {
    color: #64748b;
    font-size: 10px;
}

/* --- 3-Column Layout --- */
.collections-layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* --- Sidebars --- */
.collections-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: #1a1a1c;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
    padding: 20px;
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: #10b981;
}

/* --- Filter List --- */
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-list a i {
    width: 18px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s;
}

.filter-list a:hover {
    background: #0f0f10;
    color: #fff;
}

.filter-list a.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-weight: 600;
}

.filter-list a.active i {
    color: #10b981;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #10b981;
    color: #fff;
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #2a2a2e;
    color: #e0e0e0;
    border: 1px solid #3a3a3e;
}

.btn-secondary:hover {
    background: #3a3a3e;
    border-color: #10b981;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* --- Section Headers --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #10b981;
}

.section-link {
    color: #10b981;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}

.section-link:hover {
    gap: 10px;
}

.collections-section {
    margin-bottom: 48px;
}

/* --- Collections Grid --- */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.collection-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    padding: 0; /* نشتی از .collection-card پایه در base.css (padding: var(--spacing-lg)) رو خنثی می‌کنه؛ padding واقعی رو __top/__bottom خودشون می‌دن */
    border-radius: 12px;
    overflow: hidden;
    background-color: #0f1420;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    border-color: #10b981;
}

.collection-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10, 12, 20, 0.1) 0%, rgba(10, 12, 20, 0.4) 50%, rgba(10, 12, 20, 0.95) 100%);
}

.collection-card__top,
.collection-card__bottom {
    position: relative;
    z-index: 1;
    padding: 16px;
}

.collection-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.collection-card__category {
    background: rgba(0, 0, 0, 0.55); /* نشتی از var(--primary-light) پایه در base.css رو خنثی می‌کنه (با متن سفید کنتراست بدی داشت) */
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collection-card__likes {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

.collection-card__likes i {
    color: #ef4444;
}

.collection-card__title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
}

.collection-card__desc {
    font-size: 13px;
    color: #cbd5e1;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.collection-card__meta {
    display: flex;
    gap: 16px;
    margin: 0; /* نشتی margin-bottom: var(--spacing-md) از base.css رو خنثی می‌کنه */
    font-size: 13px;
    color: #94a3b8;
}

.collection-card__meta i {
    color: #10b981;
    margin-right: 4px;
}

/* --- Popular Rows --- */
.collection-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collection-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 20px;
    background: #1a1a1c;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.collection-row:hover {
    border-color: #10b981;
    transform: translateX(4px);
}

.collection-row__thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background-color: #2a2a2e;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.collection-row__body {
    min-width: 0;
}

.collection-row__title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-row__desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-row__stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.collection-row__stats i {
    color: #10b981;
    margin-right: 4px;
}

/* --- Right Rail Cards --- */
.rail-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #0f1420;
    background-size: cover;
    background-position: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #2a2a2e;
}

.rail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: #10b981;
}

.rail-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 12, 20, 0.95) 0%, rgba(10, 12, 20, 0.4) 100%);
    z-index: 1;
}

.rail-card__content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.rail-card__title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.rail-card__text {
    font-size: 13px;
    color: #cbd5e1;
    margin: 0 0 16px 0;
}

/* --- Trending Widget --- */
.trending-widget {
    background: #1a1a1c;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
    padding: 20px;
}

.trending-widget__title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-widget__title i {
    color: #10b981;
}

.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.trending-item a:hover {
    transform: translateX(4px);
}

.trending-rank {
    width: 24px;
    font-size: 16px;
    font-weight: 800;
    color: #10b981;
    flex-shrink: 0;
    text-align: center;
}

.trending-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #2a2a2e;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #10b981;
    font-size: 16px;
}

.trending-info {
    flex: 1;
    min-width: 0;
}

.trending-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trending-downloads {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Premium Rail Card --- */
.rail-premium {
    min-height: 280px;
    border-color: rgba(234, 179, 8, 0.3);
}

.rail-premium:hover {
    border-color: #eab308;
    box-shadow: 0 8px 24px rgba(234, 179, 8, 0.15);
}

.premium-icon {
    font-size: 32px;
    color: #eab308;
    margin-bottom: 12px;
}

.premium-features-compact {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.premium-features-compact li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
}

.premium-features-compact i {
    color: #10b981;
    font-size: 12px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #1a1a1c;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
}

.empty-state i {
    font-size: 48px;
    color: #64748b;
    margin-bottom: 16px;
}

.empty-state__title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.empty-state__text {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .collections-layout {
        grid-template-columns: 240px 1fr;
    }
    .collections-sidebar.right-rail {
        display: none;
    }
}

@media (max-width: 900px) {
    .collections-layout {
        grid-template-columns: 1fr;
        padding: 24px 16px 40px;
    }
    .collections-sidebar.left-rail {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
    .collections-hero {
        height: 320px;
        padding-bottom: 24vh;
        margin-bottom: -24vh;
        -webkit-mask-image: linear-gradient(to top, transparent 0, rgba(0,0,0,.55) 45%, #000 80%, #000 100%);
                mask-image: linear-gradient(to top, transparent 0, rgba(0,0,0,.55) 45%, #000 80%, #000 100%);
    }
    .collections-hero__title {
        font-size: 28px;
    }
    .collections-hero__desc {
        font-size: 14px;
    }
    .collections-hero__content {
        padding: 24px;
    }
}

@media (max-width: 600px) {
    .collections-hero {
        height: 280px;
        padding-bottom: 18vh;
        margin-bottom: -18vh;
        -webkit-mask-image: linear-gradient(to top, transparent 0, rgba(0,0,0,.55) 45%, #000 80%, #000 100%);
                mask-image: linear-gradient(to top, transparent 0, rgba(0,0,0,.55) 45%, #000 80%, #000 100%);
    }
    .collections-hero__title {
        font-size: 24px;
    }
    .collections-hero__stats {
        gap: 16px;
    }
    .collections-grid {
        grid-template-columns: 1fr;
    }
    .collection-row {
        grid-template-columns: 60px 1fr;
        grid-template-areas: "thumb body" "stats stats";
        padding: 12px;
        gap: 12px;
    }
    .collection-row__thumb {
        grid-area: thumb;
        width: 60px;
        height: 60px;
    }
    .collection-row__body {
        grid-area: body;
    }
    .collection-row__stats {
        grid-area: stats;
        width: 100%;
        justify-content: space-between;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid #2a2a2e;
    }
}