/* ============================================================
   EXPLORE + HOME STYLES
   ============================================================ */

/* ---------- HOME HERO ---------- */
.home-hero {
    position: relative;
    width: 100%;
    padding: clamp(48px, 8vw, 88px) var(--page-gutter, 28px) clamp(40px, 6vw, 64px);
    overflow: hidden;
    text-align: center;
}

.home-hero__glow {
    position: absolute;
    top: -220px;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 120vw);
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 62%);
    pointer-events: none;
    filter: blur(48px);
}

.home-hero__inner {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
}

.home-hero__title {
    font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    font-weight: 800;
    color: var(--text, #f1f5f9);
    margin: 0 0 14px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.home-hero__sub {
    color: var(--text-secondary, #94a3b8);
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    line-height: 1.8;
    margin: 0 auto 32px;
    max-width: 620px;
}

.home-hero__stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.hero-stat__value {
    font-size: 1.55rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-stat__label {
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
    font-weight: 500;
}

.home-hero__cta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: transparent;
    color: #6ebbff;
    border: 1.5px solid #6ebbff;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-outline::after {
    display: none;
}

.btn-outline:hover {
    background: #6ebbff;
    color: #000;
}

/* ---------- HOME MAIN ---------- */
.home-main {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 30px 80px;
    flex-shrink: 0;
    /* ✅ داخل body flex */
}

.home-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 80px 20px;
    color: #666;
}

.home-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #1f1f1f;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: home-spin 0.8s linear infinite;
}

@keyframes home-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- HOME SECTION ---------- */
.home-section {
    margin-bottom: 46px;
    animation: home-fade-in 0.5s ease both;
}

@keyframes home-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.home-section__title-wrap {
    text-align: right;
}

.home-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    text-align: right;
}

.home-section__title-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--c, #6ebbff) 15%, transparent);
    color: var(--c, #6ebbff);
}

.home-section__sub {
    color: #777;
    font-size: 0.85rem;
    margin: 0;
    text-align: right;
}

.home-section__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6ebbff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    padding-bottom: 0;
}

.home-section__link::after {
    display: none;
}

.home-section__link:hover {
    color: #8ed0ff;
    gap: 10px;
}

/* ---------- GRID ---------- */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.home-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ============================================================
   PROJECT CARD
   ============================================================ */
.pc {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated, #0c1220);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    transition:
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
    text-decoration: none;
    color: inherit;
    text-align: right;
    cursor: pointer;
    content-visibility: auto;
    contain-intrinsic-size: 320px;
}

.pc::after {
    display: none;
}

.pc:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow, 0 12px 40px rgba(59, 130, 246, 0.12));
    background: var(--bg-surface, #111827);
}

.pc:focus-visible {
    outline: 2px solid var(--accent, #3b82f6);
    outline-offset: 3px;
}

.pc__cover {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pc__cover-initial {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(110, 187, 255, 0.15);
}

.pc__cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 50%);
}

.pc__badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    z-index: 2;
}

.pc__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pc__badge--hot {
    background: linear-gradient(135deg, #ff5f6d, #ffc371);
    color: #fff;
    border: none;
}

.pc__badge--new {
    background: rgba(34, 197, 94, 0.85);
    border: none;
}

.pc__badge--featured {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
}

.pc__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.pc__title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.pc__desc {
    color: #888;
    font-size: 0.84rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.pc__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pc__tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid;
}

.pc__tag--more {
    background: #1a1a1a;
    color: #777;
    border-color: #262626;
}

.pc__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #161616;
    margin-top: auto;
}

/* Owner (مالک پروژه) */
.pc__owner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pc__owner-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6ebbff, #007bff);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.pc__owner-name {
    color: #999;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc__stats {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pc__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pc__stat svg {
    color: #666;
}

.pc__stat--star svg {
    color: #fbbf24;
}

.pc__stat--download svg {
    color: #34d399;
}

.pc__stat--rating svg {
    color: #ec4899;
}

/* ============================================================
   EXPLORE PAGE
   ============================================================ */
.explore-page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 30px 80px;
    flex-shrink: 0;
}

.explore-hero {
    text-align: center;
    margin-bottom: 32px;
}

.explore-hero__title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    text-align: center;
}

.explore-hero__sub {
    color: #888;
    font-size: 1rem;
    margin: 0;
    text-align: center;
}

/* ---------- Filters ---------- */
.explore-filters {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 26px;
}

.explore-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface, #111827);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
    border-radius: var(--radius, 12px);
    padding: 0 14px;
    min-height: 48px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.explore-search:focus-within {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px var(--accent-muted, rgba(59, 130, 246, 0.12));
}

.explore-search svg {
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
}

.explore-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    min-height: 44px;
    padding: 12px 0;
    color: var(--text, #f1f5f9);
    font-size: 0.95rem;
    font-family: inherit;
}

.explore-search input:focus {
    box-shadow: none;
    border: none;
}

.explore-search input::placeholder {
    color: var(--text-muted, #64748b);
}

.explore-sort {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: var(--bg-elevated, #0c1220);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
    border-radius: var(--radius, 12px);
    overflow-x: auto;
    scrollbar-width: none;
}

.explore-sort::-webkit-scrollbar {
    display: none;
}

.ex-sort {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ex-sort:hover {
    background: #161616;
    color: #ccc;
}

.ex-sort.active {
    background: #1e1e1e;
    color: #fff;
}

.ex-sort.active svg {
    color: #6ebbff;
}

.explore-types {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ex-chip {
    padding: 6px 14px;
    background: #101010;
    border: 1px solid #1f1f1f;
    border-radius: 20px;
    color: #999;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ex-chip:hover {
    border-color: #2a2a2a;
    color: #ddd;
}

.ex-chip.active {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.15), rgba(110, 187, 255, 0.08));
    border-color: rgba(110, 187, 255, 0.4);
    color: #6ebbff;
}

/* ---------- Meta ---------- */
.explore-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 4px;
    font-size: 0.85rem;
    color: #777;
    text-align: right;
}

/* ---------- Grid ---------- */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    min-height: 400px;
}

/* ---------- Empty state ---------- */
.explore-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    background: #0b0b0b;
    border: 1px dashed #1f1f1f;
    border-radius: 14px;
}

.explore-empty__icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.explore-empty__title {
    color: #ccc;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.explore-empty__sub {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- Pagination ---------- */
.explore-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 30px 0 0;
    flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .home-hero {
        padding: 50px 20px 40px;
    }

    .home-hero__title {
        font-size: 1.7rem;
    }

    .home-hero__sub {
        font-size: 0.92rem;
    }

    .home-hero__stats {
        gap: 24px;
    }

    .hero-stat__value {
        font-size: 1.2rem;
    }

    .home-main,
    .explore-page {
        padding-left: 16px;
        padding-right: 16px;
    }

    .home-section__title {
        font-size: 1.1rem;
    }

    .home-grid,
    .explore-grid {
        grid-template-columns: 1fr;
    }

    .explore-hero__title {
        font-size: 1.5rem;
    }
}

.pc {
    cursor: pointer;
}

.pc__owner-chip {
    gap: 6px;
}

.pc__owner-chip .user-chip__name {
    font-size: 0.78rem;
    color: #999;
}

.pc__owner-chip:hover .user-chip__name {
    color: #6ebbff;
}

/**
 * Copyright (c) 2026 Sobhan Rasoulzadeh Asl (Sobhan-SRZA / Mr. Sinre)
 *
 * Licensed under the BSD 3-Clause License.
 * See the LICENSE file in the project root for license information.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */