/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080c14;
  --bg2: #0d1220;
  --bg3: #111827;
  --surface: #151e2d;
  --surface2: #1a2438;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --text: #e8edf5;
  --text2: #8a96a8;
  --text3: #555f6e;
  --accent: #6366f1;
  --accent2: #818cf8;

  --s-color: #a78bfa;
  --s-bg: rgba(167,139,250,0.1);
  --s-border: rgba(167,139,250,0.3);

  --a-color: #34d399;
  --a-bg: rgba(52,211,153,0.1);
  --a-border: rgba(52,211,153,0.3);

  --b-color: #60a5fa;
  --b-bg: rgba(96,165,250,0.1);
  --b-border: rgba(96,165,250,0.3);

  --c-color: #94a3b8;
  --c-bg: rgba(148,163,184,0.08);
  --c-border: rgba(148,163,184,0.2);

  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'JetBrains Mono', monospace;
  --font-body: 'Sora', sans-serif;
}

/* ===== MULTIPLE THEMES ===== */
:root {
  --accent: #6366f1;
  --accent2: #818cf8;
}

[data-theme="indigo"] {
  --bg: #0a0c1a;
  --bg2: #111827;
  --bg3: #1e2937;
  --surface: #1f2937;
  --surface2: #374151;
  --accent: #6366f1;
  --accent2: #a5b4fc;
}

[data-theme="purple"] {
  --bg: #0f071a;
  --bg2: #1a1133;
  --bg3: #2e1a4d;
  --surface: #2a1f47;
  --surface2: #3b2a5f;
  --accent: #a855f7;
  --accent2: #c084fc;
}

[data-theme="teal"] {
  --bg: #0a1a18;
  --bg2: #112d2a;
  --bg3: #1a403d;
  --surface: #1f4d4a;
  --surface2: #2a5f5b;
  --accent: #14b8a6;
  --accent2: #5eead4;
}

/* Default (Deep Dark) */
[data-theme="dark"] {
  --bg: #080c14;
  --bg2: #0d1220;
  --bg3: #111827;
  --surface: #151e2d;
  --surface2: #1a2438;
  --accent: #6366f1;
  --accent2: #818cf8;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 110px 0 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}
.orb1 { width: 500px; height: 500px; background: #6366f1; top: -200px; left: -100px; animation: drift1 12s ease-in-out infinite; }
.orb2 { width: 400px; height: 400px; background: #8b5cf6; top: -100px; right: 0; animation: drift2 15s ease-in-out infinite; }
.orb3 { width: 300px; height: 300px; background: #06b6d4; bottom: -100px; left: 40%; animation: drift3 10s ease-in-out infinite; }

@keyframes drift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,20px)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-20px,30px)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(20px,-15px)} }

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero .container { position: relative; z-index: 1; }

/* Theme Switcher */
.theme-switcher {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  transform: scale(1.15);
  border-color: var(--accent);
}

.theme-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.badge-top {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent2);
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 20px;
}
.hero-title .line1 {
  display: block;
  font-size: clamp(42px, 7vw, 76px);
  color: var(--text);
}
.hero-title .line2 {
  display: block;
  font-size: clamp(42px, 7vw, 76px);
  background: linear-gradient(135deg, #6366f1, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 17px;
  color: var(--text2);
  max-width: 520px;
  margin-bottom: 40px;
}
.hero-sub strong { color: var(--text); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text3); margin-top: 2px; }
.stat-div { width: 1px; height: 36px; background: var(--border2); }

/* ===== TIER SECTION ===== */
.tier-section { padding: 72px 0 60px; }

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.section-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 32px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tier-card {
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid;
  transition: transform 0.2s;
}
.tier-card:hover { transform: translateY(-3px); }

.t-s { background: var(--s-bg); border-color: var(--s-border); }
.t-a { background: var(--a-bg); border-color: var(--a-border); }
.t-b { background: var(--b-bg); border-color: var(--b-border); }
.t-c { background: var(--c-bg); border-color: var(--c-border); }

.tier-icon { font-size: 22px; margin-bottom: 10px; }
.tier-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}
.t-s .tier-name { color: var(--s-color); }
.t-a .tier-name { color: var(--a-color); }
.t-b .tier-name { color: var(--b-color); }
.t-c .tier-name { color: var(--c-color); }

.tier-meaning {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: 0.6;
}
.t-s .tier-meaning { color: var(--s-color); }
.t-a .tier-meaning { color: var(--a-color); }
.t-b .tier-meaning { color: var(--b-color); }
.t-c .tier-meaning { color: var(--c-color); }

.tier-detail { font-size: 13px; color: var(--text2); line-height: 1.55; }

/* ===== CONTROLS ===== */
.controls-section {
  padding: 0 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,12,20,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text3);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 44px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input::placeholder { color: var(--text3); }
.search-wrap input:focus { border-color: var(--accent); }
.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  display: none;
}
.search-clear.visible { display: block; }

.filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fbtn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fbtn:hover { background: var(--surface); color: var(--text); }
.fbtn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fbtn-count {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
}

.result-count { font-size: 12px; color: var(--text3); }

/* ===== LIB GRID ===== */
.libs-section { 
  padding: 40px 0 72px; 
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;                    
}

/* ===== LIB CARD ===== */
.lib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  opacity: 0;                    /* শুরুতে লুকানো থাকবে */

  /* Staggered Card Pop Animation */
  animation: cardPop 0.85s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Staggered Delay for each card */
.lib-grid .lib-card:nth-child(1)  { animation-delay: 0ms; }
.lib-grid .lib-card:nth-child(2)  { animation-delay: 60ms; }
.lib-grid .lib-card:nth-child(3)  { animation-delay: 120ms; }
.lib-grid .lib-card:nth-child(4)  { animation-delay: 180ms; }
.lib-grid .lib-card:nth-child(5)  { animation-delay: 240ms; }
.lib-grid .lib-card:nth-child(6)  { animation-delay: 300ms; }
.lib-grid .lib-card:nth-child(7)  { animation-delay: 360ms; }
.lib-grid .lib-card:nth-child(8)  { animation-delay: 420ms; }
.lib-grid .lib-card:nth-child(9)  { animation-delay: 480ms; }
.lib-grid .lib-card:nth-child(10) { animation-delay: 540ms; }
.lib-grid .lib-card:nth-child(11) { animation-delay: 600ms; }
.lib-grid .lib-card:nth-child(12) { animation-delay: 660ms; }

/* Card Pop Animation Keyframes */
@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tier Top Glow Line */
.lib-card::before {
  content: '';
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), #06b6d4, transparent);
  transition: all 0.5s ease;
  opacity: 0.75;
}

/* Tier-based accent line */
.lib-card.tier-S::before { background: linear-gradient(90deg, var(--s-color), transparent); }
.lib-card.tier-A::before { background: linear-gradient(90deg, var(--a-color), transparent); }
.lib-card.tier-B::before { background: linear-gradient(90deg, var(--b-color), transparent); }
.lib-card.tier-C::before { background: linear-gradient(90deg, var(--c-color), transparent); }

/* Hover Effects */
.lib-card:hover {
  transform: translateY(-12px) scale(1.025);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.45),
              0 10px 15px -3px rgb(99 102 241 / 0.2);
  border-color: var(--accent);
  background: var(--surface2);
}

.lib-card:hover::before {
  height: 5px;
  opacity: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent2), #06b6d4);
}

/* Subtle shine effect */
.lib-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.13) 50%,
    transparent 70%
  );
  transform: translateX(-150%) skewX(-25deg);
  transition: transform 0.85s ease;
  pointer-events: none;
  opacity: 0;
}

.lib-card:hover::after {
  opacity: 1;
  transform: translateX(250%) skewX(-25deg);
}

/* Copy Install Button */
.copy-install-btn {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  color: var(--text3);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-install-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent2);
  transform: translateY(-1px);
}

.copy-install-btn.copied {
  background: rgba(52, 211, 153, 0.2);
  border-color: #34d399;
  color: #34d399;
}

/* Disabled Copy-paste text */
.copy-install-disabled {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text3);
  opacity: 0.65;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent2);
  transform: translateY(-1px);
}

.copy-btn.copied {
  background: rgba(52, 211, 153, 0.15);
  border-color: #34d399;
  color: #34d399;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.card-name-wrap { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.new-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.anim-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(167,139,250,0.12);
  color: #a78bfa;
  border: 1px solid rgba(167,139,250,0.2);
}

.tier-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tb-S { background: var(--s-bg); color: var(--s-color); border: 1px solid var(--s-border); }
.tb-A { background: var(--a-bg); color: var(--a-color); border: 1px solid var(--a-border); }
.tb-B { background: var(--b-bg); color: var(--b-color); border: 1px solid var(--b-border); }
.tb-C { background: var(--c-bg); color: var(--c-color); border: 1px solid var(--c-border); }

.card-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.tag-free { background: rgba(52,211,153,0.1); color: #34d399; }
.tag-paid { background: rgba(251,191,36,0.1); color: #fbbf24; }
.tag-react { background: rgba(96,165,250,0.1); color: #60a5fa; }
.tag-next { background: rgba(255,255,255,0.06); color: var(--text2); }
.tag-install {
  font-family: var(--font-display);
  font-size: 9px;
  background: rgba(255,255,255,0.04);
  color: var(--text3);
  border: 1px solid var(--border);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-link {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.card-link:hover { color: #c4b5fd; }

/* NO RESULT */
.no-result {
  text-align: center;
  padding: 60px 0;
  color: var(--text2);
}
.no-result-icon { font-size: 40px; margin-bottom: 12px; }
.no-result p { font-size: 15px; }
.hidden { display: none !important; }

/* ===== CONFLICT ===== */
.conflict-section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.conflict-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .conflict-grid { grid-template-columns: 1fr; } }

.conflict-col {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid;
}
.conflict-col.safe { border-color: rgba(52,211,153,0.2); }
.conflict-col.danger { border-color: rgba(239,68,68,0.2); }

.conflict-head {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
}
.safe .conflict-head { background: rgba(52,211,153,0.1); color: #34d399; }
.danger .conflict-head { background: rgba(239,68,68,0.08); color: #f87171; }

.conflict-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text2);
  border-top: 1px solid var(--border);
}
.conflict-item:hover { background: rgba(255,255,255,0.02); }

/* ===== RECOMMENDATION ===== */
.rec-section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.rec-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rec-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  min-width: 130px;
}
.rec-role { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.rec-lib { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--accent2); }
.rec-arrow { font-size: 18px; color: var(--text3); flex-shrink: 0; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}
.footer p { font-size: 12px; color: var(--text3); }

/* ===== SKELETON LOADING ===== */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  height: 178px;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.skeleton-title {
  height: 18px;
  width: 65%;
  background: var(--surface2);
  border-radius: 6px;
}

.skeleton-badge {
  height: 22px;
  width: 70px;
  background: var(--surface2);
  border-radius: 20px;
}

.skeleton-desc {
  height: 14px;
  width: 100%;
  background: var(--surface2);
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-desc:last-child {
  width: 75%;
  margin-bottom: 0;
}

.skeleton-footer {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.skeleton-tag {
  height: 24px;
  width: 65px;
  background: var(--surface2);
  border-radius: 6px;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 60px 0 50px; }
  .hero-title .line1, .hero-title .line2 { font-size: 38px; }
  .lib-grid { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr 1fr; }
  .rec-grid { flex-direction: column; align-items: flex-start; }
  .rec-arrow { transform: rotate(90deg); }
  .hero-stats { gap: 16px; }
}
@media (max-width: 480px) {
  .tier-grid { grid-template-columns: 1fr; }
  .hero-title .line1, .hero-title .line2 { font-size: 30px; }
}
