/* ==========================================================================
   SolveKits.com - Modern High-Performance Stylesheet
   Optimized for Core Web Vitals, Fast Loading, and AdSense Placement
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0ea5e9;
  --accent-green: #10b981;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-card: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

pre,
code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.inline-svg {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  flex-shrink: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  transition: all 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
}

.logo-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .header-inner nav {
    width: 100%;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--border-light);
    gap: 0.25rem;
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-links li,
  .nav-links a {
    display: block;
    width: 100%;
  }
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border-light);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Search Box Component */
.search-wrapper {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s ease;
}

.search-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.search-input-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  color: var(--text-main);
  background: transparent;
  padding: 0.5rem;
}

.search-input-box button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s ease;
}

.search-input-box button:hover {
  background: var(--primary-hover);
}

/* Search Results Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  text-align: left;
}

.search-dropdown.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s ease;
}

.search-result-item:hover,
.search-result-item:focus {
  background: var(--primary-light);
}

.search-result-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: #dbeafe;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.search-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.search-result-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Category Pills Bar */
.category-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.cat-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  transition: all 0.15s ease;
}

.cat-pill:hover,
.cat-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Category Grid Cards */
.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

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

.cat-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.cat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--primary-light);
  color: var(--primary);
}

.cat-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.cat-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.cat-card-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Error Fix Card Listing */
.fixes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.fix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.fix-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.fix-code-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: #eff6ff;
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
}

.fix-difficulty {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.fix-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.fix-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.fix-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
}

.btn-read-fix {
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   Single Fix Article Page Styles
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.article-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1.5rem;
}

.article-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-code {
  background: #1e293b;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.badge-cat {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-time {
  background: #f0fdf4;
  color: var(--accent-green);
}

.article-title {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.article-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.callout-box {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem;
  margin: 1.75rem 0;
}

.callout-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.callout-box ul {
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Fix Steps Timeline */
.step-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-body p {
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.code-snippet {
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  position: relative;
  overflow-x: auto;
  margin: 0.85rem 0;
}

.btn-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #334155;
  color: #cbd5e1;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-copy:hover {
  background: #475569;
  color: #fff;
}

/* FAQ Section */
.faq-block {
  margin: 2.5rem 0;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  padding: 1.15rem;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.faq-answer {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Warning Callouts & Utility States */
.callout-warning {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: #78350f;
  font-size: 0.94rem;
}

.callout-warning strong {
  color: #92400e;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-copy.is-copied {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-list li a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  line-height: 1.4;
}

.sidebar-list li a:hover {
  color: var(--primary);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

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

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

.footer-logo {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.footer-text {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 340px;
}

.footer-col h5 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: #94a3b8;
  font-size: 0.85rem;
}

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

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}