/* =========================================
   ICONS PAGE STYLES - icons.html specific
   ========================================= */

/* --- Dynamic Grid Sizing Variable --- */
:root {
    --icon-size: 96px;
}

/* --- Instant Icon Rendering Optimization --- */
.icon-card i:not([data-lucide]),
.render-icon-card i:not([data-lucide]) {
    /* Minimal rendering optimization */
    -webkit-font-smoothing: antialiased;
}

/* --- Icon Grid --- */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--icon-size), 1fr));
    gap: 1rem;
    contain: layout style;
    padding: 1px;
}

/* Extra small screens - 2 columns */
@media (max-width: 375px) {
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.375rem;
    }

    .icon-card {
        min-height: 3rem;
    }

    .icon-card i:not([data-lucide]) {
        font-size: clamp(1.5rem, 35%, 2.5rem);
    }
}

/* Small screens - 3 columns */
@media (min-width: 376px) and (max-width: 479px) {
    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .icon-card i:not([data-lucide]) {
        font-size: clamp(1.75rem, 40%, 3rem);
    }
}

/* Medium screens - 4 columns */
@media (min-width: 480px) and (max-width: 639px) {
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .icon-card i:not([data-lucide]) {
        font-size: clamp(2rem, 45%, 3.5rem);
    }
}

/* Large screens - 5 columns */
@media (min-width: 640px) and (max-width: 767px) {
    .icon-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.875rem;
    }

    .icon-card i:not([data-lucide]) {
        font-size: clamp(2.25rem, 50%, 4rem);
    }
}

/* Extra large screens - auto-fill */
@media (min-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--icon-size), 1fr));
        gap: 1rem;
    }

    .icon-card i:not([data-lucide]) {
        font-size: clamp(2.5rem, 55%, 4.5rem);
    }
}

/* --- Icon Card --- */
/* --- Icon Card --- */
.icon-card {
    position: relative;
    aspect-ratio: 1;
    /* Neo-Brutalism: White background, black border */
    background: #ffffff !important;
    border: 3px solid #000000 !important;
    /* Force thick black border */
    /* border-radius 8px for Neo-Brutalism feel */
    border-radius: 8px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    min-width: 0;
    transition: transform 0.1s ease, box-shadow 0.1s ease !important;
    /* Reduced padding to prevent icon clipping */
    padding: 1rem;
    /* Only enable compositing on hover for better performance */
    will-change: auto;
    /* Performance: skip rendering off-screen icons */
    content-visibility: auto;
    contain-intrinsic-size: 96px 96px;
    z-index: 1;
}

/* Hover effects ONLY on devices with mouse/pointer (not touch screens) */
@media (hover: hover) and (pointer: fine) {
    .icon-card:hover {
        /* Neo-Brutalism: Yellow background, lift up, hard shadow */
        background-color: var(--color-brand) !important;
        transform: translate(-3px, -3px) !important;
        box-shadow: 6px 6px 0px 0px #000000 !important;
        border: 3px solid #000000 !important;
        z-index: 10;
        color: #000000 !important;
    }

    .icon-card:hover i:not([data-lucide]) {
        color: #000000 !important;
        transform: scale(1.1) !important;
    }

    .icon-card:hover .icon-name {
        color: #000000 !important;
        font-weight: 700 !important;
        opacity: 1 !important;
    }
}

/* Touch devices: simplified hover (just shadow, no transform) */
@media (hover: none),
(pointer: coarse) {
    .icon-card:active {
        background-color: var(--color-brand) !important;
        box-shadow: 4px 4px 0px 0px #000000 !important;
        border: 3px solid #000000 !important;
        color: #000000 !important;
    }

    .icon-card:active i:not([data-lucide]) {
        color: #000000 !important;
    }
}

.icon-card i:not([data-lucide]) {
    /* Icon self-adjusts to fill the card (minus padding) */
    width: 100%;
    height: 100%;
    /* Fixed icon size: 36x36 as requested */
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;

    /* Neo-Brutalism: Dark gray icons on white background */
    color: #374151;
    transition: color 0.15s ease, transform 0.15s ease;
}

.icon-card .icon-name {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    color: #a1a1aa;
    opacity: 0;
    transition: opacity 0.1s ease;
    font-family: 'JetBrains Mono', monospace;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

.icon-card:hover .icon-name {
    opacity: 1;
}

/* --- Icon Card Action Buttons --- */
.icon-card-actions {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: flex;
    flex-direction: row;
    /* Changed from column to row - match trending style */
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.icon-card:hover .icon-card-actions {
    opacity: 1;
}

.icon-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.3rem 0.4rem;
    min-width: 1.6rem;
    min-height: 1.6rem;
    background: #18181b;
    border: 2px solid #000;
    border-radius: 6px;
    box-shadow: 2px 2px 0 0 #000;
    color: #a1a1aa;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, color 0.1s ease, background 0.1s ease;
    font-size: 0.75rem;
}

.icon-action-btn svg,
.icon-action-btn i[data-lucide] {
    width: 0.875rem !important;
    height: 0.875rem !important;
    flex-shrink: 0;
}

/* Vote icon using text character */
.icon-action-btn .vote-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.icon-action-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 0 #000;
    background: #27272a;
    color: white;
}

.icon-action-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 0 #000;
}

.icon-action-btn.vote-btn:hover,
.icon-action-btn.vote-btn.voted {
    color: #ef4444;
    background: #fecaca;
    border-color: #000;
}

.icon-action-btn.vote-btn.voted {
    color: #dc2626;
    background: #fecaca;
}

.icon-action-btn.vote-btn.voted svg,
.icon-action-btn.vote-btn.voted .vote-icon {
    fill: currentColor;
}

.icon-action-btn.add-btn:hover {
    color: #18181b;
    background: var(--color-brand);
    border-color: #000;
}

/* Added state - icon is in Font Builder selection */
.icon-action-btn.add-btn.added {
    color: #166534;
    background: #bbf7d0;
    border-color: #000;
}

.icon-action-btn.add-btn.added svg {
    display: none;
}

.icon-action-btn.add-btn.added::before {
    content: '✓';
    font-size: 0.75rem;
    font-weight: bold;
}

.icon-action-btn.add-btn.added:hover {
    color: #dc2626;
    background: #fecaca;
}

.icon-action-btn .vote-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    line-height: 1;
}

/* Hide vote count and show only icon when card is small */
@container (max-width: 80px) {
    .icon-action-btn .vote-count {
        display: none;
    }
}

/* Legacy icon-actions support */
.icon-card .icon-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: all 0.2s ease;
}

.icon-card:hover .icon-actions {
    opacity: 1;
    transform: translateY(0);
}

.icon-actions button {
    padding: 0.375rem;
    background: #3f3f46;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.icon-actions button:hover {
    background: var(--color-brand);
    color: #09090b;
    /* Text black on yellow button */
}

/* --- Sidebar Styles --- */
.icons-sidebar {
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* No animation for sidebar - user preference */
    /* transition: none; */
    /* Neo-Brutalism: White background, black border */
    background: #ffffff;
    border-right: 2px solid #000000;

    /* Mobile Drawer Styles */
    @media (max-width: 768px) {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        width: 280px;
        transform: translateX(-100%);
        border-right: 2px solid #000000;
        height: 100vh !important;
        /* Override calc */
    }
}

.icons-sidebar.mobile-open {
    transform: translateX(0);
}

.icons-sidebar.collapsed {
    width: 56px;
    /* Desktop collapsed width */
    min-width: 56px;
}

.icons-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.icons-sidebar.collapsed .sidebar-title {
    display: none;
}

.icons-sidebar.collapsed .sidebar-content,
.icons-sidebar.collapsed .sidebar-footer {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Header */
.sidebar-header {
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 2px solid #000000;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: transparent;
    border: 2px solid #000000;
    color: #000000;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-toggle-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.sidebar-toggle-btn:hover {
    background: var(--color-brand);
    color: #000000;
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 2px solid #000000;
    flex-shrink: 0;
}

.sidebar-promo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    /* Neo-Brutalism: Yellow background, black border */
    background: var(--color-brand);
    border: 2px solid #000000;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-promo:hover {
    box-shadow: 3px 3px 0px 0px #000000;
    transform: translate(-1px, -1px);
}

.sidebar-promo-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(245, 197, 24, 0.15);
    color: var(--color-brand);
    flex-shrink: 0;
}

.sidebar-promo-text {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-promo-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-promo-desc {
    font-size: 0.625rem;
    color: #52525b;
}

/* --- Filter Section (Collapsible) --- */
.filter-section {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    /* Neo-Brutalism: White background, black border */
    background: #ffffff;
    border: 2px solid #000000;
    overflow: hidden;
}

.filter-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.filter-section-header:hover {
    background: rgba(245, 197, 24, 0.1);
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.filter-chevron {
    color: #000000;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.filter-section.collapsed .filter-chevron {
    transform: rotate(-90deg);
}

.filter-section-body {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.filter-section-body>* {
    overflow: hidden;
}

.filter-section-body-inner {
    padding: 0 1rem 1rem 1rem;
}

.filter-section.collapsed .filter-section-body {
    grid-template-rows: 0fr;
    opacity: 0;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-pill {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    /* Neo-Brutalism: Border always visible */
    border: 2px solid #000000;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-pill.active {
    background: var(--color-brand);
    color: #000000;
    border-color: #000000;
    box-shadow: 3px 3px 0px 0px #000000;
}

.filter-pill:not(.active) {
    background: #ffffff;
    color: #000000;
}

.filter-pill:not(.active):hover {
    background: rgba(245, 197, 24, 0.2);
    color: #000000;
}

/* Filter Search */
.filter-search {
    position: relative;
    margin-bottom: 0.75rem;
}

.filter-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #000000;
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    /* Neo-Brutalism: White background, black border */
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #000000;
    transition: all 0.15s ease;
}

.filter-search-input::placeholder {
    color: #6b7280;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    background: #1f1f23;
}

/* Collection List - fills remaining sidebar space */
.collection-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.collection-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: #52525b;
    font-size: 0.75rem;
}

/* Collections See More Button */
.collections-see-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    /* Neo-Brutalism: White bg, black border */
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.collections-see-more:hover {
    background: var(--color-brand);
    color: #000000;
    box-shadow: 3px 3px 0px 0px #000000;
    transform: translate(-1px, -1px);
}

.collections-see-more i {
    transition: transform 0.2s ease;
}

.collections-see-more:hover i {
    transform: translateX(2px);
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    /* Reserve space for border */
}

.collection-item:hover {
    background: #ffffff;
    border-color: #000000;
    box-shadow: 2px 2px 0px 0px #000000;
}

.collection-item.active {
    background: var(--color-brand);
    border-color: #000000;
    box-shadow: 2px 2px 0px 0px #000000;
}

.collection-item.active span:first-of-type {
    color: #000000;
    font-weight: 600;
}

.collection-item input[type="checkbox"],
.collection-item input[type="radio"] {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    border: 1px solid #3f3f46;
    background: #27272a;
    cursor: pointer;
    accent-color: var(--color-brand);
    flex-shrink: 0;
}

.collection-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.collection-item input[type="radio"]:checked {
    background: #000000;
    border-color: #000000;
}

.collection-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

.collection-item span {
    font-size: 0.8rem;
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.collection-item:hover span {
    color: #e4e4e7;
}

/* Collection search highlight */
.collection-highlight {
    background: var(--color-brand);
    color: #000000;
    padding: 0 2px;
    border-radius: 0;
    font-weight: 700;
    border: 1px solid #000000;
}

.collection-count {
    font-size: 0.7rem;
    color: #52525b;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* Filter Slider */
.filter-slider-group {
    padding: 0.25rem 0;
}

.filter-slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #71717a;
}

.filter-slider-value {
    color: #000000;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
}

.filter-range {
    width: 100%;
}

.collection-item input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 2px;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    accent-color: #000000;
}

.collection-item label {
    font-size: 0.875rem;
    color: #a1a1aa;
    transition: color 0.2s ease;
    flex: 1;
}

.collection-item:hover label {
    color: #000000;
}

.collection-count {
    font-size: 0.75rem;
    color: #52525b;
}

/* --- Top Bar --- */
.icons-topbar {
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 20px;
}

.search-box {
    position: relative;
    width: 24rem;
    flex: 1;
}

.search-box input {
    width: 100%;
    background: rgba(24, 24, 27, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-size: 0.875rem;
    color: white;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box input::placeholder {
    color: #52525b;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #71717a;
    transition: color 0.2s ease;
}

.search-box:focus-within .search-icon {
    color: #6366f1;
}

/* --- Results Meta --- */
.results-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.results-count {
    font-size: 0.875rem;
    color: #a1a1aa;
}

.results-count span {
    color: white;
    font-weight: 600;
}

/* --- Sort Dropdown --- */
.sort-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #a1a1aa;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sort-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* --- Grid Container --- */
.grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* --- Loading Spinner (REMOVED - replaced by inline loader in search.html) --- */
/* 
   The purple circle spinner has been removed as it was appearing 
   behind the main loading overlay. Loading is now handled by 
   the .loader class defined in search.html inline styles.
*/

/* --- Pagination --- */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Improved responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        padding: 1.5rem 0.5rem;
        gap: 0.5rem;
    }

    .pagination {
        padding: 0.375rem;
        gap: 0.375rem;
        background: rgba(24, 24, 27, 0.8);
    }

    .page-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    .page-ellipsis {
        min-width: 32px;
        font-size: 0.75rem;
    }
}

@media (max-width: 640px) {
    .pagination-container {
        padding: 1.25rem 0.25rem;
    }

    .pagination {
        padding: 0.25rem;
        gap: 0.25rem;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pagination::-webkit-scrollbar {
        display: none;
    }

    .page-number {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .page-ellipsis {
        min-width: 28px;
        font-size: 0.6875rem;
    }
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    /* Neo-Brutalism: White background, black border */
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    color: #000000;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

@media (max-width: 640px) {
    .pagination-btn span {
        display: none;
    }

    .pagination-btn {
        padding: 0.5rem;
    }
}

.pagination-btn:hover:not(:disabled) {
    /* Neo-Brutalism: Yellow background, shadow */
    background: var(--color-brand);
    border-color: #000000;
    color: #000000;
    box-shadow: 3px 3px 0px 0px #000000;
    transform: translate(-1px, -1px);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f4f4f5;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (max-width: 640px) {
    .pagination {
        max-width: 100%;
    }

    .pagination-pages {
        max-width: 70vw;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.25rem;
        scrollbar-width: none;
    }

    .pagination-pages::-webkit-scrollbar {
        display: none;
    }
}

.page-number {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Neo-Brutalism: White background, black border */
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    color: #000000;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.page-number:hover {
    /* Neo-Brutalism: Yellow background on hover */
    background: var(--color-brand);
    color: #000000;
    box-shadow: 3px 3px 0px 0px #000000;
    transform: translate(-1px, -1px);
}

.page-number.active {
    /* Neo-Brutalism: Yellow background for active */
    background: var(--color-brand);
    color: #000000;
    border-color: #000000;
    font-weight: 700;
    box-shadow: 3px 3px 0px 0px #000000;
}

.page-ellipsis {
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.pagination-info {
    font-size: 0.8rem;
    color: #52525b;
}

.pagination-info span {
    color: #71717a;
}

.pagination-info span span {
    color: #a1a1aa;
    font-weight: 600;
}

/* --- Detail Modal --- */
.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
}

.detail-modal.show {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 56rem;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

/* --- Modal Preview Section --- */
.modal-preview {
    width: 50%;
    padding: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at center, rgba(99, 102, 241, 0.03) 0%, transparent 70%),
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
    background-position: center, 0 0, 0 10px, 10px -10px, -10px 0;
}

.preview-icon-container {
    width: 12rem;
    height: 12rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.preview-icon-container i {
    font-size: 8rem;
    color: white;
    transition: all 0.3s ease;
}

/* --- Modal Controls --- */
.modal-controls {
    width: 100%;
    max-width: 16rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #a1a1aa;
    margin-bottom: 0.5rem;
}

.color-swatches {
    display: flex;
    gap: 0.5rem;
}

.color-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.color-swatch:hover,
.color-swatch.active {
    transform: scale(1.1);
    border-color: currentColor;
    box-shadow: 0 0 0 2px #18181b, 0 0 0 4px currentColor;
}

/* --- Modal Info Section --- */
.modal-info {
    width: 50%;
    padding: 2rem;
    background: #27272a;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: #71717a;
    margin-top: 0.25rem;
}

.modal-close {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #71717a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Code Tabs --- */
.code-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.code-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #71717a;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.code-tab:hover {
    color: #a1a1aa;
}

.code-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

/* --- Code Block --- */
.code-block {
    flex: 1;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #a1a1aa;
    position: relative;
    overflow: hidden;
}

.code-block code {
    white-space: pre-wrap;
    line-height: 1.6;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.375rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Modal Actions --- */
.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #6366f1;
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: #818cf8;
}

.btn-secondary {
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* --- Sidebar Overlay for Mobile --- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    /* Removed backdrop-filter blur - too expensive */
    background: rgba(0, 0, 0, 0.6);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    will-change: opacity;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* --- Responsive --- */
/* --- Responsive --- */
@media (max-width: 1025px) {
    .icons-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 2px solid #000000;
        border-bottom: none;
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    }

    .icons-sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-filter-btn {
        display: flex !important;
    }

    /* Hide the collapse button in sidebar on mobile/tablet */
    .sidebar-toggle-btn {
        display: none;
    }
}

@media (min-width: 1026px) {
    .mobile-filter-btn {
        display: none;
    }
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-filter-btn:hover,
.mobile-filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

html.light .mobile-filter-btn:hover,
html.light .mobile-filter-btn.active {
    background: #f4f4f5;
    color: #18181b;
}

@media (max-width: 1024px) {
    /* Main content adjustment if needed, but sidebar is overlay now */

    .modal-container {
        flex-direction: column;
        max-width: 90%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-preview,
    .modal-info {
        width: 100%;
    }

    .modal-preview {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 1.5rem;
    }

    .preview-icon-container {
        width: 8rem;
        height: 8rem;
        margin-bottom: 1rem;
    }

    .preview-icon-container i {
        font-size: 5rem;
    }
}

@media (max-width: 640px) {
    .icons-topbar {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        background: var(--color-bg-primary);
        /* Add background */
        position: relative;
        z-index: 30;
        /* Ensure it sits above sidebar content if unrelated, but sidebar is fixed */
    }

    /* Adjust Sidebar Top for Mobile (2-row topbar) */
    .icons-sidebar {
        top: 11rem !important;
        /* Nav (4rem) + Topbar (~7rem) */
        max-height: calc(100vh - 11rem) !important;
    }

    /* Row 1: Filter Button */
    .mobile-filter-btn {
        order: 1;
    }

    /* Row 1: Search Box */
    .search-box {
        order: 2;
        flex: 1;
        width: auto;
        min-width: 0;
        /* Allow shrinking */
    }

    /* Row 2: Results Meta (Count + Sort) */
    .results-meta {
        order: 3;
        width: calc(100% + 2rem);
        /* Full width including parent padding */
        margin-left: -1rem;
        /* Counteract parent padding */
        margin-right: -1rem;
        margin-top: -.25rem;
        /* Space from top row */
        padding: 0.75rem 1rem;
        justify-content: space-between !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .icon-grid {
        padding-top: 4rem;
    }

    /* Ensure glass/blur effect if desired, or solid */
    /* Ensure glass/blur effect if desired, or solid */
    html.dark .icons-topbar,
    html.dark .results-meta {
        background: #09090b;
        /* Zinc 950 */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    html.light .icons-topbar,
    html.light .results-meta {
        background: #ffffff;
        border-bottom: 1px solid #e4e4e7;
    }

    /* Fallback if theme classes are missing */
    .icons-topbar,
    .results-meta {
        background: var(--color-bg-primary, #09090b);
    }

    .grid-container {
        padding: 1rem 0.5rem;
    }

    .search-box kbd {
        display: none;
    }
}

/* =========================================
   LIGHT THEME OVERRIDES
   ========================================= */

/* Pagination (generated by collection-render.js) - NEO-BRUTALISM */
html.light .pagination nav a {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
    font-weight: 600 !important;
}

html.light .pagination nav a:hover,
html.light .pagination nav a.active {
    background: var(--color-brand) !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: 3px 3px 0px 0px #000000 !important;
    transform: translate(-1px, -1px) !important;
}

html.light .pagination nav a.disabled {
    background: #f4f4f5 !important;
    color: #a1a1aa !important;
    cursor: not-allowed;
}

/* Detail Sidebar Panel */
html.light #detail-panel {
    background: #ffffff !important;
    border-left-color: #e4e4e7 !important;
}

html.light .detail-close-btn {
    color: #71717a !important;
}

html.light .detail-close-btn:hover {
    background-color: #f4f4f5 !important;
    color: #18181b !important;
}

/* Detail Sidebar Content */
html.light .detail-title {
    color: #18181b !important;
}

html.light .detail-subtitle,
html.light .detail-info-label {
    color: #52525b !important;
}

html.light .detail-info-value {
    color: #18181b !important;
}

/* Detail Code Block */
html.light .detail-code-block {
    background: #f4f4f5 !important;
    border: 1px solid #e4e4e7 !important;
}

html.light .detail-code-block:hover {
    border-color: #d4d4d8 !important;
    background: #e4e4e7 !important;
}

html.light .detail-code-content {
    color: #3f3f46 !important;
    /* Ensure generic text is visible */
}

/* Detail Actions */
html.light .detail-action-btn {
    background: #ffffff !important;
    border: 1px solid #e4e4e7 !important;
    color: #52525b !important;
}

html.light .detail-action-btn:hover {
    background: #f4f4f5 !important;
    color: #18181b !important;
    border-color: #d4d4d8 !important;
}

/* Sidebar Icons Preview Background */
html.light .detail-preview {
    background: #f8fafc !important;
    /* Light gray background for icon preview area */
    border-bottom: 1px solid #e4e4e7 !important;
}

html.light .detail-preview i {
    color: #18181b !important;
}

/* =========================================
   COLLECTION PAGE SPECIFIC LIGHT THEME FIXES
   ========================================= */

/* Pagination Container Background Fix - NEO-BRUTALISM */
html.light .pagination,
html.light .glass-panel {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

/* Ensure pagination buttons inside stand out - NEO-BRUTALISM */
html.light #pagination-container .page-number,
html.light #pagination-container button {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 600 !important;
}

html.light #pagination-container .page-number:hover,
html.light #pagination-container button:hover,
html.light #pagination-container .page-number.active {
    background: var(--color-brand) !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: 3px 3px 0px 0px #000000 !important;
    transform: translate(-1px, -1px) !important;
}

/* Detail Panel Specifics */
html.light #detail-panel {
    background: #ffffff !important;
    border-left: 1px solid #e4e4e7 !important;
}

/* Detail Code Tab (User Requested) */
html.light .detail-tab {
    background: transparent !important;
    color: #71717a !important;
    border: 1px solid transparent !important;
}

html.light .detail-tab:hover {
    background: #f4f4f5 !important;
    color: #18181b !important;
}

html.light .detail-tab.active {
    background: #f4f4f5 !important;
    color: #6366f1 !important;
    /* Brand color */
    border-color: #e4e4e7 !important;
}

/* Detail Actions in Sidebar */
html.light #detail-panel button:not(.detail-close-btn):not(#detail-btn-editor),
html.light #detail-panel .detail-action-btn {
    background: #ffffff !important;
    border: 1px solid #e4e4e7 !important;
    color: #52525b !important;
}

html.light #detail-panel button:not(.detail-close-btn):not(#detail-btn-editor):hover,
html.light #detail-panel .detail-action-btn:hover {
    background: #f4f4f5 !important;
    color: #18181b !important;
    border-color: #d4d4d8 !important;
}

/* Fix specific Detail Close Button if missed */
html.light #detail-panel .detail-close-btn {
    background: transparent !important;
    border: none !important;
}

html.light #detail-panel .detail-close-btn:hover {
    background: #f4f4f5 !important;
    color: #ef4444 !important;
    /* Red on hover */
}

/* Fix Search Input in Light Theme (if present in collection page) */
html.light .search-input-render input {
    background: #ffffff !important;
    border-color: #e4e4e7 !important;
    color: #18181b !important;
}

/* =========================================
   SEARCH PAGE SIDEBAR (Light Theme)
   ========================================= */

/* Sidebar Container - NEO-BRUTALISM */
html.light .icons-sidebar {
    background: #ffffff !important;
    border-right: 2px solid #000000 !important;
}

/* Sidebar Header & Footer - NEO-BRUTALISM */
html.light .sidebar-header,
html.light .sidebar-footer {
    border-color: #000000 !important;
}

html.light .sidebar-title {
    color: #000000 !important;
    font-weight: 700 !important;
}

/* Sidebar Toggle Button - NEO-BRUTALISM */
html.light .sidebar-toggle-btn {
    color: #000000 !important;
    border: 2px solid #000000 !important;
    background: #ffffff !important;
}

html.light .sidebar-toggle-btn:hover {
    background: var(--color-brand) !important;
    color: #000000 !important;
    box-shadow: 2px 2px 0px 0px #000000 !important;
    transform: translate(-1px, -1px) !important;
}

/* Filter Sections - NEO-BRUTALISM */
html.light .filter-section {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
}

html.light .filter-section-header:hover {
    background: rgba(245, 197, 24, 0.2) !important;
}

html.light .filter-title {
    color: #000000 !important;
    font-weight: 700 !important;
}

html.light .filter-chevron {
    color: #000000 !important;
}

/* Filter Pills - NEO-BRUTALISM */
html.light .filter-pill:not(.active) {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 600 !important;
}

html.light .filter-pill:not(.active):hover {
    background: var(--color-brand) !important;
    color: #000000 !important;
    box-shadow: 3px 3px 0px 0px #000000 !important;
    transform: translate(-1px, -1px) !important;
}

/* Filter Search Input - NEO-BRUTALISM */
html.light .filter-search-input {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 6px !important;
    color: #000000 !important;
}

html.light .filter-search-input:focus {
    border-color: #6366f1 !important;
    background: #ffffff !important;
}

html.light .filter-search-input::placeholder {
    color: #a1a1aa !important;
}

html.light .filter-search-icon {
    color: #a1a1aa !important;
}

/* Collections List */
html.light .collection-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

html.light .collection-item.active {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

html.light .collection-item span {
    color: #52525b !important;
}

html.light .collection-item.active span {
    color: #6366f1 !important;
}

html.light .collection-item input[type="checkbox"],
html.light .collection-item input[type="radio"] {
    background-color: #ffffff !important;
    border-color: #d4d4d8 !important;
}

html.light .collection-item input[type="radio"]:checked {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
    transition: all 0.2s ease !important;
}

html.light .collection-item input[type="radio"]:checked::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 6px !important;
    height: 6px !important;
    background: white !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Sidebar Promo - NEO-BRUTALISM (Light Purple) */
html.light .sidebar-promo {
    background: rgba(99, 102, 241, 0.15) !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
}

html.light .sidebar-promo:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    box-shadow: 3px 3px 0px 0px #000000 !important;
    transform: translate(-1px, -1px) !important;
}

html.light .sidebar-promo-title {
    color: #000000 !important;
    font-weight: 700 !important;
}

html.light .sidebar-promo-desc {
    color: #374151 !important;
}

/* No icons found state */
html.light .no-icons-found {
    color: #71717a !important;
}

/* =========================================
   SEARCH PAGE TOPBAR & FOOTER (Light Theme)
   ========================================= */

/* Topbar - NEO-BRUTALISM */
html.light .icons-topbar {
    background: #ffffff !important;
    border-color: #000000 !important;
    border-bottom: 2px solid #000000 !important;
}

/* Main Search Box - NEO-BRUTALISM */
html.light .search-box {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

html.light .search-box:focus-within {
    border-color: var(--color-brand) !important;
    box-shadow: 3px 3px 0px 0px #000000 !important;
}

html.light .search-box input {
    background: transparent !important;
    /* Wrapper has bg */
    color: #18181b !important;
}

html.light .search-box input::placeholder {
    color: #a1a1aa !important;
}

html.light .search-box .search-icon {
    color: #a1a1aa !important;
}

html.light .search-box .kbd {
    background: #f4f4f5 !important;
    border-color: #e4e4e7 !important;
    color: #71717a !important;
}

/* Results Meta */
html.light .results-count {
    color: #71717a !important;
}

html.light .results-count span {
    color: #18181b !important;
}

/* Sort Button */
html.light .sort-button {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    color: #52525b !important;
}

html.light .sort-button:hover {
    background: #f4f4f5 !important;
    color: #18181b !important;
    border-color: #000000 !important;
}

/* Footer (Search Page) - NEO-BRUTALISM */
html.light footer {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-color: #000000 !important;
    /* Force color override */
}

html.light footer p {
    color: #000000 !important;
}

html.light footer a:hover {
    background: var(--color-brand) !important;
    color: #000000 !important;
}

/* Icon Action Buttons (Hover Toolbar on Icons) */
html.light .icon-action-btn {
    background: #ffffff !important;
    border-color: #e4e4e7 !important;
    color: #71717a !important;
}

html.light .icon-action-btn:hover {
    background: #f4f4f5 !important;
    color: #18181b !important;
    border-color: #d4d4d8 !important;
}

/* Sidebar Promo Styling */
.sidebar-promo {
    margin-right: 1rem;
}

/* =========================================
   LOADING ANIMATION (Purple spinner REMOVED)
   ========================================= */

/* 
   Purple circle spinner has been REMOVED.
   Loading is now handled by .loader class in search.html inline styles.
   This prevents duplicate loading indicators.
*/

/* Container needs position relative for loading overlay */
.icon-grid[data-animate] {
    position: relative;
    min-height: 150px;
}

/* Animation chỉ áp dụng khi grid có data-animate attribute */
.icon-grid[data-animate]:not(.icons-ready) .icon-card {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}

/* Hide icons until SVG loads - show pulsing placeholder instead */
.icon-grid .icon-card i:not([data-lucide]):not(.svg-loaded) {
    opacity: 0.3;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: icon-placeholder-pulse 1.5s ease-in-out infinite;
    border-radius: 8px;
    width: 1em;
    height: 1em;
}

@keyframes icon-placeholder-pulse {

    0%,
    100% {
        background-position: 200% 0;
        opacity: 0.2;
    }

    50% {
        background-position: 0% 0;
        opacity: 0.4;
    }
}

html.light .icon-grid .icon-card i:not([data-lucide]):not(.svg-loaded) {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.03) 25%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.03) 75%);
    background-size: 200% 100%;
}

/* Staggered reveal animation when grid is ready */
/* REMOVED STAGGER: All icons appear at once for instant rendering */
.icon-grid[data-animate].icons-ready .icon-card {
    opacity: 1;
    transform: scale(1);
    animation: card-pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    /* No animation-delay - all icons appear simultaneously */
}

@keyframes card-pop-in {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Icon fade in when SVG loads - smooth transition from placeholder */
.icon-grid .icon-card i.svg-loaded {
    opacity: 1 !important;
    background: none !important;
    animation: icon-fade-in 0.25s ease-out forwards !important;
}

@keyframes icon-fade-in {
    from {
        opacity: 0.3;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Lazy loading placeholder card (for scroll-based loading) */
.icon-card.icon-placeholder {
    background: rgba(39, 39, 42, 0.4);
    pointer-events: none;
    contain: strict;
}

/* Skeleton pulse inside placeholder */
.icon-skeleton-pulse {
    width: 50%;
    height: 50%;
    border-radius: 8px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 0%,
            rgba(255, 255, 255, 0.06) 50%,
            rgba(255, 255, 255, 0.02) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-text {
    width: 60%;
    height: 12px;
    margin-top: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    animation-delay: 0.1s;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* GPU acceleration for smooth scroll */
.icon-grid {
    will-change: scroll-position;
    transform: translateZ(0);
}

/* Optimize icon card for GPU compositing during scroll */
.icon-card {
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: var(--icon-size, 96px);
}

/* Light mode skeleton */
html.light .icon-card.icon-placeholder {
    background: rgba(0, 0, 0, 0.03);
}

html.light .icon-skeleton-pulse,
html.light .skeleton-icon,
html.light .skeleton-text {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.03) 25%,
            rgba(0, 0, 0, 0.06) 50%,
            rgba(0, 0, 0, 0.03) 75%);
    background-size: 200% 100%;
}

/* Light mode loading spinner - REMOVED (see above) */

/* Skeleton loading cards - for instant feedback */
.icon-card.skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(39, 39, 42, 0.4);
    pointer-events: none;
    min-height: 96px;
    padding: 1rem;
    gap: 0.5rem;
}

html.light .icon-card.skeleton {
    background: rgba(0, 0, 0, 0.03);
}