*,
*::before,
*::after{box-sizing:border-box}

html{min-height:100%;background:#f5f7fb}

body.categories-page-body{
 --bg:#f5f7fb;--surface:#fff;--line:#e1e6ee;--text:#182033;--muted:#748096;
 margin:0;min-height:100vh;padding:0 0 34px;background:
 radial-gradient(circle at 50% -10%,rgba(71,120,255,.10),transparent 32%),#f5f7fb;
 color:var(--text);font-family:"Cairo",system-ui,-apple-system,"Segoe UI",sans-serif;
 -webkit-font-smoothing:antialiased;overflow-x:hidden
}

.header{position:relative;width:min(1180px,calc(100% - 28px));min-height:168px;margin:0 auto;padding:28px 78px 20px;display:flex;align-items:center;justify-content:center}
.header-content{text-align:center}
.eyebrow{display:inline-flex;align-items:center;gap:5px;color:#6982b8;font-size:9px;font-weight:900;letter-spacing:1.3px;margin-bottom:5px}
.eyebrow .material-icons{font-size:14px}
.header h1{margin:0;font-size:clamp(29px,5vw,45px);line-height:1.1;font-weight:950;letter-spacing:-.8px;color:#172033}
.header p{margin:8px 0 0;color:#7d8899;font-size:13px;font-weight:600}
.back-btn,.header-action{position:absolute;top:30px;width:54px;height:54px;border:1px solid #dce3ed;border-radius:17px;background:#fff;color:#2a3549;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 7px 22px rgba(38,56,91,.07);-webkit-tap-highlight-color:transparent}
.back-btn{left:0}.header-action{right:0}
.back-btn:hover,.header-action:hover{color:#4778ff;border-color:#afc1ea}
.back-btn .material-icons,.header-action .material-icons{font-size:28px}

.categories-page{width:min(1180px,calc(100% - 28px));margin:0 auto}

.explore-panel{background:rgba(255,255,255,.97);border:1px solid var(--line);border-radius:22px;padding:13px;box-shadow:0 12px 32px rgba(36,52,84,.07);margin-bottom:16px}
.search-box{height:51px;display:flex;align-items:center;gap:8px;padding:0 13px;border:1px solid #dfe5ee;border-radius:16px;background:#f8faff;color:#718096}
.search-box:focus-within{border-color:#9db5f4;box-shadow:0 0 0 4px rgba(71,120,255,.08)}
.search-box input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:#172033;font:inherit;font-size:13px;font-weight:650}
.search-box input::placeholder{color:#9aa4b4}
.search-box>.material-icons{font-size:22px}
#clearSearch{display:none;border:0;background:transparent;color:#8a95a5;cursor:pointer;padding:3px}
#clearSearch.visible{display:inline-flex}

.quick-filters{display:flex;gap:8px;overflow-x:auto;padding:11px 1px 4px;scrollbar-width:none}
.quick-filters::-webkit-scrollbar{display:none}
.quick-filter{flex:0 0 auto;min-height:38px;display:inline-flex;align-items:center;gap:5px;padding:0 12px;border:1px solid #e0e6ee;border-radius:12px;background:#fff;color:#5d697b;font:inherit;font-size:10.5px;font-weight:850;cursor:pointer;white-space:nowrap}
.quick-filter .material-icons{font-size:17px}
.quick-filter.active{color:#fff;background:linear-gradient(135deg,#4778ff,#5f66e8);border-color:transparent;box-shadow:0 8px 18px rgba(71,120,255,.18)}

.explore-meta{display:flex;align-items:center;gap:7px;padding:5px 2px 0;color:#7c8798;font-size:10.5px}
.explore-meta>div{display:flex;align-items:baseline;gap:4px;margin-left:auto}
.explore-meta strong{color:#253149;font-size:15px}
.mini-tool{height:31px;display:inline-flex;align-items:center;gap:4px;padding:0 9px;border:1px solid #e0e6ee;border-radius:10px;background:#fff;color:#687489;font:inherit;font-size:10px;font-weight:850;cursor:pointer}
.mini-tool .material-icons{font-size:17px}
.mini-tool.active{color:#c28a00;border-color:#efd78f;background:#fffaf0}
.hidden{display:none!important}

.last-visited{display:flex;align-items:center;gap:10px;margin-bottom:17px;padding:10px 12px;background:#fff;border:1px solid #e2e7ef;border-radius:18px;box-shadow:0 8px 24px rgba(36,52,84,.05)}
.last-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#eef3ff;color:#4778ff}
.last-icon .material-icons{font-size:20px}
.last-visited>div:nth-child(2){display:flex;flex-direction:column;gap:0}
.last-visited small{color:#8a95a6;font-size:9px;font-weight:700}
.last-visited strong{color:#27334a;font-size:12px}
.last-visited button{margin-right:auto;border:0;background:transparent;color:#4778ff;font:inherit;font-size:11px;font-weight:900;display:inline-flex;align-items:center;gap:1px;cursor:pointer}

.section-heading{display:flex;align-items:center;gap:12px;margin:4px 3px 13px}
.section-heading>div{flex:0 0 auto}.section-heading span{display:block;color:#909bab;font-size:8px;letter-spacing:1.7px;font-weight:900}
.section-heading h2{margin:1px 0 0;color:#202a3e;font-size:21px;font-weight:950}
.section-heading i{height:1px;flex:1;background:#e1e6ed}

.categories-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.category-card{--card-accent:#287cff;--card-glow:rgba(40,124,255,.25);position:relative;min-width:0;min-height:190px;padding:0;border:1px solid rgba(92,125,180,.28);border-radius:20px;overflow:hidden;background:#09111f;color:#fff;text-align:right;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.16);appearance:none;-webkit-appearance:none;isolation:isolate;-webkit-tap-highlight-color:transparent}
.category-card:hover{box-shadow:0 13px 30px rgba(30,50,85,.17);border-color:var(--card-accent)}
.category-card:active{transform:scale(.993)}
.category-card:focus-visible{outline:2px solid var(--card-accent);outline-offset:3px}
.category-card.is-selected{border-color:var(--card-accent);box-shadow:0 0 0 2px var(--card-accent),0 9px 25px var(--card-glow)}
.category-card.is-hidden{display:none}
.category-media{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;background:#0b1426}
.category-media::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(5,10,22,.10) 0%,rgba(5,10,22,.52) 55%,rgba(5,10,22,.90) 100%);pointer-events:none;z-index:2}
.category-image{position:absolute;inset:0;z-index:1;display:block;background-repeat:no-repeat;background-position:center;background-size:cover;opacity:1;transition:transform .28s ease}
.category-card:hover .category-image{transform:scale(1.025)}
.category-icon{position:absolute;top:15px;left:15px;z-index:4;width:47px;height:47px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;background:var(--card-accent);color:#fff;border:1px solid rgba(255,255,255,.22);box-shadow:0 6px 18px var(--card-glow)}
.category-icon .material-icons{font-size:25px}
.category-arrow{position:absolute;top:15px;right:15px;z-index:4;width:35px;height:35px;border:2px solid var(--card-accent);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--card-accent);font-size:23px;background:rgba(5,10,22,.34);backdrop-filter:blur(4px)}
.category-content{position:absolute;bottom:0;left:0;right:0;z-index:4;padding:14px 17px;display:flex;flex-direction:column;gap:2px}
.category-content strong{display:block;font-size:16px;line-height:1.3;font-weight:900;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,.55)}
.category-content small{display:block;font-size:11px;line-height:1.4;font-weight:600;color:#d5deea;text-shadow:0 1px 2px rgba(0,0,0,.55)}
.favorite-toggle{position:absolute;left:12px;bottom:12px;width:31px;height:31px;border-radius:10px;display:grid;place-items:center;color:#fff;background:rgba(7,15,28,.48);border:1px solid rgba(255,255,255,.25);z-index:5;cursor:pointer}
.favorite-toggle .material-icons{font-size:18px}
.category-card.is-favorite .favorite-toggle{color:#ffd04a;background:rgba(20,18,8,.58);border-color:rgba(255,208,74,.65)}

.category-card[data-category="all"]{--card-accent:#1677ff;--card-glow:rgba(22,119,255,.3)}
.category-card[data-category="nature"]{--card-accent:#22c55e;--card-glow:rgba(34,197,94,.3)}
.category-card[data-category="cars"]{--card-accent:#ff304f;--card-glow:rgba(255,48,79,.3)}
.category-card[data-category="games"]{--card-accent:#8b4dff;--card-glow:rgba(139,77,255,.3)}
.category-card[data-category="space"]{--card-accent:#7347ff;--card-glow:rgba(115,71,255,.3)}
.category-card[data-category="ai"]{--card-accent:#1ba7ff;--card-glow:rgba(27,167,255,.3)}
.category-card[data-category="amoled"]{--card-accent:#9ba7bd;--card-glow:rgba(155,167,189,.2)}
.category-card[data-category="animals"]{--card-accent:#ff8a16;--card-glow:rgba(255,138,22,.3)}
.category-card[data-category="anime"]{--card-accent:#f02da0;--card-glow:rgba(240,45,160,.3)}
.category-card[data-category="city"]{--card-accent:#ff6b18;--card-glow:rgba(255,107,24,.3)}
.category-card[data-category="dark"]{--card-accent:#9aa7c4;--card-glow:rgba(154,167,196,.2)}
.category-card[data-category="4k"]{--card-accent:#168cff;--card-glow:rgba(22,140,255,.3)}
.category-card[data-category="sports"]{--card-accent:#2bcf65;--card-glow:rgba(43,207,101,.3)}
.category-card[data-category="minimal"]{--card-accent:#ffc52e;--card-glow:rgba(255,197,46,.3)}

.no-results{text-align:center;padding:38px 15px;color:#7c8799}
.no-results .material-icons{font-size:42px;color:#b5bfcc}
.no-results strong{display:block;margin-top:8px;color:#354158;font-size:15px}
.no-results p{margin:5px 0 13px;font-size:11px}
.no-results button{border:1px solid #dfe5ef;background:#fff;color:#4778ff;border-radius:12px;padding:8px 13px;font:inherit;font-size:11px;font-weight:850;cursor:pointer}

/* archived direct backgrounds — restored from the original categories.css */
.category-card[data-image="all.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="nature.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1506744038136-46273834b3fb?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="cars.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="games.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1550745165-9bc0b252726f?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="space.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="ai.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1620712943543-bcc4688e7485?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="amoled.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1509198397868-475647b2a1e5?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="animals.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1534361960057-19889db9621e?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="anime.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1578632767115-351597cf2477?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="city.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1519501025264-65ba15a82390?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="dark.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1507499739999-097706ad8914?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="4k.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1639762681485-074b7f938ba0?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="sports.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1508098682722-e99c43a406b2?q=80&w=600&auto=format&fit=crop")}
.category-card[data-image="minimal.svg"] .category-image{background-image:url("https://images.unsplash.com/photo-1509316975850-ff9c5deb0cd9?q=80&w=600&auto=format&fit=crop")}

@media(min-width:900px){.categories-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
 .header{width:calc(100% - 28px);min-height:154px;padding:26px 68px 20px}
 .back-btn,.header-action{top:26px;width:52px;height:52px;border-radius:17px}
 .header h1{font-size:30px}.header p{font-size:12px}
 .categories-page{width:calc(100% - 20px)}
 .explore-panel{border-radius:20px;padding:11px}
 .categories-grid{gap:10px}
 .category-card{min-height:178px;border-radius:17px}
 .category-icon{top:12px;left:12px;width:42px;height:42px;border-radius:12px}
 .category-icon .material-icons{font-size:22px}
 .category-arrow{top:12px;right:12px;width:32px;height:32px;font-size:20px}
 .category-content{padding:12px 14px}
 .category-content strong{font-size:14px}.category-content small{font-size:9.5px}
}
@media(max-width:420px){
 .header{width:calc(100% - 20px);min-height:143px;padding-left:60px;padding-right:60px}
 .categories-page{width:calc(100% - 14px)}
 .categories-grid{gap:8px}
 .category-card{min-height:164px;border-radius:15px}
 .category-icon{top:10px;left:10px;width:38px;height:38px;border-radius:10px}
 .category-icon .material-icons{font-size:20px}
 .category-arrow{top:10px;right:10px;width:28px;height:28px;font-size:18px}
 .category-content{padding:10px 12px}
 .category-content strong{font-size:13px}.category-content small{font-size:8.5px}
 .favorite-toggle{left:9px;bottom:9px;width:28px;height:28px}
}


/* New categories: use real photographic thumbnails as category icons */
.category-photo-icon{
    padding:0;
    overflow:hidden;
    background:#fff;
    border:2px solid rgba(255,255,255,.88);
}
.category-photo-icon img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:inherit;
}


/* Four new photo-based category cards */
.category-card[data-category="snow"]{--card-accent:#55bde8;--card-glow:rgba(85,189,232,.30)}
.category-card[data-category="aurora"]{--card-accent:#7b75ff;--card-glow:rgba(123,117,255,.30)}
.category-card[data-category="cyberpunk"]{--card-accent:#f34fb5;--card-glow:rgba(243,79,181,.30)}
.category-card[data-category="gradients"]{--card-accent:#a879ff;--card-glow:rgba(168,121,255,.30)}
.category-photo-icon{padding:0;overflow:hidden;background:#fff;border:2px solid rgba(255,255,255,.88)}
.category-photo-icon img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.category-card[data-category="snow"] .category-image,
.category-card[data-category="aurora"] .category-image,
.category-card[data-category="cyberpunk"] .category-image,
.category-card[data-category="gradients"] .category-image{background-position:center;background-size:cover}
