/* =========================================================
   ZabiTech Community – Global Stylesheet
   Shared across ALL pages: reset, tokens, header, buttons,
   footer, cards, forms, and page-specific blocks.
   ========================================================= */

/* =========================
   DESIGN TOKENS
========================= */
:root {
  --primary:        #0078d4;
  --primary-dark:   #005fa3;
  --primary-soft:   rgba(0, 120, 212, .12);

  --bg:             #f5f7fa;
  --white:          #ffffff;
  --text:           #1f2937;
  --text-2:         #334155;
  --muted:          #6b7280;
  --muted-2:        #94a3b8;
  --border:         #e5e7eb;
  --border-2:       #cbd5e1;

  --radius:         10px;
  --radius-lg:      14px;
  --shadow:         0 6px 18px rgba(0, 0, 0, .08);
  --shadow-lg:      0 12px 32px rgba(15, 23, 42, .12);

  --header-height:  70px;
  --font:           "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: var(--header-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================
   SKIP LINK
========================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: #000;
  color: #fff;
  border-radius: 8px;
  z-index: 2000;
}

/* =========================
   HEADER
========================= */
.blue-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  display: flex;
  align-items: center;
}

.blue-header .container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.logo {
  color: var(--white);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.logo span span { font-weight: 400; opacity: .9; }

.blue-header nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.blue-header nav a {
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: .95rem;
  opacity: .92;
  transition: background .18s ease, opacity .18s ease;
}
.blue-header nav a:hover,
.blue-header nav a:focus-visible {
  background: rgba(255, 255, 255, .16);
  opacity: 1;
}
.blue-header nav a.active,
.blue-header nav a[aria-current="page"] {
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  opacity: 1;
}

/* =========================
   BUTTONS
========================= */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, transform .06s ease, box-shadow .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 120, 212, .2);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--white);
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-secondary:hover {
  background: var(--primary-soft);
}

/* =========================
   SECTION HEADINGS
========================= */
section { padding: 50px 20px; }

.section-title,
.topics-section h2,
.articles-section h2,
.faq-section h2,
.join h2,
.about-home h2 {
  text-align: center;
  margin: 0 auto 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -.01em;
}

.section-sub,
.topics-section > .section-inner > p,
.articles-section > .section-inner > p,
.faq-section > .section-inner > p {
  text-align: center;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 30px;
}

/* =========================
   GENERIC GRIDS
========================= */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.articles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* =========================
   GENERIC CARDS
========================= */
.topic-card,
.article,
.faq-card,
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1),
              box-shadow .25s ease,
              border-color .25s ease;
  text-align: left;
}

.topic-card:hover,
.faq-card:hover,
.article:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0, 120, 212, .12);
}

/* Generic white card (used in dashboard/other pages) */
.card {
  padding: 18px 20px;
  margin-bottom: 15px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

/* =========================
   FORMS
========================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.55;
  font-family: inherit;
}

/* =========================
   DASHBOARD (shared skeleton)
========================= */
.dashboard-page {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  background: var(--bg);
}

.sidebar {
  width: 240px;
  background: var(--primary);
  color: var(--white);
  padding: 20px;
}

.dashboard-main {
  flex: 1;
  padding: 30px;
  background: var(--white);
}

/* =========================
   CONTACT PAGE
========================= */
.contact-page {
  padding: 60px 20px;
  max-width: 1100px;
  margin: auto;
}
.contact-hero {
  text-align: center;
  margin-bottom: 48px;
}
.contact-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 12px;
  font-weight: 700;
}
.contact-hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 16px;
}
.contact-badge {
  display: inline-block;
  background: #e6f3ff;
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid rgba(0, 120, 212, .15);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.contact-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e6f3ff, #f0f7ff);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
}
.contact-card h2 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}
.contact-card a {
  color: var(--primary);
  font-weight: 600;
}
.contact-card a:hover { text-decoration: underline; }
.contact-note {
  margin-top: 12px;
  font-size: .85rem;
  color: var(--muted);
  background: #f9fafb;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

/* =========================
   POLICY / TERMS PAGES
========================= */
.policy-page,
.terms-page {
  padding: 60px 20px 50px;
  max-width: 900px;
  margin: auto;
}
.policy-hero,
.terms-hero {
  text-align: center;
  margin-bottom: 40px;
}
.policy-hero h1,
.terms-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.2rem);
  margin-bottom: 10px;
}
.policy-hero p,
.terms-hero p { color: var(--muted); }

.policy-content h2,
.terms-content h2 {
  margin-top: 25px;
  color: var(--primary);
  font-size: 1.2rem;
}
.policy-content p,
.terms-content p {
  margin-top: 8px;
  line-height: 1.7;
  color: var(--text);
}

/* =========================
   FOOTER (single canonical version)
========================= */
.site-footer {
  background: var(--white);
  color: var(--text-2);
  border-top: 1px solid var(--border);
  padding: 30px 20px;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.5;
}
.site-footer strong { color: var(--text-2); }

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--primary);
  font-size: .88rem;
  font-weight: 500;
  transition: color .2s ease;
}
.footer-links a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* =========================
   SKELETON LOADERS (generic)
========================= */
.skeleton-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 190px;
  pointer-events: none;
}

.skeleton-card .line {
  height: 14px;
  border-radius: 6px;
  margin: 12px 0;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-card .line.title {
  width: 65%;
  height: 20px;
  background: linear-gradient(90deg, #cfe2fb 25%, #e1edfd 50%, #cfe2fb 75%);
  background-size: 200% 100%;
}
.skeleton-card .line.meta  { width: 35%; height: 12px; }
.skeleton-card .line.short { width: 85%; }

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* =========================
   INLINE CODE (base – readable on every page)
   Light chip with dark text. Code inside <pre> is excluded
   so code blocks keep their own dark theme.
========================= */
:not(pre) > code {
  background: #eef1f5;
  color: #1a1a1a;
  border: 1px solid #d8dee6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* =========================
   RESPONSIVE — TABLET (≤900px)
========================= */
@media (max-width: 900px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* =========================
   RESPONSIVE — MOBILE (≤768px)
========================= */
@media (max-width: 768px) {
  :root { --header-height: 110px; }

  .blue-header { height: auto; padding: 12px 0; }

  .blue-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 0 16px;
  }

  .blue-header nav {
    width: 100%;
    gap: 2px;
  }
  .blue-header nav a {
    padding: 6px 9px;
    font-size: .88rem;
  }

  .dashboard-page { flex-direction: column; }
  .sidebar { width: 100%; }

  section { padding: 40px 16px; }

  .contact-page,
  .policy-page,
  .terms-page { padding: 40px 16px; }
}

/* =========================
   RESPONSIVE — SMALL (≤390px)
========================= */
@media (max-width: 390px) {
  .blue-header nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* =========================
   REDUCED MOTION
========================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================
   MOBILE NAVIGATION (Slidebar)
========================= */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #ffffff;
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .blue-header nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    gap: 15px;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .blue-header nav.active {
    right: 0;
  }

  .blue-header nav a {
    color: #ffffff;
    font-size: 16px;
    padding: 12px 15px;
    border-radius: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: left;
  }

  .blue-header nav a:hover,
  .blue-header nav a.active {
    background: rgba(255, 255, 255, 0.15);
  }

  .mobile-menu-btn {
    display: block;
  }
}
/* ============================================================
   Sponsored Post — Badge & Pill
============================================================ */
.sponsored-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #f59e0b;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-bottom-left-radius: 8px;
  border-top-right-radius: 8px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.pill-sponsored {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #f59e0b;
  font-weight: 700;
}

.btn-sponsor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: #d97706;
  border: 1px solid #f59e0b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-right: 8px;
}

.btn-sponsor:hover {
  background: #fef3c7;
}

.btn-sponsor:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.article-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}