/* ============================================================
   TWT – Exam Category Frontend  v2  (revamped)
   ============================================================ */
.twt-ecat-wrap *,
.twt-ecat-wrap *::before,
.twt-ecat-wrap *::after { box-sizing: border-box; }

.twt-ecat-page-wrap { background: #f4f6fb; min-height: 100vh; }

.twt-ecat-wrap {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 72px;
  color: #111827;
}

/* ═══════════════════════════════════════════════════════════
   ALL-CATEGORIES PAGE HEADER
═══════════════════════════════════════════════════════════ */
.twt-ecat-all-header { margin-bottom: 28px; }
.twt-ecat-all-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.03em;
  color: #0f172a;
  margin: 0 0 6px;
}
.twt-ecat-all-sub {
  font-size: .82rem;
  color: #6b7280;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   CATEGORY GRID (all-categories page)
═══════════════════════════════════════════════════════════ */
.twt-ecat-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px)  { .twt-ecat-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 560px)  { .twt-ecat-cat-grid { grid-template-columns: 1fr; gap: 12px; } }

/* ── Card ─────────────────────────────────────────────────── */
.twt-ecat-cat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 18px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  animation: ecatFadeUp .4s cubic-bezier(.16,1,.3,1) both;
  animation-delay: var(--delay, 0ms);
  transition: transform .2s, box-shadow .2s;
  /* Default – overridden per colour below */
  background: #eef2ff;
  box-shadow: 0 2px 12px rgba(99,102,241,.12);
}
.twt-ecat-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
  text-decoration: none;
  color: inherit;
}

@keyframes ecatFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Decorative circle watermark */
.twt-ecat-cat-card::after {
  content: '';
  position: absolute;
  bottom: -28px; right: -28px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: .10;
}

/* Per-colour card backgrounds + shadows + watermark */
.twt-ecat-cc-indigo  { background: linear-gradient(135deg,#e0e7ff,#eef2ff); box-shadow: 0 3px 14px rgba(99,102,241,.18); }
.twt-ecat-cc-blue    { background: linear-gradient(135deg,#dbeafe,#eff6ff); box-shadow: 0 3px 14px rgba(59,130,246,.18); }
.twt-ecat-cc-violet  { background: linear-gradient(135deg,#ede9fe,#f5f3ff); box-shadow: 0 3px 14px rgba(139,92,246,.18); }
.twt-ecat-cc-cyan    { background: linear-gradient(135deg,#cffafe,#ecfeff); box-shadow: 0 3px 14px rgba(6,182,212,.18); }
.twt-ecat-cc-emerald { background: linear-gradient(135deg,#d1fae5,#ecfdf5); box-shadow: 0 3px 14px rgba(16,185,129,.18); }
.twt-ecat-cc-rose    { background: linear-gradient(135deg,#ffe4e6,#fff1f2); box-shadow: 0 3px 14px rgba(244,63,94,.18); }
.twt-ecat-cc-amber   { background: linear-gradient(135deg,#fef3c7,#fffbeb); box-shadow: 0 3px 14px rgba(245,158,11,.18); }
.twt-ecat-cc-teal    { background: linear-gradient(135deg,#ccfbf1,#f0fdfa); box-shadow: 0 3px 14px rgba(20,184,166,.18); }

.twt-ecat-cc-indigo::after  { background: #6366f1; }
.twt-ecat-cc-blue::after    { background: #3b82f6; }
.twt-ecat-cc-violet::after  { background: #8b5cf6; }
.twt-ecat-cc-cyan::after    { background: #06b6d4; }
.twt-ecat-cc-emerald::after { background: #10b981; }
.twt-ecat-cc-rose::after    { background: #f43f5e; }
.twt-ecat-cc-amber::after   { background: #f59e0b; }
.twt-ecat-cc-teal::after    { background: #14b8a6; }

/* Card top row: icon + test-count badge */
.twt-ecat-cc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.twt-ecat-cc-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.10));
}
.twt-ecat-cc-badge {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .01em;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(4px);
  color: #374151;
  flex-shrink: 0;
}

/* Card body: name + description */
.twt-ecat-cc-body { flex: 1; }
.twt-ecat-cc-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 5px;
  line-height: 1.3;
  word-break: break-word;   /* ← prevents truncation */
  /* NO overflow hidden, NO white-space nowrap */
}
.twt-ecat-cc-desc {
  font-size: .78rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer: CTA + arrow */
.twt-ecat-cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.06);
  margin-top: auto;
}
.twt-ecat-cc-cta {
  font-size: .78rem;
  font-weight: 700;
  color: #374151;
}
.twt-ecat-cc-arrow {
  width: 18px; height: 18px;
  color: #6b7280;
  transition: transform .18s, color .18s;
}
.twt-ecat-cat-card:hover .twt-ecat-cc-arrow {
  transform: translateX(4px);
  color: #111827;
}

/* ═══════════════════════════════════════════════════════════
   DETAIL PAGE
═══════════════════════════════════════════════════════════ */
.twt-ecat-detail { max-width: 860px; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.twt-ecat-bc { margin-bottom: 20px; }
.twt-ecat-bc-ol {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 3px;
  font-size: .79rem;
  color: #6b7280;
}
.twt-ecat-bc-ol a { color: #4f46e5; text-decoration: none; font-weight: 500; }
.twt-ecat-bc-ol a:hover { text-decoration: underline; }
.twt-ecat-bc-sep { color: #cbd5e1; font-size: .9rem; }
.twt-ecat-bc-cur { color: #374151; font-weight: 700; }

/* ── Hero banner ──────────────────────────────────────────── */
.twt-ecat-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.twt-ecat-hero-left { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }

/* Hero background per colour */
.twt-ecat-hero-indigo  { background: linear-gradient(120deg,#e0e7ff,#eef2ff); border: 1.5px solid #c7d2fe; }
.twt-ecat-hero-blue    { background: linear-gradient(120deg,#dbeafe,#eff6ff); border: 1.5px solid #bfdbfe; }
.twt-ecat-hero-violet  { background: linear-gradient(120deg,#ede9fe,#f5f3ff); border: 1.5px solid #ddd6fe; }
.twt-ecat-hero-cyan    { background: linear-gradient(120deg,#cffafe,#ecfeff); border: 1.5px solid #a5f3fc; }
.twt-ecat-hero-emerald { background: linear-gradient(120deg,#d1fae5,#ecfdf5); border: 1.5px solid #a7f3d0; }
.twt-ecat-hero-rose    { background: linear-gradient(120deg,#ffe4e6,#fff1f2); border: 1.5px solid #fecdd3; }
.twt-ecat-hero-amber   { background: linear-gradient(120deg,#fef3c7,#fffbeb); border: 1.5px solid #fde68a; }
.twt-ecat-hero-teal    { background: linear-gradient(120deg,#ccfbf1,#f0fdfa); border: 1.5px solid #99f6e4; }

/* Hero icon circle */
.twt-ecat-hero-icon-wrap {
  width: 62px; height: 62px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.twt-ecat-hicon-indigo  { background: #6366f1; }
.twt-ecat-hicon-blue    { background: #3b82f6; }
.twt-ecat-hicon-violet  { background: #8b5cf6; }
.twt-ecat-hicon-cyan    { background: #06b6d4; }
.twt-ecat-hicon-emerald { background: #10b981; }
.twt-ecat-hicon-rose    { background: #f43f5e; }
.twt-ecat-hicon-amber   { background: #f59e0b; }
.twt-ecat-hicon-teal    { background: #14b8a6; }

.twt-ecat-hero-icon {
  font-size: 1.9rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.2));
}
.twt-ecat-hero-title {
  font-size: 1.55rem;
  font-weight: 900;
  margin: 0 0 4px;
  letter-spacing: -.025em;
  color: #0f172a;
}
.twt-ecat-hero-desc { font-size: .83rem; color: #4b5563; margin: 0; }

/* Hero stats — single stat (available only) */
.twt-ecat-hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 14px 24px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.8);
}
.twt-ecat-hstat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0 16px;
}
.twt-ecat-hstat-num  { font-size: 1.55rem; font-weight: 900; color: #0f172a; line-height: 1; }
.twt-ecat-hstat-lbl  { font-size: .68rem; font-weight: 600; color: #6b7280; letter-spacing: .04em; text-transform: uppercase; }
.twt-ecat-hstat-div  { width: 1px; height: 36px; background: rgba(0,0,0,.10); }

.twt-ecat-hnum-indigo  { color: #6366f1; }
.twt-ecat-hnum-blue    { color: #3b82f6; }
.twt-ecat-hnum-violet  { color: #8b5cf6; }
.twt-ecat-hnum-cyan    { color: #06b6d4; }
.twt-ecat-hnum-emerald { color: #10b981; }
.twt-ecat-hnum-rose    { color: #f43f5e; }
.twt-ecat-hnum-amber   { color: #f59e0b; }
.twt-ecat-hnum-teal    { color: #14b8a6; }

@media (max-width: 600px) {
  .twt-ecat-hero { padding: 18px 16px; gap: 14px; }
  .twt-ecat-hero-title { font-size: 1.2rem; }
  .twt-ecat-hero-icon-wrap { width: 50px; height: 50px; border-radius: 12px; }
  .twt-ecat-hero-icon { font-size: 1.5rem; }
  .twt-ecat-hero-stats { width: 100%; justify-content: center; }
}

/* ── Section label ────────────────────────────────────────── */
.twt-ecat-section-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 12px;
}

/* ── Test list ────────────────────────────────────────────── */
.twt-ecat-test-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.twt-ecat-test-item {
  animation: ecatFadeUp .35s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(var(--i,0) * 55ms);
}

/* Test row card */
.twt-ecat-test-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.twt-ecat-test-row:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
  transform: translateY(-2px);
  border-color: #d1d5db;
}
.twt-ecat-row-locked { opacity: .85; }
.twt-ecat-row-locked:hover { transform: none; box-shadow: none; }

/* Index number */
.twt-ecat-tr-index {
  flex-shrink: 0;
  width: 56px;
  align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .02em;
  background: #f9fafb;
  border-right: 1px solid #f1f5f9;
}
.twt-ecat-trn-indigo  { color: #6366f1; }
.twt-ecat-trn-blue    { color: #3b82f6; }
.twt-ecat-trn-violet  { color: #8b5cf6; }
.twt-ecat-trn-cyan    { color: #06b6d4; }
.twt-ecat-trn-emerald { color: #10b981; }
.twt-ecat-trn-rose    { color: #f43f5e; }
.twt-ecat-trn-amber   { color: #f59e0b; }
.twt-ecat-trn-teal    { color: #14b8a6; }

/* Body */
.twt-ecat-tr-body {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
}
.twt-ecat-tr-title {
  font-size: .95rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.35;
}
.twt-ecat-tr-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Tags / pills */
.twt-ecat-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 9px;
  border-radius: 99px;
}
.twt-ecat-tag svg { width: 11px; height: 11px; flex-shrink: 0; }
.twt-ecat-tag-free { background: #dcfce7; color: #166534; }

/* Action */
.twt-ecat-tr-action {
  flex-shrink: 0;
  padding: 12px 18px;
}

/* Start button */
.twt-ecat-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: opacity .15s, transform .12s, box-shadow .15s;
  white-space: nowrap;
}
.twt-ecat-start-btn svg { width: 12px; height: 12px; }
.twt-ecat-start-btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; color: #fff; }

.twt-ecat-sbtn-indigo  { background: #6366f1; box-shadow: 0 3px 10px rgba(99,102,241,.35); }
.twt-ecat-sbtn-blue    { background: #3b82f6; box-shadow: 0 3px 10px rgba(59,130,246,.35); }
.twt-ecat-sbtn-violet  { background: #8b5cf6; box-shadow: 0 3px 10px rgba(139,92,246,.35); }
.twt-ecat-sbtn-cyan    { background: #06b6d4; box-shadow: 0 3px 10px rgba(6,182,212,.35); }
.twt-ecat-sbtn-emerald { background: #10b981; box-shadow: 0 3px 10px rgba(16,185,129,.35); }
.twt-ecat-sbtn-rose    { background: #f43f5e; box-shadow: 0 3px 10px rgba(244,63,94,.35); }
.twt-ecat-sbtn-amber   { background: #f59e0b; box-shadow: 0 3px 10px rgba(245,158,11,.35); }
.twt-ecat-sbtn-teal    { background: #14b8a6; box-shadow: 0 3px 10px rgba(20,184,166,.35); }

/* Coming soon */
.twt-ecat-soon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
}
.twt-ecat-soon svg { width: 13px; height: 13px; }

/* Mobile test rows: stack action below on very small screens */
@media (max-width: 440px) {
  .twt-ecat-tr-index { width: 44px; }
  .twt-ecat-tr-body  { padding: 12px 12px; }
  .twt-ecat-tr-action { padding: 0 12px 12px; width: 100%; }
  .twt-ecat-start-btn { width: 100%; justify-content: center; }
  .twt-ecat-soon      { justify-content: flex-start; width: 100%; }
  .twt-ecat-test-row  { flex-wrap: wrap; }
}

/* ── Empty state ──────────────────────────────────────────── */
.twt-ecat-empty { text-align: center; padding: 64px 20px; color: #6b7280; }
.twt-ecat-empty-icon { font-size: 3rem; margin-bottom: 14px; }
.twt-ecat-empty h2   { font-size: 1.05rem; font-weight: 800; color: #374151; margin: 0 0 8px; }
.twt-ecat-empty p    { font-size: .85rem; margin: 0 0 16px; }
.twt-ecat-back-link  { font-size: .85rem; color: #6366f1; font-weight: 600; text-decoration: none; }
.twt-ecat-back-link:hover { text-decoration: underline; }
