@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --t: all 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
img { max-width: 100%; }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(79, 70, 229, 0.45);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Courier New', monospace;
  border: 1px solid rgba(255,255,255,0.28);
  letter-spacing: -1px;
  flex-shrink: 0;
}

.logo-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.site-nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--t);
  white-space: nowrap;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.nav-cta {
  background: rgba(255,255,255,0.18) !important;
  border: 1px solid rgba(255,255,255,0.38) !important;
  color: #fff !important;
  margin-left: 0.375rem;
}

.nav-cta:hover {
  background: rgba(255,255,255,0.28) !important;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
  padding: 3.5rem 1.5rem 4.5rem;
  text-align: center;
}

.hero-inner { max-width: 660px; margin: 0 auto; }

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.22;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.72);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.hero-stat span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  margin-top: 0.2rem;
  display: block;
}

/* ===== SEARCH ===== */
.search-form {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  border: 2px solid rgba(255,255,255,0.25);
}

.search-form input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  background: transparent;
  min-width: 0;
}

.search-form input[type="text"]::placeholder { color: var(--text-muted); }

.search-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.9rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  font-family: inherit;
  white-space: nowrap;
  border-radius: 0 50px 50px 0;
}

.search-form button:hover { background: var(--primary-dark); }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== MAIN ===== */
.main { padding: 2.5rem 0; }

/* ===== SECTION ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: var(--primary-100); color: var(--primary); }
.badge-muted { background: var(--border); color: var(--text-muted); }

/* ===== CATEGORY GRID ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.6rem;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--t);
  box-shadow: var(--shadow-sm);
}

.cat-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--primary);
}

.cat-card.empty { opacity: 0.45; pointer-events: none; }

.cat-emoji {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.cat-card.empty .cat-emoji { background: #f1f5f9; }

.cat-body { min-width: 0; flex: 1; }

.cat-name {
  font-size: 0.845rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; font-size: 0.7rem; }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, #312e81, #4f46e5);
  padding: 2.25rem 1.5rem;
}

.page-hero .container {}

.page-hero h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.page-hero p { color: rgba(255,255,255,0.72); font-size: 0.95rem; }

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

/* ===== FORM ===== */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.form-label .req { color: #ef4444; margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: var(--t);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

textarea.form-control { resize: vertical; min-height: 110px; line-height: 1.6; }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--t);
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
}

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }

.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ===== ALERT ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-bottom: 1.25rem;
}

.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; max-width: 360px; margin: 0 auto 1.5rem; line-height: 1.6; }

/* ===== FOOTER ===== */
.site-footer {
  background: #0f172a;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.875rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer-brand .site-logo { text-decoration: none; }
.footer-brand .logo-name { color: #fff; }
.footer-brand .logo-sub { color: rgba(255,255,255,0.45); }

.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.875rem;
}

.footer-col a {
  display: block;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: var(--t);
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.79rem;
  color: rgba(255,255,255,0.32);
}

.footer-bottom a { color: rgba(255,255,255,0.48); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ===== NETWORK BAR ===== */
.network-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 2rem;
}

.network-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.625rem;
}

.network-bar-links { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.network-bar-links a {
  font-size: 0.775rem;
  color: var(--primary);
  text-decoration: none;
  padding: 0.2rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: var(--t);
  font-weight: 500;
}

.network-bar-links a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== LINKS PAGE ===== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--t);
}

.link-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.link-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; }
.link-card h3 a { color: var(--primary); text-decoration: none; }
.link-card h3 a:hover { text-decoration: underline; }
.link-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; }

/* ===== CONTACT ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; align-items: start; }
.contact-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.contact-info p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 1.5rem; }

/* ===== ABOUT ===== */
.about-content h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.about-content p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 1.25rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2rem 0; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-card strong { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 0.4rem; }
.stat-card span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ===== CATEGORY DETAIL ===== */
.cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.cat-toolbar-search { display: flex; gap: 0.5rem; flex: 1; max-width: 340px; }

.cat-toolbar-search input {
  flex: 1;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  color: var(--text);
  background: var(--bg);
  transition: var(--t);
}

.cat-toolbar-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

.cat-toolbar-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

/* ===== SEARCH RESULTS ===== */
.search-hero {
  background: linear-gradient(135deg, #312e81, #4f46e5);
  padding: 2rem 1.5rem;
}

.search-hero-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.search-hero h1 { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-hero h1 { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .site-nav .nav-hide { display: none; }
  .header-inner { height: 56px; }
  .hero { padding: 2rem 1rem 2.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
}

@media (max-width: 400px) {
  .category-grid { grid-template-columns: 1fr; }
}
