/* ===== MODERN TRENDING UI DESIGN ===== */

/* Skeuomorphic Trending Header – bright leather */
.modern-trending-header {
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.04) 6px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #c4a574 0%, #d4b896 35%, #e6d4b8 50%, #d4b896 65%, #c4a574 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.25),
        0 5px 15px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15),
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -1px 0 0 rgba(0, 0, 0, 0.1);
    border: 3px solid #8b7355;
    position: relative;
}

.modern-trending-header::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
    border-radius: 18px 18px 0 0;
}

.modern-trending-header::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 14px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.55);
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.trending-title-section {
    flex: 1;
    min-width: 300px;
}

.trending-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #2d2520;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    font-family: var(--default-font-family, 'Shrikhand');
}

.trending-subtitle {
    font-size: 1.2rem;
    color: #3d352c;
    margin: 0;
    font-weight: 500;
}

.header-stats {
    display: flex;
    gap: 20px;
}

/* Skeuomorphic Trending Stats */
.trending-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: repeating-linear-gradient(45deg, rgba(0,0,0,0.03) 0px, transparent 2px, transparent 4px, rgba(0,0,0,0.03) 6px), linear-gradient(135deg, #b8956a 0%, #c4a574 35%, #d4b896 50%, #c4a574 65%, #b8956a 100%);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.22), inset 0 2px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.12);
    border: 2px solid #8b7355;
    min-width: 140px;
    position: relative;
}

.stat-item::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 10px;
    right: 10px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.5);
    pointer-events: none;
}

.stat-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: #5c4d3d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    color: #2d2520;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255,255,255,0.4);
}

/* Featured Trending Banner – leather with stitch */
.featured-trending-banner {
    background: repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0px, transparent 2px, transparent 4px, rgba(0,0,0,0.04) 6px), repeating-linear-gradient(-45deg, rgba(0,0,0,0.03) 0px, transparent 2px, transparent 4px, rgba(0,0,0,0.03) 6px), linear-gradient(135deg, #c4a574 0%, #d4b896 35%, #e6d4b8 50%, #d4b896 65%, #c4a574 100%);
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25), inset 0 2px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.12);
    border: 3px solid #8b7355;
    position: relative;
    overflow: visible;
    min-height: 140px;
}

.featured-trending-banner::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2), rgba(255,255,255,0.4));
    border-radius: 15px 15px 0 0;
    z-index: 2;
}

.featured-trending-banner::after {
    content: '';
    position: absolute;
    bottom: 14px;
    left: 16px;
    right: 16px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.55);
    pointer-events: none;
    z-index: 2;
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
    min-height: 120px;
}

.banner-text {
    flex: 1;
    min-width: 300px;
}

.banner-text h2 {
    font-size: 1.8rem;
    color: #2d2520;
    margin: 0 0 8px 0;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255,255,255,0.4);
    line-height: 1.2;
}

.banner-text p {
    font-size: 1rem;
    color: #3d352c;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.trending-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3d352c;
    font-size: 0.9rem;
}

.info-icon {
    font-size: 1.1rem;
}

.refresh-btn {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 25%, transparent 50%),
        linear-gradient(145deg, #80e5f0 0%, #4dd0e1 25%, #26c6da 50%, #00bcd4 75%, #0097a7 100%);
    border: 2px solid #0097a7;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #0f0f0f;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow:
        0 7px 0 0 #006064,
        0 9px 20px rgba(0, 0, 0, 0.35),
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 9px 0 0 #006064,
        0 11px 24px rgba(0, 0, 0, 0.45),
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.refresh-btn:active {
    transform: translateY(3px);
    box-shadow:
        0 2px 0 0 #006064,
        0 4px 10px rgba(0, 0, 0, 0.35),
        inset 0 3px 10px rgba(0, 0, 0, 0.25);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Trending Navigation Tabs */
.trending-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.trending-tab {
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.04) 6px),
        linear-gradient(135deg, #c4a574 0%, #d4b896 35%, #e6d4b8 50%, #d4b896 65%, #c4a574 100%);
    border: 2px solid #8b7355;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #2d2520;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.trending-tab::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
    border-radius: 10px 10px 0 0;
}

.trending-tab:hover {
    border-color: #6d5a45;
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.trending-tab.active {
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 25%, transparent 50%), linear-gradient(145deg, #bef264 0%, #a3e635 25%, #84cc16 50%, #65a30d 75%, #4d7c0f 100%);
    color: #0f0f0f;
    border: 2px solid #4d7c0f;
    box-shadow: 0 5px 0 0 #166534, 0 6px 14px rgba(0,0,0,0.3), inset 0 -2px 4px rgba(0,0,0,0.2);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-text {
    font-size: 0.9rem;
}

/* Filter Container - Skeuomorphic */
.filter-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
    align-items: stretch;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.04) 6px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #c4a574 0%, #d4b896 35%, #e6d4b8 50%, #d4b896 65%, #c4a574 100%);
    border: 2px solid #8b7355;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.12), inset 1px 0 0 rgba(255, 255, 255, 0.2), inset -1px 0 0 rgba(0, 0, 0, 0.08);
    position: relative;
}

.filter-container::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 14px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.5);
    pointer-events: none;
}

.filter-toggle-section {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    width: 100%;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 25%, transparent 50%),
        linear-gradient(145deg, #80e5f0 0%, #4dd0e1 25%, #26c6da 50%, #00bcd4 75%, #0097a7 100%);
    border: 2px solid #0097a7;
    border-radius: 12px;
    color: #0f0f0f;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--default-font-family, 'Shrikhand');
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 7px 0 0 #006064,
        0 9px 20px rgba(0, 0, 0, 0.35),
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    min-width: auto;
    max-width: 140px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
}

.filter-toggle-btn::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.5));
    border-radius: 10px 10px 0 0;
}

.filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 9px 0 0 #006064,
        0 11px 24px rgba(0, 0, 0, 0.45),
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    border-color: #0097a7;
}

.filter-toggle-btn:active {
    transform: translateY(3px);
    box-shadow:
        0 2px 0 0 #006064,
        0 4px 10px rgba(0, 0, 0, 0.35),
        inset 0 3px 10px rgba(0, 0, 0, 0.25);
}

.filter-toggle-btn.active {
    background: linear-gradient(145deg, #00acc1 0%, #0097a7 50%, #00838f 100%);
    color: #0f0f0f;
    border-color: #006064;
    box-shadow:
        0 7px 0 0 #006064,
        0 9px 20px rgba(0, 0, 0, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.filters-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #d4b896 0%, #e6d4b8 50%, #d4b896 100%);
    border-radius: 14px;
    border: 2px solid #8b7355;
    margin-top: 8px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    position: relative;
}

.filters-panel::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.filters-panel.open {
    max-height: 500px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.filters-panel.open::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.5);
    pointer-events: none;
}

.primary-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #8b7355;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: var(--default-font-family, 'Shrikhand');
    font-weight: 600;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #d4b896 0%, #e6d4b8 50%, #d4b896 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    color: #2d2520;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

.filter-select:hover {
    border-color: #6d5a45;
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.filter-select:focus {
    outline: none;
    border-color: #6d5a45;
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(139, 115, 85, 0.3);
    transform: translateY(-1px);
}

.filter-select:active {
    transform: translateY(1px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.search-container {
    flex: 1;
    margin-bottom: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--default-font-family, 'Shrikhand');
    border-radius: 14px;
    border: 2px solid #8b7355;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #d4b896 0%, #e6d4b8 50%, #d4b896 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    color: #2d2520;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.filter-search-input::placeholder {
    color: #5c4d3d;
}

.filter-search-input:hover {
    border-color: #6d5a45;
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.filter-search-input:focus {
    outline: none;
    border-color: #6d5a45;
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(139, 115, 85, 0.3);
    transform: translateY(-1px);
}

.clear-filters-btn {
    padding: 12px 16px;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.04) 6px),
        linear-gradient(135deg, #d4b896 0%, #e6d4b8 50%, #d4b896 100%);
    border: 2px solid #8b7355;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    color: #b91c1c;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.clear-filters-btn:hover {
    background: linear-gradient(135deg, #e8d4c8 0%, #ddc4b8 50%, #d4b4a8 100%);
    border-color: #8b7355;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(145deg, #bef264, #84cc16, #65a30d);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow:
        0 3px 6px rgba(59, 130, 246, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    border: 2px solid #4d7c0f;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.remove-filter-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-filter-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Trending Content Grid – bright leather */
.trending-content-grid {
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.04) 6px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #c4a574 0%, #d4b896 35%, #e6d4b8 50%, #d4b896 65%, #c4a574 100%);
    border: 3px solid #8b7355;
    border-radius: 18px;
    padding: 25px;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12),
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -1px 0 0 rgba(0, 0, 0, 0.08);
    position: relative;
    margin-bottom: 20px;
}

.trending-content-grid::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
    border-radius: 15px 15px 0 0;
}

.trending-content-grid::after {
    content: '';
    position: absolute;
    bottom: 14px;
    left: 16px;
    right: 16px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.5);
    pointer-events: none;
}

.trending-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Projects per row options */
.trending-list.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.trending-list.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.trending-list.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.trending-list.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.trending-list.cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Trending Project Cards – bright leather */
.trending-project-card {
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.04) 6px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #c4a574 0%, #d4b896 35%, #e6d4b8 50%, #d4b896 65%, #c4a574 100%);
    border: 3px solid #8b7355;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.25),
        0 4px 10px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15),
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -1px 0 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.trending-project-card::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
    border-radius: 13px 13px 0 0;
    z-index: 1;
}

.trending-project-card::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.45);
    pointer-events: none;
}

.trending-project-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.3),
        0 6px 15px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        inset 1px 0 0 rgba(255, 255, 255, 0.25),
        inset -1px 0 0 rgba(0, 0, 0, 0.12);
    border-color: #6d5a45;
}

.trending-project-card:active {
    transform: translateY(-2px);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(0, 0, 0, 0.2),
        inset 0 -2px 0 rgba(255, 255, 255, 0.4);
}

.project-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    border: 2px solid #8b7355;
    background: linear-gradient(145deg, #d4b896, #c4a574);
    position: relative;
}

.project-thumbnail .trending-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.trending-project-card:hover .project-thumbnail img {
    transform: scale(1.05);
}

.project-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d2520;
    margin-bottom: 10px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    font-family: var(--default-font-family, 'Shrikhand');
}

.project-category {
    font-size: 0.9rem;
    color: #2d2520;
    background:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0px, transparent 2px, transparent 4px, rgba(0, 0, 0, 0.03) 6px),
        linear-gradient(135deg, #d4b896 0%, #e6d4b8 50%, #d4b896 100%);
    border: 2px solid #8b7355;
    padding: 6px 12px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 10px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed rgba(139, 90, 43, 0.45);
}

.stat-group {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stat-icon {
    font-size: 1rem;
}

.trending-rank {
    background: repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0px, transparent 2px, transparent 4px, rgba(0,0,0,0.04) 6px), linear-gradient(135deg, #b8956a 0%, #c4a574 35%, #d4b896 50%, #c4a574 65%, #b8956a 100%);
    color: #2d2520;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 800;
    font-family: var(--default-font-family, 'Shrikhand');
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    border: 2px solid #8b7355;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}

.trending-rank::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 6px;
    right: 6px;
    height: 0;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.5);
    pointer-events: none;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.spinner-icon {
    font-size: 3rem;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 1.1rem;
    margin: 0;
    color: #6b7280;
}

/* No Trending Message */
.no-trending {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.no-trending-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
    display: block;
}

.no-trending h3 {
    font-size: 1.5rem;
    color: #495057;
    margin: 0 0 10px 0;
}

.no-trending p {
    font-size: 1rem;
    margin: 0;
    opacity: 0.8;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
    display: block;
}

.error-state h3 {
    font-size: 1.5rem;
    color: #dc3545;
    margin: 0 0 10px 0;
}

.error-state p {
    font-size: 1rem;
    margin: 0 0 20px 0;
    opacity: 0.8;
}

.retry-button {
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 25%, transparent 50%), linear-gradient(145deg, #bef264 0%, #a3e635 25%, #84cc16 50%, #65a30d 75%, #4d7c0f 100%);
    border: 2px solid #4d7c0f;
    border-radius: 12px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #0f0f0f;
    box-shadow: 0 5px 0 0 #166534, 0 6px 14px rgba(0,0,0,0.3), inset 0 -2px 4px rgba(0,0,0,0.2);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 0 #166534, 0 8px 18px rgba(0,0,0,0.35), inset 0 -2px 4px rgba(0,0,0,0.2);
}

.retry-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 0 #166534, 0 4px 10px rgba(0,0,0,0.3), inset 0 2px 8px rgba(0,0,0,0.25);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .trending-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    /* Responsive per-row options for tablets */
    .trending-list.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-list.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-list.cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .trending-list.cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .trending-list.cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Responsive per-row options for tablets */
    .trending-list.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-list.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-list.cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .trending-list.cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .trending-list.cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .trending-title {
        font-size: 2.4rem;
    }

    .header-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .trending-title {
        font-size: 1.6rem;
    }

    .trending-subtitle {
        font-size: 0.9rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .trending-stats {
        justify-content: center;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        gap: 12px;
    }

    .banner-text {
        min-width: auto;
        width: 100%;
    }

    .banner-text h2 {
        font-size: 1.3rem;
    }

    .banner-text p {
        font-size: 0.85rem;
        margin: 0 0 8px 0;
    }

    .trending-info {
        justify-content: center;
        gap: 10px;
        margin-bottom: 8px;
    }

    .info-item {
        font-size: 0.75rem;
    }

    .banner-action {
        margin-top: 0;
    }

    .refresh-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .trending-nav {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin-bottom: 15px;
    }

    .trending-tab {
        width: auto;
        padding: 8px 14px;
        font-size: 0.8rem;
        justify-content: center;
    }

    .trending-list {
        grid-template-columns: 1fr;
    }

    /* Mobile: force single column regardless of per-row setting */
    .trending-list.cols-2,
    .trending-list.cols-3,
    .trending-list.cols-4,
    .trending-list.cols-5,
    .trending-list.cols-6 {
        grid-template-columns: 1fr;
    }

    .modern-trending-header,
    .featured-trending-banner,
    .trending-content-grid {
        padding: 12px;
    }
}

@media (max-width: 480px) {

    .modern-trending-header,
    .featured-trending-banner,
    .trending-content-grid {
        padding: 10px;
    }

    .trending-title {
        font-size: 1.4rem;
    }

    .stat-item {
        padding: 8px 12px;
        min-width: 100px;
    }

    .trending-tab {
        width: auto;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}