/* 3DSEARCH – Modern Dark Redesign v1 */

/* Override root vars: Dark as default */
:root {
    --bg: #0c0c0e;
    --surface: #151517;
    --surface2: #1c1c20;
    --surface3: #242428;
    --border: #252529;
    --border2: #333338;
    --text: #e4e4e8;
    --muted: #888894;
    --muted2: #555560;
    --accent: #7c6cf0;
    --accent-bg: rgba(124,108,240,.1);
    --accent2: #8d7ff5;
    --radius: 12px;
    --sidebar: 230px;
}

/* Light mode via toggle */
[data-theme="light"] {
    --bg: #f4f4f6;
    --surface: #ffffff;
    --surface2: #ededf0;
    --surface3: #e4e4e8;
    --border: #dddde2;
    --border2: #ccccD4;
    --text: #18181c;
    --muted: #6e6e7a;
    --muted2: #a0a0aa;
    --accent: #6c5ce7;
    --accent-bg: rgba(108,92,231,.07);
    --accent2: #5a4bd6;
}

/* Kill all old [data-theme="dark"] overrides — they now conflict */
[data-theme="dark"] body,
[data-theme="dark"] header,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .card:hover,
[data-theme="dark"] .card-img,
[data-theme="dark"] .hero-band,
[data-theme="dark"] .hero-search-form,
[data-theme="dark"] .hero-search-form:focus-within,
[data-theme="dark"] .header-search-mini form,
[data-theme="dark"] .trending-bar,
[data-theme="dark"] .trending-tag,
[data-theme="dark"] .trending-tag:hover,
[data-theme="dark"] .page-btn,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .ctag,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] footer,
[data-theme="dark"] .autocomplete-dropdown,
[data-theme="dark"] .ac-item:hover,
[data-theme="dark"] .ac-item.selected,
[data-theme="dark"] .reset-btn,
[data-theme="dark"] .reset-btn:hover,
[data-theme="dark"] .source-item.active,
[data-theme="dark"] .sort-item.active,
[data-theme="dark"] .cat-item.active,
[data-theme="dark"] .source-item:hover,
[data-theme="dark"] .sort-item:hover,
[data-theme="dark"] .cat-item:hover {
    background: unset;
    border-color: unset;
    color: unset;
    box-shadow: unset;
}

/* Body */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header – glassmorphism */
header {
    background: rgba(12,12,14,.8);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    height: 56px;
}
[data-theme="light"] header {
    background: rgba(244,244,246,.82);
}

.logo { font-size: 1.15rem; letter-spacing: -.04em; }
.logo em { color: var(--accent); }

/* Hero */
.hero-band {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 2.2rem 1.5rem 2rem;
}
.hero-band-sub { font-size: .85rem; color: var(--muted); }
.hero-band-sub strong { color: var(--accent); font-weight: 700; }

.hero-search-form {
    height: 50px;
    border-radius: 14px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.hero-search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 28px rgba(124,108,240,.2), 0 0 0 3px rgba(124,108,240,.08);
}
.hero-search-form input { font-size: .95rem; }
.hero-search-form button {
    background: var(--accent);
    border-radius: 0 12px 12px 0;
    font-size: .78rem;
    letter-spacing: .04em;
    padding: 0 1.5rem;
}
.hero-search-form button:hover { background: var(--accent2); }
[data-theme="light"] .hero-search-form { box-shadow: 0 4px 20px rgba(0,0,0,.06); }

/* Mini search */
.header-search-mini form {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    height: 36px;
}
.header-search-mini form:focus-within {
    border-color: var(--accent);
    background: var(--surface3);
}
.header-search-mini button { background: var(--accent); }
.header-search-mini button:hover { background: var(--accent2); }

/* Trending */
.trending-bar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.trending-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--muted);
}
.trending-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

/* Sidebar */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    width: var(--sidebar);
}
.sidebar-label { color: var(--muted2); }

.source-item, .sort-item, .cat-item {
    border-radius: 8px;
    transition: all .15s;
    color: var(--muted);
    border: 1.5px solid transparent;
}
.source-item:hover, .sort-item:hover, .cat-item:hover {
    background: var(--surface2);
    color: var(--text);
}
.source-item.active, .sort-item.active, .cat-item.active {
    background: var(--accent-bg);
    border-color: rgba(124,108,240,.2);
    color: var(--accent);
}
.source-name { color: var(--text); }
.source-count { color: var(--muted2); }

/* Content */
.content { background: var(--bg); }

/* Grid */
.grid {
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 14px;
}

/* Cards – the main attraction */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .3s cubic-bezier(.4,0,.2,1);
}
.card:hover {
    border-color: var(--border2);
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
    transform: translateY(-5px);
}
[data-theme="light"] .card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
}
.card:hover .card-img img { transform: scale(1.06); }

.card-img {
    background: var(--surface2);
}
.card-img img {
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}

.card-badge {
    width: 8px; height: 8px;
    box-shadow: 0 0 0 2.5px rgba(0,0,0,.5);
}

.card-body {
    padding: .85rem 1rem .8rem;
    gap: .3rem;
}
.card-name {
    font-size: .82rem; font-weight: 600;
    line-height: 1.35; color: var(--text);
}
.card-designer { font-size: .68rem; color: var(--muted); }

.ctag {
    font-size: .6rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
}
.card-stats {
    border-top: 1px solid var(--border);
}
.stat { color: var(--muted); }

/* Wishlist */
.wish-btn {
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(8px);
}
.wish-btn:hover { background: rgba(0,0,0,.7); }
.wish-btn.active svg { fill: #ff4757; stroke: #ff4757; }
.wish-link:hover { color: #ff4757; }
.wish-link:hover svg { fill: #ff4757; stroke: #ff4757; }

/* Autocomplete */
.autocomplete-dropdown {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
[data-theme="light"] .autocomplete-dropdown {
    box-shadow: 0 20px 60px rgba(0,0,0,.1);
}
.ac-item:hover, .ac-item.selected { background: var(--surface2); }

/* Pagination */
.page-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
}
.page-btn:hover {
    color: var(--text);
    border-color: var(--border2);
    background: var(--surface2);
}
.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Filter chips */
.filter-chip {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 20px;
    color: var(--text);
}
.filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

/* Theme toggle */
.theme-toggle {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 10px;
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-bg);
}

/* Language */
.lang-switch a { color: var(--muted); border-radius: 6px; }
.lang-switch a:hover { color: var(--text); border-color: var(--border); }
.lang-switch a.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }

/* Reset */
.reset-btn { border-color: var(--border); color: var(--muted); border-radius: 8px; }
.reset-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* Footer */
footer { background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); }

/* PWA */
.pwa-banner { background: var(--surface); border-top: 1px solid var(--border2); box-shadow: 0 -8px 32px rgba(0,0,0,.2); }
.pwa-banner-install { background: var(--accent); border-radius: 8px; }
.pwa-banner-install:hover { background: var(--accent2); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* Selection */
::selection { background: rgba(124,108,240,.3); color: #fff; }

/* Mobile sidebar */
@media (max-width: 960px) {
    .sidebar { background: var(--surface); box-shadow: 4px 0 30px rgba(0,0,0,.4); }
}
