/* ============================================
   STOCK CATALOG — Luxoret
   Artlist-inspired layout with custom sidebar
   ============================================ */

/* Stock catalog accent — override site-wide purple */
.sc-layout { --primary: #06b6d4; }

/* Hide studio tool categories in sidebar on stock-catalog pages */
.stock-catalog-layout .sidebar-studio-nav,
.stock-catalog-layout .sidebar-section-bordered:has(.sidebar-studio-nav) {
    display: none;
}

/* Layout: sidebar + main content */
.sc-layout {
    display: flex;
    min-height: calc(100vh - 64px);
    width: 100%;
}

/* ─── Left Sidebar ─────────────────────────── */
.sc-sidebar {
    display: none;
}

.sc-sidebar-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.sc-sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #71717a);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sc-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #18181b);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.sc-sidebar-link:hover {
    background: var(--bg-card, rgba(0,0,0,0.04));
}

.sc-sidebar-link.active {
    background: transparent;
    color: var(--text-primary, #1d1d1f);
    border: 1.5px solid var(--text-secondary, #555);
}

.sc-sidebar-link.active svg {
    stroke: var(--text-primary, #1d1d1f);
}

.sc-sidebar-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.sc-sidebar-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-card, rgba(0,0,0,0.04));
    color: var(--text-secondary, #71717a);
    padding: 2px 8px;
    border-radius: 9999px;
}

.sc-sidebar-link.active .sc-sidebar-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ─── Main Content Area ────────────────────── */
.sc-main {
    flex: 1;
    min-width: 0;
    background: var(--bg-dark, #fff);
}

/* ─── Hero Banner ──────────────────────────── */
.sc-hero {
    padding: 48px 40px 32px;
    background: linear-gradient(135deg, var(--bg-dark, #fff) 0%, var(--bg-card, #f8f8f8) 100%);
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
    text-align: center;
}

.sc-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #18181b);
    margin: 0 0 8px;
    line-height: 1.2;
}

.sc-hero p {
    font-size: 16px;
    color: var(--text-secondary, #71717a);
    margin: 0 auto;
    max-width: 800px;
}

.sc-hero-hint {
    font-size: 13px;
    color: var(--text-tertiary, #a1a1aa);
    margin-top: 12px;
}

/* ─── Search + Filters Bar ─────────────────── */
.sc-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
    background: var(--bg-dark, #fff);
    position: sticky;
    top: 64px;
    z-index: 9;
    flex-wrap: wrap;
}

#scFilters {
    display: flex;
    gap: 8px;
}

.sc-search-wrap {
    flex: 1;
    min-width: 200px;
    max-width: 480px;
    position: relative;
}

.sc-search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary, #71717a);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.sc-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-card, rgba(0,0,0,0.02));
    color: var(--text-primary, #18181b);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sc-search-input:focus {
    border-color: var(--primary, #06b6d4);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.sc-search-input::placeholder {
    color: var(--text-secondary, #a1a1aa);
}

.sc-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid #d2d2d7;
    border-radius: 9999px;
    background: var(--bg-dark, #fff);
    color: var(--text-primary, #18181b);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.sc-filter-btn:hover {
    background: var(--bg-card, rgba(0,0,0,0.04));
}

.sc-filter-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ─── Custom Dropdowns ─────────────────────── */
.sc-dropdown {
    position: relative;
}

.sc-dropdown .sc-filter-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.sc-dropdown.open .sc-filter-btn svg {
    transform: rotate(180deg);
}

.sc-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--bg-dark, #fff);
    border: 1px solid #d2d2d7;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
}

.sc-dropdown.open .sc-dropdown-menu {
    display: block;
}

.sc-dropdown-opt {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #18181b);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s;
}

.sc-dropdown-opt:hover {
    background: var(--bg-card, rgba(0,0,0,0.04));
}

.sc-dropdown-opt.sc-dropdown-active {
    color: #dc2626;
    font-weight: 600;
}

.sc-sort-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #71717a);
}

.sc-sort-wrap .sc-dropdown-menu {
    left: auto;
    right: 0;
}

/* ─── Results Container ────────────────────── */
.sc-results {
    padding: 24px 40px 60px;
}

.sc-results-info {
    font-size: 13px;
    color: var(--text-secondary, #71717a);
    margin-bottom: 20px;
}

/* ─── Photo / Footage Grid ─────────────────── */
.sc-grid {
    columns: 5 280px;
    column-gap: 16px;
}

.sc-grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card, #f4f4f5);
    cursor: pointer;
    margin-bottom: 16px;
    break-inside: avoid;
    aspect-ratio: 4/3;
}
.sc-grid-item.sc-portrait {
    aspect-ratio: 3/4;
}
.sc-grid-item.sc-square {
    aspect-ratio: 1/1;
}

.sc-grid-item img,
.sc-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sc-grid-item:hover img,
.sc-grid-item:hover video {
    transform: scale(1.03);
}

.sc-grid-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}

.sc-grid-item:hover .sc-grid-overlay {
    opacity: 1;
}

.sc-grid-overlay-top {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.sc-grid-author {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.sc-grid-meta {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 2px;
}

.sc-grid-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    color: #18181b;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.sc-grid-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.sc-grid-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Video badge (duration) */
.sc-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ─── Audio List View (Music / SFX) ────────── */
.sc-list {
    display: flex;
    flex-direction: column;
}

.sc-list-item {
    display: grid;
    grid-template-columns: 40px 48px minmax(200px, 1fr) minmax(100px, 1050px) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
    transition: background 0.15s;
}

.sc-list-item:hover {
    background: rgba(0,0,0,0.02);
}

/* Play button */
.sc-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid #1d1d1f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sc-play-btn:hover {
    border-color: #000;
}

.sc-play-btn svg {
    width: 18px;
    height: 18px;
    stroke: #1d1d1f;
    stroke-width: 2;
    fill: none;
}

.sc-play-btn.playing {
    border-color: #1d1d1f;
}

.sc-play-btn.playing svg {
    stroke: #1d1d1f;
}

[data-theme="dark"] .sc-play-btn {
    border-color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .sc-play-btn:hover {
    border-color: #fff;
}

[data-theme="dark"] .sc-play-btn svg {
    stroke: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .sc-play-btn.playing {
    border-color: #fff;
}

[data-theme="dark"] .sc-play-btn.playing svg {
    stroke: #fff;
}

/* Thumbnail */
.sc-list-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--bg-card, #f4f4f5);
    overflow: hidden;
}
.sc-list-thumb.sc-has-cover {
    cursor: pointer;
    flex-shrink: 0;
}

.sc-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-list-thumb svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    margin: auto;
}
.sc-list-thumb.sc-no-cover {
    display: flex;
    background: #dc2626;
}
.sc-list-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-list-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
}

.sc-list-thumb-placeholder svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Track info */
.sc-list-info {
    min-width: 0;
}

.sc-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #18181b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-list-title .sc-new-badge {
    display: inline-block;
    background: #fbbf24;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}

.sc-list-artist {
    font-size: 12px;
    color: var(--text-secondary, #71717a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tags */
.sc-list-tags {
    font-size: 12px;
    color: var(--text-secondary, #71717a);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Duration */
.sc-list-duration {
    font-size: 13px;
    color: var(--text-secondary, #71717a);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 42px;
    text-align: right;
}

/* Waveform */
.sc-waveform {
    height: 36px;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.sc-waveform svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sc-waveform svg .sc-wave-bg {
    fill: #333335;
    opacity: 0.2;
    transition: opacity 0.15s;
}

[data-theme="dark"] .sc-waveform svg .sc-wave-bg {
    fill: #ffffff;
    opacity: 0.3;
}

.sc-waveform svg .sc-wave-played {
    opacity: 0;
    transition: opacity 0.15s;
}

[data-theme="dark"] .sc-waveform svg .sc-wave-played {
    fill: #ffffff;
}

.sc-list-item:hover .sc-waveform svg .sc-wave-bg {
    opacity: 0.35;
}

[data-theme="dark"] .sc-list-item:hover .sc-waveform svg .sc-wave-bg {
    opacity: 0.45;
}

.sc-list-item .sc-play-btn.playing ~ .sc-list-info ~ .sc-waveform svg .sc-wave-played {
    opacity: 1;
}
.sc-list-item .sc-play-btn.playing ~ .sc-list-info ~ .sc-waveform svg .sc-wave-bg {
    opacity: 0.15;
}

/* Action buttons */
.sc-list-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sc-list-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #71717a);
    transition: all 0.15s;
}

.sc-list-btn:hover {
    background: var(--bg-card, rgba(0,0,0,0.06));
    color: var(--text-primary, #18181b);
}

.sc-list-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ─── Loading / Empty States ───────────────── */
.sc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
    color: var(--text-secondary, #71717a);
}

.sc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border, rgba(0,0,0,0.1));
    border-top-color: var(--primary, #06b6d4);
    border-radius: 50%;
    animation: sc-spin 0.7s linear infinite;
}

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

.sc-loading-more {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

.sc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 12px;
    color: var(--text-secondary, #71717a);
    text-align: center;
}

.sc-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--border, rgba(0,0,0,0.15));
    stroke-width: 1.5;
    fill: none;
}

.sc-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #18181b);
    margin: 0;
}

.sc-empty p {
    font-size: 14px;
    margin: 0;
}

/* ─── Pagination ───────────────────────────── */
.sc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-bottom: 20px;
}

.sc-page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border, rgba(0,0,0,0.12));
    border-radius: 8px;
    background: var(--bg-dark, #fff);
    color: var(--text-primary, #18181b);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.sc-page-btn:hover {
    background: var(--bg-card, rgba(0,0,0,0.04));
}

.sc-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sc-page-btn.active {
    background: var(--primary, #06b6d4);
    color: #fff;
    border-color: var(--primary, #06b6d4);
}

.sc-page-info {
    font-size: 13px;
    color: var(--text-secondary, #71717a);
    padding: 0 8px;
}

/* ─── Mini Audio Player (bottom) ───────────── */
.sc-player {
    position: fixed;
    bottom: 12px;
    left: 220px;
    right: 12px;
    height: 64px;
    background: var(--bg-dark, #fff);
    border-top: 1px solid var(--border, rgba(0,0,0,0.1));
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px 0 32px;
    z-index: 100;
    transform: translateY(calc(100% + 12px));
    transition: transform 0.3s ease;
}

.sc-player.visible {
    transform: translateY(0);
}

.sc-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.sc-player-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card);
}

.sc-player-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-player-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sc-player-artist {
    font-size: 12px;
    color: var(--text-secondary);
}

.sc-player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sc-player-progress {
    flex: 1;
    height: 4px;
    background: var(--border, rgba(0,0,0,0.1));
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.sc-player-progress-bar {
    height: 100%;
    background: #dc2626;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.sc-player-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: center;
}

/* ─── Lightbox Preview ─────────────────────── */
.sc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

body:has(.sc-lightbox.open) header,
body:has(.sc-lightbox.open) .sidebar {
    z-index: 0 !important;
    transition-duration: 0s !important;
}

.sc-lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.sc-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.15s;
}

.sc-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.sc-lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sc-lightbox img,
.sc-lightbox video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
}

.sc-lightbox-actions {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.sc-lightbox-btn {
    padding: 10px 24px;
    border-radius: 9999px;
    background: #fff;
    color: #18181b;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.sc-lightbox-btn:hover {
    transform: scale(1.03);
}

.sc-lightbox-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ─── Responsive ───────────────────────────── */
@media (max-width: 1024px) {
    .sc-toolbar {
        padding: 12px 20px;
    }
    .sc-hero {
        padding: 32px 20px 24px;
    }
    .sc-results {
        padding: 20px 20px 60px;
    }
    .sc-waveform {
        display: none;
    }
    .sc-list-tags {
        display: none;
    }
    .sc-list-item {
        grid-template-columns: 40px 48px 1fr minmax(100px, 250px) auto auto;
    }
}

@media (max-width: 768px) {
    .sc-sidebar {
        display: none;
    }

    .sc-mobile-tabs {
        display: flex !important;
        gap: 0;
        border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 16px;
        background: var(--bg-dark, #fff);
        position: sticky;
        top: 56px;
        z-index: 10;
    }

    .sc-mobile-tab {
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-secondary, #71717a);
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        transition: all 0.15s;
        background: none;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .sc-mobile-tab.active {
        color: var(--primary, #06b6d4);
        border-bottom-color: var(--primary, #06b6d4);
    }

    .sc-hero h1 {
        font-size: 24px;
    }
    .sc-hero {
        padding: 24px 16px 20px;
    }
    .sc-toolbar {
        padding: 12px 16px;
        top: 100px;
    }
    .sc-results {
        padding: 16px 16px 80px;
    }
    .sc-grid {
        columns: 2;
        column-gap: 8px;
    }
    .sc-grid-item {
        margin-bottom: 8px;
    }
    .sc-player {
        left: 0;
    }
    .sc-list-item {
        grid-template-columns: 36px 40px 1fr auto;
        gap: 8px;
        padding: 10px 0;
    }
    .sc-waveform {
        display: none;
    }
    .sc-list-thumb {
        width: 40px;
        height: 40px;
    }
    .sc-list-item:hover {
        margin: 0 -16px;
        padding: 10px 16px;
    }
    .sc-list-duration {
        display: none;
    }
}

/* Mobile tabs hidden on desktop */
.sc-mobile-tabs {
    display: none;
}

/* ─── Attribution ──────────────────────────── */
.sc-attribution {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-secondary, #a1a1aa);
}

.sc-attribution a {
    color: var(--text-secondary, #71717a);
    text-decoration: underline;
}
