/* ============================================================
   Doc-Portal — Components
   ============================================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--amber);
  color: #fff;
  box-shadow: var(--shadow-amber);
}

.btn-primary:hover {
  background: var(--amber-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217,119,6,0.28);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-light);
}

.btn-ghost {
  background: transparent;
  color: var(--amber);
  padding: 11px 18px;
}

.btn-ghost:hover { background: var(--amber-light); }

.btn-sm {
  padding: 7px 14px;
  font-size: var(--text-xs);
}

.btn-indigo {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 4px 16px rgba(76,110,245,0.28);
}

.btn-indigo:hover {
  background: var(--indigo-hover);
  transform: translateY(-1px);
}

.btn-icon {
  padding: 9px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.btn-icon:hover {
  background: var(--bg-card);
  color: var(--text);
}

/* ── Category tiles ── */
.category-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-align: left;
}

.category-tile:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.category-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.category-tile-icon.amber  { background: var(--amber-light); }
.category-tile-icon.teal   { background: var(--teal-light); }
.category-tile-icon.indigo { background: var(--indigo-light); }
.category-tile-icon.slate  { background: var(--bg-subtle); }

.category-tile-label {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text);
}

.category-tile-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════
   NEW PREMIUM CARD
   ══════════════════════════════════════════════════════════ */

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    box-shadow var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
  box-shadow: var(--shadow-card);
  will-change: transform, opacity;
  animation: fadeInUp 0.4s var(--ease) both;
}

/* Top color bar */
.card-top-bar {
  height: 5px;
  width: 100%;
  background: var(--tc, var(--amber));
  flex-shrink: 0;
  transition: height var(--duration) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(var(--tc-rgb, 217,119,6), 0.22);
}

.card:hover .card-top-bar {
  height: 8px;
}

/* Featured card: bolder top bar + very subtle ambient tint */
.card.is-featured .card-top-bar {
  height: 8px;
}

.card.is-featured {
  border-color: rgba(var(--tc-rgb, 217,119,6), 0.2);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px rgba(var(--tc-rgb, 217,119,6), 0.08) inset;
}

.card.is-featured:hover {
  border-color: rgba(var(--tc-rgb, 217,119,6), 0.32);
}

.card.is-featured .featured-star {
  opacity: 1;
  color: var(--amber);
}

/* Card body */
.card-body {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Card head row: type badge left, star right */
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.featured-star {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
  margin-top: 1px;
  filter: drop-shadow(0 1px 2px rgba(217,119,6,0.3));
}

/* Card content */
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 0.9rem;
}

/* Tech chips */
.card-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-bottom: 0.85rem;
}

.tech-chip {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.14rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  transition: border-color var(--duration);
}

.card:hover .tech-chip { border-color: var(--border); }

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  gap: 0.75rem;
}

.card-stats {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.stat-pill {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.stat-pill + .stat-pill::before {
  content: ' · ';
  color: var(--border);
}

/* Live link button */
.card-live {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--amber);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--duration), transform var(--duration);
  border: none;
}

.card-live:hover {
  background: var(--amber-hover);
  transform: translateY(-1px);
}

/* GitHub fallback — muted style vs. amber Live button */
.card-live.card-github {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.card-live.card-github:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

/* Dual link buttons container */
.card-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* GitHub icon button (shown alongside Live) */
.card-link-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
}

.card-link-github:hover {
  border-color: var(--text-secondary);
  color: var(--text);
  background: var(--bg-card);
  transform: translateY(-1px);
}

/* Clickable card title */
.card-title-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration);
}

.card-title-link:hover {
  color: var(--amber);
}

/* Description expand on hover */
.card:hover .card-desc {
  -webkit-line-clamp: 4;
}

/* Stagger animation — covers all 25 cards at 40ms intervals */
.card:nth-child(1)  { animation-delay: 0.04s; }
.card:nth-child(2)  { animation-delay: 0.08s; }
.card:nth-child(3)  { animation-delay: 0.12s; }
.card:nth-child(4)  { animation-delay: 0.16s; }
.card:nth-child(5)  { animation-delay: 0.20s; }
.card:nth-child(6)  { animation-delay: 0.24s; }
.card:nth-child(7)  { animation-delay: 0.28s; }
.card:nth-child(8)  { animation-delay: 0.32s; }
.card:nth-child(9)  { animation-delay: 0.36s; }
.card:nth-child(10) { animation-delay: 0.40s; }
.card:nth-child(11) { animation-delay: 0.44s; }
.card:nth-child(12) { animation-delay: 0.48s; }
.card:nth-child(13) { animation-delay: 0.52s; }
.card:nth-child(14) { animation-delay: 0.56s; }
.card:nth-child(15) { animation-delay: 0.60s; }
.card:nth-child(16) { animation-delay: 0.64s; }
.card:nth-child(17) { animation-delay: 0.68s; }
.card:nth-child(18) { animation-delay: 0.72s; }
.card:nth-child(19) { animation-delay: 0.76s; }
.card:nth-child(20) { animation-delay: 0.80s; }
.card:nth-child(21) { animation-delay: 0.84s; }
.card:nth-child(22) { animation-delay: 0.88s; }
.card:nth-child(23) { animation-delay: 0.92s; }
.card:nth-child(24) { animation-delay: 0.96s; }
.card:nth-child(25) { animation-delay: 1.00s; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-amber   { background: var(--amber-light);  color: var(--amber-hover); border: 1px solid rgba(217,119,6,0.2); }
.badge-teal    { background: var(--teal-light);   color: var(--teal);        border: 1px solid rgba(13,148,136,0.2); }
.badge-indigo  { background: var(--indigo-light); color: var(--indigo);      border: 1px solid rgba(76,110,245,0.2); }
.badge-slate   { background: var(--bg-subtle);    color: var(--text-secondary); border: 1px solid var(--border-light); }
.badge-success { background: var(--success-light);color: var(--success);     border: 1px solid rgba(26,127,55,0.2); }

/* ── Industry badge ── */
.industry-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── Theme toggle ── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  font-size: 16px;
}

.theme-toggle:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-light);
}

/* ── Footer components ── */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--text);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 280px;
}

.footer-col-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--duration) var(--ease);
}

.footer-link:hover { color: var(--amber); }

.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.empty-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.empty-sub { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 1.5rem; }

.empty-reset {
  padding: 0.6rem 1.5rem;
  background: var(--amber);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--duration);
}

.empty-reset:hover { background: var(--amber-hover); }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--sp-6) 0;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Live dot ── */
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
