/* =============================================
   zSmartFix — Global Design System
   Fix, Setup & Optimize Your Tech
   (Day Mode Default + Dark Mode Support)
   ============================================= */

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

/* ── CSS Variables — Day Mode (Light Default) ── */
:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --accent: #0284C7;
  --accent-dark: #0369A1;
  --bg: #F8FAFC;
  --bg-2: #FFFFFF;
  --bg-3: #F1F5F9;
  --card-bg: #FFFFFF;
  --card-border: #E2E8F0;
  --glass: rgba(79, 70, 229, 0.05);
  --glass-border: rgba(79, 70, 229, 0.15);
  --text: #0F172A;
  --text-muted: #475569;
  --text-faint: #94A3B8;
  --gradient: linear-gradient(135deg, #4F46E5 0%, #0284C7 100%);
  --gradient-soft: linear-gradient(135deg, rgba(79,70,229,0.06) 0%, rgba(2,132,199,0.06) 100%);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 35px rgba(15, 23, 42, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 70px;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --nav-scrolled: rgba(255, 255, 255, 0.98);
  --code-bg: #0F172A;
  --code-color: #38BDF8;
}

/* ── Dark Mode Class ────────────────────────── */
body.dark-theme {
  --primary: #6C63FF;
  --primary-dark: #5549e8;
  --accent: #00D4FF;
  --accent-dark: #00a8cc;
  --bg: #0A0A0F;
  --bg-2: #0F0F1A;
  --bg-3: #13131F;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --glass: rgba(108, 99, 255, 0.08);
  --glass-border: rgba(108, 99, 255, 0.2);
  --text: #E8E8F0;
  --text-muted: #8888A8;
  --text-faint: #555570;
  --gradient: linear-gradient(135deg, #6C63FF 0%, #00D4FF 100%);
  --gradient-soft: linear-gradient(135deg, rgba(108,99,255,0.15) 0%, rgba(0,212,255,0.15) 100%);
  --shadow: 0 8px 32px rgba(108, 99, 255, 0.12);
  --shadow-lg: 0 20px 60px rgba(108, 99, 255, 0.2);
  --nav-bg: rgba(10, 10, 15, 0.85);
  --nav-scrolled: rgba(10, 10, 15, 0.98);
  --code-bg: #0D0D17;
  --code-color: #A8E6CF;
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Background Orbs ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(79,70,229,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}
body::after {
  content: '';
  position: fixed;
  bottom: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(2,132,199,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 25s ease-in-out infinite reverse;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── Typography ────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; color: var(--text-muted); }
img { max-width: 100%; height: auto; display: block; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
  transition: var(--transition);
}
.navbar.scrolled { background: var(--nav-scrolled); box-shadow: var(--shadow); }
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800;
  color: var(--text); text-decoration: none;
}
.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0; color: #fff;
}
.nav-links, .nav-links ul, .nav-links li, ul.sub-menu, ul.sub-menu li {
  list-style: none !important;
  list-style-type: none !important;
  padding: 0;
  margin: 0;
}
.nav-links { display: flex; align-items: center; gap: 0.3rem; }
.nav-links > li { position: relative; display: inline-flex; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; padding: 0.55rem 1rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: var(--transition); text-decoration: none; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active, .nav-links li:hover > a { color: var(--primary); background: var(--glass); }
.nav-links .menu-item-has-children > a::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: 0.45rem; font-size: 0.75rem; transition: transform 0.2s ease; }
.nav-links .menu-item-has-children:hover > a::after { transform: rotate(180deg); color: var(--primary); }

/* Dropdown Sub-Menu Styling */
.nav-links ul.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--nav-scrolled);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: all 0.2s ease-in-out;
  z-index: 1100;
}
/* Invisible hover bridge to prevent menu closing when moving cursor */
.nav-links ul.sub-menu::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
  background: transparent;
}
.nav-links li:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-links ul.sub-menu li {
  display: block;
  width: 100%;
  margin: 0;
}
.nav-links ul.sub-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}
.nav-links ul.sub-menu a:hover {
  color: var(--primary);
  background: var(--glass);
  transform: translateX(4px);
}

.nav-cta { background: var(--gradient) !important; color: #fff !important; padding: 0.5rem 1.2rem !important; border-radius: 8px; font-weight: 600 !important; }
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

.theme-toggle-btn {
  background: var(--card-bg); border: 1px solid var(--card-border);
  color: var(--text); width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); font-size: 1rem;
}
.theme-toggle-btn:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.05); }

.nav-hamburger {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.4rem; cursor: pointer; padding: 0.4rem; border-radius: 8px; transition: var(--transition);
}
.nav-hamburger:hover { background: var(--card-bg); }

/* ── Layout ────────────────────────────────── */
.page-wrapper { position: relative; z-index: 1; padding-top: var(--nav-height); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--primary); background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2); padding: 0.4rem 1rem; border-radius: 100px; margin-bottom: 1rem;
}
.section-title { margin-bottom: 0.8rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.05rem; max-width: 600px; }

/* ── Cards ─────────────────────────────────── */
.card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 1.8rem; transition: var(--transition);
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.card:hover { border-color: rgba(79, 70, 229, 0.3); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card::before { content: ''; position: absolute; inset: 0; background: var(--gradient-soft); opacity: 0; transition: var(--transition); border-radius: inherit; }
.card:hover::before { opacity: 1; }

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.8rem; border-radius: 10px; font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  text-decoration: none; border: none; white-space: nowrap;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(79, 70, 229, 0.4); color: #fff; }
.btn-outline { background: var(--card-bg); color: var(--text); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--glass); }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* ── Badge ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.75rem;
  border-radius: 100px; white-space: nowrap;
}
.badge-primary { background: rgba(79,70,229,0.1); color: var(--primary); border: 1px solid rgba(79,70,229,0.2); }
.badge-accent { background: rgba(2,132,199,0.1); color: var(--accent); border: 1px solid rgba(2,132,199,0.2); }
.badge-green { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-orange { background: rgba(245,158,11,0.1); color: #D97706; border: 1px solid rgba(245,158,11,0.2); }

/* ── Article Card ──────────────────────────── */
.article-card {
  display: grid; grid-template-columns: 1fr;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.article-card:hover { border-color: rgba(79, 70, 229, 0.3); transform: translateY(-5px); box-shadow: var(--shadow-lg); color: var(--text); }
.article-card-thumb {
  height: 190px; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; border-bottom: 1px solid var(--card-border); position: relative; overflow: hidden;
}
.article-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; display: block;
}
.article-card:hover .article-card-thumb img { transform: scale(1.06); }
.article-card-thumb::after { content: ''; position: absolute; inset: 0; background: var(--gradient); opacity: 0.05; pointer-events: none; }
.article-card-body { padding: 1.5rem; }
.article-card-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.article-card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--text); line-height: 1.4; transition: var(--transition); }
.article-card:hover .article-card-title { color: var(--primary); }
.article-card-excerpt { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--card-border); font-size: 0.8rem; color: var(--text-faint); }
.read-more { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--primary); font-weight: 600; font-size: 0.85rem; transition: var(--transition); }
.read-more:hover { gap: 0.7rem; color: var(--accent); }

/* ── Blog Grid ─────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

/* ── Hero ──────────────────────────────────── */
.hero { padding: 6rem 0 5rem; text-align: center; position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); margin-bottom: 1.5rem; animation: fadeInUp 0.6s ease forwards; background: var(--glass); padding: 0.4rem 1rem; border-radius: 100px; border: 1px solid var(--glass-border); }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.15; margin-bottom: 1.5rem; animation: fadeInUp 0.7s ease 0.1s both; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 580px; margin: 0 auto 2.5rem; animation: fadeInUp 0.7s ease 0.2s both; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; animation: fadeInUp 0.7s ease 0.3s both; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 3rem; margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--card-border); animation: fadeInUp 0.7s ease 0.4s both; flex-wrap: wrap; }
.hero-stat-num { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ── Category Pills ────────────────────────── */
.category-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.category-pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.1rem; border-radius: 100px; font-size: 0.85rem; font-weight: 500; background: var(--card-bg); border: 1px solid var(--card-border); color: var(--text-muted); cursor: pointer; transition: var(--transition); text-decoration: none; box-shadow: var(--shadow); }
.category-pill:hover, .category-pill.active { background: var(--glass); border-color: var(--primary); color: var(--primary); }

/* ── CTA Banner ────────────────────────────── */
.cta-banner { background: var(--gradient-soft); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); padding: 3.5rem; text-align: center; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.cta-banner::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(79,70,229,0.04) 0%, transparent 60%); pointer-events: none; }

/* ── Footer ────────────────────────────────── */
.footer { background: var(--bg-3); border-top: 1px solid var(--card-border); padding: 4rem 0 2rem; position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { font-size: 0.9rem; color: var(--text-muted); margin-top: 1rem; line-height: 1.7; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col ul li a { font-size: 0.9rem; color: var(--text-muted); transition: var(--transition); }
.footer-col ul li a:hover { color: var(--primary); padding-left: 4px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 2rem; border-top: 1px solid var(--card-border); font-size: 0.85rem; color: var(--text-faint); flex-wrap: wrap; gap: 1rem; }
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { color: var(--text-faint); font-size: 0.85rem; }
.footer-bottom-links a:hover { color: var(--primary); }

/* ── Article Page ──────────────────────────── */
.article-header { padding: 4rem 0 3rem; text-align: center; }
.article-meta { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.article-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 1.5rem; }
.article-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 680px; margin: 0 auto 2rem; }
.article-info-bar { display: flex; align-items: center; justify-content: center; gap: 2rem; font-size: 0.875rem; color: var(--text-muted); flex-wrap: wrap; }
.article-info-bar span { display: flex; align-items: center; gap: 0.4rem; }

/* ── Reading Progress ──────────────────────── */
#reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--gradient); width: 0%; z-index: 9999; transition: width 0.1s linear; border-radius: 0 2px 2px 0; }

/* ── Article Banner Image ──────────────────── */
.article-hero-image { max-width: 800px; margin: 0 auto 2.5rem; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--card-border); }
.article-banner-img { width: 100%; max-height: 420px; object-fit: cover; display: block; }

/* ── Article Content ───────────────────────── */
.article-content { max-width: 780px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.article-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--text); position: relative; padding-left: 1rem; }
.article-content h2::before { content: ''; position: absolute; left: 0; top: 0.2em; width: 4px; height: 1.2em; background: var(--gradient); border-radius: 2px; }
.article-content h3 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--text); }
.article-content p { color: var(--text-muted); margin-bottom: 1.2rem; font-size: 1.02rem; line-height: 1.8; }
.article-content ul, .article-content ol { margin-bottom: 1.5rem; padding-left: 1.8rem; }
.article-content li { color: var(--text-muted); margin-bottom: 0.6rem; font-size: 1rem; line-height: 1.7; }
.article-content strong { color: var(--text); font-weight: 600; }

/* ── Step Box ──────────────────────────────── */
.step-box { display: flex; gap: 1rem; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-bottom: 1rem; transition: var(--transition); box-shadow: var(--shadow); }
.step-box:hover { border-color: rgba(79,70,229,0.3); }
.step-num { width: 32px; height: 32px; background: var(--gradient); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0; margin-top: 2px; }
.step-content h4 { color: var(--text); margin-bottom: 0.3rem; }
.step-content p { margin: 0; font-size: 0.9rem; }

/* ── Tip / Warning Box ─────────────────────── */
.tip-box { background: rgba(2, 132, 199, 0.05); border: 1px solid rgba(2, 132, 199, 0.15); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin: 1.5rem 0; }
.tip-box.warning { background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.15); border-left-color: #D97706; }
.tip-box-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.5rem; }
.tip-box.warning .tip-box-label { color: #D97706; }
.tip-box p { margin: 0; font-size: 0.92rem; }

/* ── Code Block ────────────────────────────── */
.code-block { background: var(--code-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin: 1.2rem 0; font-family: 'Courier New', monospace; font-size: 0.9rem; color: var(--code-color); overflow-x: auto; line-height: 1.7; position: relative; box-shadow: var(--shadow); }
.code-block::before { content: '●●●'; position: absolute; top: 0.75rem; left: 1rem; color: var(--text-faint); font-size: 0.65rem; letter-spacing: 0.3em; }
.code-block code { padding-top: 1.2rem; display: block; }

/* ── TOC ───────────────────────────────────── */
.toc { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.toc-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 0.75rem; }
.toc ol { padding-left: 1.3rem; margin: 0; }
.toc li { margin-bottom: 0.4rem; }
.toc a { font-size: 0.9rem; color: var(--text-muted); }
.toc a:hover { color: var(--primary); }

/* ── Breadcrumb ────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-faint); margin-bottom: 2rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--text-muted); }

/* ── Search Bar ────────────────────────────── */
.search-bar { display: flex; align-items: center; gap: 0.75rem; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 0.75rem 1.2rem; max-width: 500px; transition: var(--transition); box-shadow: var(--shadow); }
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.search-bar input { flex: 1; background: none; border: none; outline: none; font-family: var(--font-body); font-size: 0.95rem; color: var(--text); }
.search-bar input::placeholder { color: var(--text-faint); }
.search-bar i { color: var(--text-faint); }

/* ── Sidebar ───────────────────────────────── */
.page-with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: start; }
.sidebar-widget { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.sidebar-widget-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--card-border); }
.sidebar-link { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--card-border); text-decoration: none; transition: var(--transition); }
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link-num { font-size: 0.75rem; font-weight: 700; color: var(--primary); min-width: 20px; padding-top: 2px; }
.sidebar-link-title { font-size: 0.875rem; color: var(--text-muted); line-height: 1.4; transition: var(--transition); }
.sidebar-link:hover .sidebar-link-title { color: var(--primary); }

/* ── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; }
.form-control { width: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; padding: 0.75rem 1.1rem; font-family: var(--font-body); font-size: 0.95rem; color: var(--text); transition: var(--transition); outline: none; box-shadow: var(--shadow); }
.form-control::placeholder { color: var(--text-faint); }
.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: 120px; }

/* ── Back to Top ───────────────────────────── */
#back-to-top { position: fixed; bottom: 2rem; right: 2rem; width: 44px; height: 44px; background: var(--gradient); border: none; border-radius: 12px; color: #fff; font-size: 1.1rem; cursor: pointer; opacity: 0; pointer-events: none; transition: var(--transition); z-index: 100; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
#back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ── Animations ────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Utilities ─────────────────────────────── */
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--card-border); margin: 2rem 0; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-with-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --nav-height: 60px; }
  .section { padding: 3.5rem 0; }
  .nav-links { display: none; flex-direction: column; position: fixed; top: var(--nav-height); left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--card-border); padding: 1rem 1.5rem 1.5rem; gap: 0.2rem; z-index: 999; }
  .nav-links.open { display: flex; animation: fadeInUp 0.25s ease; }
  .nav-hamburger { display: flex; }
  .nav-cta { display: none; }
  .hero { padding: 4rem 0 3rem; }
  .hero-stats { gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .cta-banner { padding: 2.5rem 1.5rem; }
  .blog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
