:root {
    --blue-primary: #005cfa; /* Modern vibrant blue */
    --blue-hover: #0046c4;
    --blue-light: #e6efff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --border: #e2e8f0;
}

body.search-page {
    background-color: #ffffff;
    display: block; /* Override default style.css flex layout */
    padding: 0;
    min-height: 100vh;
}

/* Main Header Layout */
.main-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Brand Logo (ICON tab) styling */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--blue-primary);
    font-weight: 700;
    font-size: 1.15rem;
    background: var(--blue-light);
    padding: 0.6rem 1.25rem;
    border-radius: 99px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 92, 250, 0.06);
}

.brand-logo i {
    font-size: 1.25rem;
}

.brand-logo:hover {
    background: var(--blue-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 92, 250, 0.2);
}

/* Header Search Bar */
.header-search-bar {
    flex: 1;
    max-width: 650px;
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 0.4rem 1.25rem 0.4rem 0.4rem;
    gap: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search-bar:focus-within {
    background: white;
    border-color: var(--blue-primary);
    box-shadow: 0 8px 24px rgba(0, 92, 250, 0.08), 0 0 0 3px var(--blue-light);
}

.header-search-bar > i.fa-magnifying-glass {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #3b82f6, var(--blue-primary));
    color: white;
    border-radius: 50%;
    font-size: 0.95rem;
    box-shadow: 0 3px 8px rgba(0, 92, 250, 0.2);
}

.header-search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--gray-800);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.header-search-bar input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-powered {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-500);
    white-space: nowrap;
    background: var(--gray-100);
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    display: flex;
    align-items: center;
}

/* Header Login Button */
.header-login-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    border-radius: 99px;
    border: 1px solid var(--gray-200);
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-login-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
    color: var(--gray-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.header-login-btn i {
    font-size: 1.15rem;
    color: var(--gray-500);
}

.header-login-btn:hover i {
    color: var(--blue-primary);
}

/* Search Layout */
.search-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem;
    gap: 3rem;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 2.5rem;
}

.filter-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.filter-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.7;
}

.filter-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.filter-item.active {
    background: var(--blue-primary);
    color: white;
}

.filter-item.active i {
    opacity: 1;
}

.filter-item .count {
    margin-left: auto;
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.filter-item.active .count {
    background: transparent;
    color: white;
}

/* Sidebar Ad */
.sidebar-ad {
    background-color: #eaddff;
    border-radius: 8px;
    padding: 1.5rem 1rem 1rem;
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
}

.ad-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    background: #005cfa;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
}

.ad-box {
    background: black;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.ad-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.ad-logo span {
    border: 1px solid white;
    padding: 0 0.3rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.ad-subtext {
    font-size: 0.65rem;
    color: #a1a1aa;
    line-height: 1.2;
}

.ad-desc {
    font-size: 0.85rem;
    color: #6b21a8;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.ad-via {
    font-size: 0.7rem;
    color: #9333ea;
}

/* Main Area */
.results-area {
    flex: 1;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: 0;
}

.view-toggles {
    display: flex;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: 8px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn.active {
    background: white;
    color: var(--blue-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-btn:hover:not(.active) {
    color: var(--gray-800);
}

/* Icon Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-800);
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.icon-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--blue-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.icon-card:hover {
    border-color: transparent;
    box-shadow: 0 12px 30px -10px rgba(0, 92, 250, 0.2), 0 4px 12px -5px rgba(0, 92, 250, 0.1);
    transform: translateY(-4px);
}

.icon-card:hover::after {
    transform: scaleX(1);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--gray-800);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-card:hover .icon-wrapper {
    color: var(--blue-primary);
    transform: scale(1.15);
}

.search-icon-svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.icon-name {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    color: var(--gray-600);
    transition: color 0.2s;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-wrapper {
    position: relative;
    max-width: 1250px;
    width: 95%;
    max-height: 95vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-container {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin: 0;
}

.modal-close-wrapper {
    position: absolute;
    top: -2.5rem;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-text {
    background: #1e293b;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.2s;
}

.modal-close-wrapper:hover .modal-close-text {
    opacity: 1;
}

.modal-close-btn:hover {
    background: #0f172a;
}

.icon-card:hover .icon-name {
    color: var(--blue-primary);
}

/* Mobile Filter floating button & backdrop */
.mobile-filter-btn {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0.2s;
    visibility: visible;
}

.sidebar-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    /* Search Layout details */
    .search-layout {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    /* Sidebar transformed into slide-over mobile drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px; /* Hidden offscreen by default */
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1050;
        box-shadow: 25px 0 50px -12px rgba(0, 0, 0, 0.15);
        padding: 2.5rem 1.5rem;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0; /* Override any desktop margin */
    }
    
    .sidebar.active {
        left: 0; /* Slide in */
    }
    
    /* Header components scaling for single-line mobile viewport */
    .main-header {
        padding: 0.75rem 1.25rem;
    }
    
    .header-container {
        gap: 0.75rem;
    }
    
    /* Brand logo compact (roundShapes logo badge) */
    .brand-logo {
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .brand-logo span {
        display: none;
    }
    
    /* Search Bar compact */
    .header-search-bar {
        gap: 0.5rem;
        padding: 0.25rem 0.75rem 0.25rem 0.25rem;
        box-shadow: none;
    }
    
    .header-search-bar > i.fa-magnifying-glass {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .search-powered {
        display: none;
    }
    
    /* Login button compact (roundUser badge) */
    .header-login-btn {
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
        border-color: var(--gray-200);
        flex-shrink: 0;
    }
    
    .header-login-btn span {
        display: none;
    }

    /* Mobile floating filter button */
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        background-color: var(--blue-primary);
        color: white;
        border: none;
        width: 52px;
        height: 52px;
        border-radius: 12px; /* Rounded square block */
        font-size: 1.25rem; /* Larger settings icon */
        box-shadow: 0 8px 24px rgba(0, 92, 250, 0.35);
        cursor: pointer;
        z-index: 1030;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-filter-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(0, 92, 250, 0.45);
    }

    /* Stack kind dropdown and style icons row vertically in modal on mobile */
    .style-selector {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .kind-selector-wrapper {
        width: 100% !important;
        min-width: 100% !important;
    }
}

/* Search Toolbar */
.search-toolbar-wrapper {
    border-bottom: 1px solid var(--border);
    background: white;
    padding: 0 2.5rem;
}

.search-toolbar {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    overflow-x: auto; /* Handle smaller screens */
}

.search-toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Tabs */
.toolbar-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s ease;
    border-radius: 6px;
    height: 64px;
    flex-shrink: 0;
}

.toolbar-tab:hover {
    color: var(--gray-800);
    background: var(--gray-50);
}

.toolbar-tab.active {
    color: var(--blue-primary);
    border-color: var(--blue-primary);
    background: white;
}

.tab-icon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
}

.tab-icon-single {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.toolbar-tab span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Toolbar Controls */
.toolbar-icon-btn, .toolbar-dropdown-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.toolbar-icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.standalone-btn {
    border-radius: 6px;
}

.toolbar-icon-btn:hover, .toolbar-dropdown-btn:hover {
    color: var(--gray-800);
    border-color: var(--gray-400);
    z-index: 2;
}

.toolbar-icon-btn.active, .toolbar-dropdown-btn.active {
    color: var(--blue-primary);
    border-color: var(--blue-primary);
    z-index: 1;
}

.color-triangle {
    width: 20px;
    height: 20px;
}

/* Button Groups */
.btn-group {
    display: flex;
    align-items: center;
}

.btn-group .toolbar-icon-btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.btn-group .toolbar-icon-btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .toolbar-icon-btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.btn-group .toolbar-icon-btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Segmented Control */
.segmented-control {
    display: flex;
    align-items: center;
}

.segment-btn {
    padding: 0 1rem;
    height: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.segment-btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.segment-btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.segment-btn:not(:first-child) {
    margin-left: -1px;
}

.segment-btn:hover {
    color: var(--gray-800);
    background: var(--gray-50);
    z-index: 2;
}

.segment-btn.active {
    color: var(--blue-primary);
    border-color: var(--blue-primary);
    z-index: 1;
}

.toolbar-dropdown-btn {
    height: 40px;
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.5rem;
}

/* ======================================================
   MOBILE MODAL RESPONSIVE FIXES
   ====================================================== */
@media (max-width: 768px) {
    /* Modal wrapper: full width on mobile */
    .modal-wrapper {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        align-items: flex-end;
        padding: 0;
    }

    .modal-container {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        width: 100%;
        padding-bottom: env(safe-area-inset-bottom, 0);
        position: relative; /* anchor the close button inside */
    }

    /* Move close button INSIDE the modal on mobile (top-right corner) */
    .modal-close-wrapper {
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 10;
    }

    .modal-close-text {
        display: none; /* hide label on mobile to save space */
    }

    /* Inner container padding */
    .container {
        padding: 1rem;
        border-radius: 0;
        box-shadow: none;
    }

    /* Header title smaller */
    .title-area h1 {
        font-size: 1.1rem;
        word-break: break-all;
    }

    /* main-content already flex-direction:column from style.css @media */

    /* Preview canvas smaller on mobile */
    .preview-canvas {
        min-height: 150px;
    }

    /* Preview toolbar wraps */
    .preview-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    /* ---- COLOR PALETTE ---- */
    /* Allow swatches to wrap to next line */
    .color-palette {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .color-swatch {
        width: 2.1rem;
        height: 2.1rem;
    }

    .color-bar-btn {
        height: 2.1rem;
    }

    .custom-color-picker .pcr-button {
        height: 2.1rem;
    }

    /* ---- SIZE OPTIONS ---- */
    /* Wrap size buttons */
    .size-options {
        flex-wrap: wrap;
        border-radius: 8px;
        overflow: visible;
        border: none;
        gap: 0.35rem;
    }

    .size-btn {
        flex: 0 0 auto;
        min-width: 2.6rem;
        border: 1px solid var(--border-color);
        border-radius: 8px !important;
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }

    /* ---- ROTATE OPTIONS ---- */
    .rotate-options {
        flex-wrap: wrap;
        border-radius: 8px;
        overflow: visible;
        border: none;
        gap: 0.35rem;
    }

    .rotate-btn {
        flex: 0 0 auto;
        min-width: 3rem;
        border: 1px solid var(--border-color);
        border-radius: 8px !important;
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }

    /* Custom rotate input */
    .custom-input {
        width: auto;
        flex: 1;
        min-width: 80px;
        border: 1px solid var(--border-color);
        border-radius: 8px !important;
        padding: 0.5rem 0.4rem;
    }

    /* ---- FLIP OPTIONS ---- */
    .flip-options {
        flex-wrap: wrap;
        border-radius: 8px;
        overflow: visible;
        border: none;
        gap: 0.35rem;
    }

    .flip-btn {
        flex: 0 0 auto;
        min-width: 3rem;
        border: 1px solid var(--border-color);
        border-radius: 8px !important;
        padding: 0.5rem 0.75rem;
    }

    /* Active state still pops */
    .size-btn.active,
    .rotate-btn.active,
    .flip-btn.active {
        background: #005cfa;
        color: white;
        border-color: #005cfa;
    }

    /* ---- TOOLS GRID ---- */
    .tools-grid {
        gap: 1rem 0;
    }

    /* ---- ANIMATE OPTIONS ---- */
    .animate-options {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ---- ACTION BUTTONS ---- */
    .action-btn {
        padding: 0.6rem 0.25rem;
        font-size: 0.75rem;
    }

    .action-btn i {
        font-size: 1.1rem;
    }

    /* ---- SEARCH TOOLBAR ---- */
    .search-toolbar-wrapper {
        padding: 0 1rem;
    }

    .toolbar-left,
    .toolbar-right {
        gap: 0.5rem;
    }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    padding-bottom: 2rem;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    background: var(--blue-light);
}

.page-btn.active {
    background: var(--blue-primary);
    color: white;
    border-color: var(--blue-primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-50);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--blue-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 92, 250, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--blue-hover);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 92, 250, 0.4);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 6rem; /* Above the mobile filter button */
        right: 2rem;
    }
}

/* Animated Loading Spinner for SVG Placeholders */
.placeholder-spinner {
    animation: spin 1.5s linear infinite;
    color: var(--gray-300);
}

.icon-card.loading-icon {
    pointer-events: none;
    opacity: 0.65;
}

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

