/* ============================================================
   NeoSOFT AI Showcase — DB-driven UI additions
   (search, category chips, stats, new card blocks, animations)
   Layers on top of style.css; dark theme, brand red #EE2E2B.
   ============================================================ */

:root {
  --sc-brand: #EE2E2B;
  --sc-cyan: #22d3ee;
  --sc-violet: #8b5cf6;
  --sc-amber: #f59e0b;
  --sc-emerald: #34d399;
  --sc-card: rgba(255, 255, 255, 0.04);
  --sc-line: rgba(255, 255, 255, 0.10);
}

/* ---------- DB-driven showcase stats strip ---------- */
.showcase-stats {
  margin: 2.2rem auto 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  max-width: 46rem;
}
@media (max-width: 640px) { .showcase-stats { grid-template-columns: repeat(3, 1fr); } }
.sc-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.85rem 0.5rem; border-radius: 1rem;
  border: 1px solid var(--sc-line); background: var(--sc-card);
  backdrop-filter: blur(6px);
}
.sc-num { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.sc-lbl { font-size: 0.7rem; color: #a1a1aa; margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Search (inside the filter popup) ---------- */
.proj-search { position: relative; display: flex; align-items: center; margin: 0 0.35rem 0.6rem; }
.proj-search-icon { position: absolute; left: 0.75rem; color: #71717a; pointer-events: none; }
#proj-search {
  width: 100%; padding: 0.55rem 2.4rem; border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--sc-line);
  color: #fff; font-size: 0.85rem; outline: none; transition: border-color .2s, background .2s;
}
#proj-search::placeholder { color: #71717a; }
#proj-search:focus { border-color: rgba(238, 46, 43, 0.6); background: rgba(255, 255, 255, 0.07); }
.proj-search-clear {
  position: absolute; right: 0.4rem; width: 1.6rem; height: 1.6rem; border-radius: 0.5rem;
  display: grid; place-items: center; color: #a1a1aa; background: rgba(255, 255, 255, 0.06); border: 0; cursor: pointer;
}
.proj-search-clear:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* ---------- lazy-load ---------- */
.proj-sentinel { height: 1px; }
.proj-loader { display: flex; align-items: center; justify-content: center; gap: 0.6rem; color: #a1a1aa; font-size: 0.85rem; padding: 2rem 1rem; }
.proj-spinner { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--sc-brand); animation: sc-spin 0.8s linear infinite; }
@keyframes sc-spin { to { transform: rotate(360deg); } }
.proj-loadmore { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0 auto 2rem; padding: 0.7rem 1.3rem; border-radius: 0.8rem; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--sc-line); color: #fff; font-weight: 600; cursor: pointer; }
.proj-loadmore:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- card meta row (client / location / year) ---------- */
.case-meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0.4rem 0 0.6rem; }
.cmeta { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: #a1a1aa; }
.cmeta i { color: var(--sc-brand); opacity: 0.85; }

/* ---------- Challenge / Solution / Impact blocks ---------- */
.cri { margin-top: 0.85rem; padding: 0.85rem 1rem; border-radius: 0.85rem; border: 1px solid var(--sc-line); background: rgba(255, 255, 255, 0.025); }
.cri-head { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.cri p { font-size: 0.9rem; color: #d4d4d8; line-height: 1.55; margin: 0; }
.cri-challenge { border-left: 3px solid #f59e0b; }
.cri-challenge .cri-head { color: #fbbf24; }
.cri-solution { border-left: 3px solid var(--sc-emerald); }
.cri-solution .cri-head { color: #6ee7b7; }
.cri-solution .case-feature-list { margin: 0; }
.cri-impact { border-left: 3px solid var(--sc-brand); background: linear-gradient(100deg, rgba(238, 46, 43, 0.06), transparent); }
.cri-impact .cri-head { color: #fca5a5; }
.cri-note { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em; color: #71717a; background: rgba(255, 255, 255, 0.08); padding: 0.1rem 0.35rem; border-radius: 0.35rem; margin-left: 0.3rem; }

/* ---------- impact metrics ---------- */
.case-metrics { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.7rem; }
.metric { display: flex; flex-direction: column; padding: 0.45rem 0.75rem; border-radius: 0.65rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--sc-line); min-width: 4.5rem; }
.metric-val { font-size: 1.1rem; font-weight: 800; color: #fff; line-height: 1.1; }
.metric-lbl { font-size: 0.66rem; color: #a1a1aa; margin-top: 0.15rem; }

.case-cta-static { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.1rem; border-radius: 0.8rem; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--sc-line); color: #fff; font-weight: 600; font-size: 0.9rem; }

/* ============================================================
   Animated visuals for image-less cards
   ============================================================ */
.anim-visual {
  position: relative; width: 100%; height: 100%; min-height: 230px;
  border-radius: inherit; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #15151b 0%, #0a0a0d 70%);
  display: grid; place-items: center;
}
.case-visual .anim-visual { aspect-ratio: 16 / 11; }
.anim-visual > * { pointer-events: none; }
.av-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(238, 46, 43, 0.22), transparent 60%); opacity: 0; }
.av-core {
  position: relative; z-index: 5; width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}
.av-core i { width: 30px; height: 30px; }
.av-rings, .av-orbit, .av-bars, .av-grid, .av-sweep { position: absolute; inset: 0; display: none; }
.av-rings span { position: absolute; top: 50%; left: 50%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); transform: translate(-50%, -50%); }
.av-rings span:nth-child(1) { width: 90px; height: 90px; }
.av-rings span:nth-child(2) { width: 150px; height: 150px; }
.av-rings span:nth-child(3) { width: 215px; height: 215px; }
.av-orbit b { position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--sc-brand); box-shadow: 0 0 12px var(--sc-brand); }
.av-bars { display: none; align-items: flex-end; justify-content: center; gap: 7px; padding: 0 0 26px; }
.av-bars i { width: 9px; height: 26px; border-radius: 4px; background: linear-gradient(180deg, var(--sc-cyan), rgba(34, 211, 238, 0.25)); }
.av-grid { background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 28px 28px; }
.av-sweep { background: conic-gradient(from 0deg at 50% 50%, rgba(34, 211, 238, 0.35), transparent 25%); border-radius: 50%; }

/* show + animate per type */
.anim-mesh .av-glow, .anim-pulse .av-glow, .anim-spark .av-glow, .anim-radar .av-glow, .anim-beam .av-glow { display: block; animation: av-glow 3.5s ease-in-out infinite; }
@keyframes av-glow { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.7; } }
.av-core { animation: av-float 4s ease-in-out infinite; }
@keyframes av-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* rings (radar, pulse, scan, mesh, orbit, nodes) */
.anim-radar .av-rings, .anim-pulse .av-rings, .anim-scan .av-rings, .anim-mesh .av-rings, .anim-orbit .av-rings, .anim-nodes .av-rings, .anim-layers .av-rings { display: block; }
.anim-pulse .av-rings span, .anim-scan .av-rings span { animation: av-ping 3s ease-out infinite; opacity: 0; }
.anim-pulse .av-rings span:nth-child(2), .anim-scan .av-rings span:nth-child(2) { animation-delay: 1s; }
.anim-pulse .av-rings span:nth-child(3), .anim-scan .av-rings span:nth-child(3) { animation-delay: 2s; }
@keyframes av-ping { 0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.4); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }

/* orbit dots (orbit, nodes, mesh) */
.anim-orbit .av-orbit, .anim-nodes .av-orbit, .anim-mesh .av-orbit { display: block; }
.anim-orbit .av-orbit b, .anim-nodes .av-orbit b, .anim-mesh .av-orbit b {
  animation: av-orbit 7s linear infinite; transform-origin: 0 0;
  animation-delay: calc(var(--a) * -1.16s);
}
.anim-nodes .av-orbit b { background: var(--sc-violet); box-shadow: 0 0 12px var(--sc-violet); }
.anim-mesh .av-orbit b { background: var(--sc-cyan); box-shadow: 0 0 12px var(--sc-cyan); }
@keyframes av-orbit { from { transform: rotate(0deg) translateX(96px); } to { transform: rotate(360deg) translateX(96px); } }

/* bars (bars, wave, spark, layers) */
.anim-bars .av-bars, .anim-wave .av-bars, .anim-spark .av-bars, .anim-layers .av-bars { display: flex; }
.anim-bars .av-bars i, .anim-wave .av-bars i, .anim-spark .av-bars i { animation: av-bar 1.3s ease-in-out infinite; }
.anim-bars .av-bars i:nth-child(2), .anim-wave .av-bars i:nth-child(2) { animation-delay: 0.15s; }
.anim-bars .av-bars i:nth-child(3), .anim-wave .av-bars i:nth-child(3) { animation-delay: 0.30s; }
.anim-bars .av-bars i:nth-child(4), .anim-wave .av-bars i:nth-child(4) { animation-delay: 0.45s; }
.anim-bars .av-bars i:nth-child(5), .anim-wave .av-bars i:nth-child(5) { animation-delay: 0.60s; }
.anim-bars .av-bars i:nth-child(6), .anim-wave .av-bars i:nth-child(6) { animation-delay: 0.75s; }
.anim-spark .av-bars i { animation-duration: 0.7s; background: linear-gradient(180deg, var(--sc-amber), rgba(245, 158, 11, 0.25)); }
.anim-layers .av-bars i { background: linear-gradient(180deg, var(--sc-violet), rgba(139, 92, 246, 0.25)); }
@keyframes av-bar { 0%, 100% { height: 18px; opacity: 0.6; } 50% { height: 56px; opacity: 1; } }

/* grid (grid, flow, beam) */
.anim-grid .av-grid, .anim-flow .av-grid, .anim-beam .av-grid { display: block; }
.anim-flow .av-grid, .anim-beam .av-grid { animation: av-gridmove 5s linear infinite; }
@keyframes av-gridmove { from { background-position: 0 0; } to { background-position: 28px 28px; } }

/* sweep (radar, scan, beam) */
.anim-radar .av-sweep, .anim-scan .av-sweep { display: block; animation: av-spin 4s linear infinite; }
.anim-beam .av-sweep { display: block; background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.4), transparent); border-radius: 0; animation: av-beam 2.6s ease-in-out infinite; }
@keyframes av-spin { to { transform: rotate(360deg); } }
@keyframes av-beam { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.av-tag {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 6; font-size: 0.68rem; font-weight: 600; color: #e4e4e7; white-space: nowrap;
  padding: 0.25rem 0.7rem; border-radius: 0.6rem; background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(6px);
}

/* featured spotlight uses the same animated visual full-bleed */
.case-featured-visual .anim-visual { min-height: 280px; aspect-ratio: auto; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .anim-visual *, .av-core, .av-orbit b, .av-bars i, .av-sweep, .av-glow { animation: none !important; }
}
