/* ============================================================
   docs-base.css — KubeGraf Docs Shared Base Styles
   Loaded AFTER each page's inline <style> block so these
   rules win by document order for same-specificity selectors.
   Theme-specific variables + sidebar/footer overrides live in
   theme-styles.css (loaded first, uses !important where needed).
   ============================================================ */

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

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* ── Base links ─────────────────────────────────────────────── */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Floating orbs background ───────────────────────────────── */
.floating-orbs {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--primary); top: -150px; right: -100px; }
.orb-2 { width: 350px; height: 350px; background: var(--primary); bottom: 30%; left: 200px; animation-delay: -5s; }
.orb-3 { width: 400px; height: 400px; background: var(--primary); top: 60%; right: -100px; animation-delay: -10s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%       { transform: translate(20px, -20px) scale(1.03); }
  50%       { transform: translate(-15px, 15px) scale(0.97); }
  75%       { transform: translate(15px, 20px) scale(1.01); }
}

/* ── Hero section ───────────────────────────────────────────── */
.docs-hero {
  position: relative;
  padding: 2.5rem 0 1.75rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.docs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6,182,212,0.13), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%,  rgba(6,182,212,0.07), transparent);
  pointer-events: none;
}
.docs-hero .grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6,182,212,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black 0%, transparent 70%);
}
.docs-hero h1 {
  position: relative;
  z-index: 1;
  animation: heroFadeIn 0.7s ease-out both;
}
.docs-hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}
.docs-hero h1::after {
  content: '';
  display: block;
  width: 72px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  margin-top: 0.875rem;
  border-radius: 2px;
  animation: expandLine 0.7s ease-out 0.35s both;
}
.docs-hero .intro {
  position: relative;
  z-index: 1;
  animation: heroFadeIn 0.7s ease-out 0.2s both;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes expandLine {
  from { width: 0; opacity: 0; }
  to   { width: 72px; opacity: 1; }
}

/* ── Page layout ────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.docs-main-wrapper {
  display: block;
  flex: 1;
}

/* ── Sidebar ────────────────────────────────────────────────── */
/* Base sidebar — spacing overrides are in theme-styles.css */
.sidebar {
  width: 280px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem 4rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  top: 0;
}
.sidebar-logo { display: none !important; }

/* Sidebar section heading (dark theme base) */
.sidebar-section h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
/* Sidebar links */
.sidebar-section a {
  display: block;
  padding: 0.375rem 0.625rem;
  color: var(--text-muted);
  border-radius: 5px;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.sidebar-section a:hover {
  background: var(--bg-tertiary);
  color: var(--text);
  text-decoration: none;
}
.sidebar-section a.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--primary);
  font-weight: 600;
  border-left: 2px solid var(--primary);
  padding-left: calc(0.625rem - 2px);
}
.sidebar-section ul { list-style: none; }
.sidebar-section li { margin: 0; }

/* ── Navbar ─────────────────────────────────────────────────── */
.docs-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}
.docs-navbar-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.docs-navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}
.docs-navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.docs-navbar-links a {
  padding: 0.4rem 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.docs-navbar-links a:hover {
  color: var(--text);
  background: var(--bg-tertiary);
  text-decoration: none;
}
.docs-navbar-links a.active { color: var(--primary); }

/* ── Main content area ──────────────────────────────────────── */
.docs-content {
  flex: 1;
  margin-left: 280px;
  padding: 2.5rem 3.5rem 3rem 3rem;
  max-width: 860px;       /* optimal prose reading width */
  position: relative;
  z-index: 1;
}

/* ── Typography ─────────────────────────────────────────────── */
.docs-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.docs-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text);
  line-height: 1.3;
}
.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}
.docs-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.375rem;
  color: var(--text);
}
.docs-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}
.docs-content ul,
.docs-content ol {
  color: var(--text-muted);
  margin: 0.75rem 0 1rem 1.5rem;
}
.docs-content li { margin-bottom: 0.4rem; line-height: 1.65; }
.docs-content strong { color: var(--text); }

/* ── Code ───────────────────────────────────────────────────── */
.docs-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
  background: var(--bg-tertiary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--primary);
  border: 1px solid var(--border);
  word-break: break-word;
}
.docs-content pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.125rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  -webkit-overflow-scrolling: touch;
}
.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.875rem;
  white-space: pre;
  display: inline-block;
  min-width: 100%;
  word-break: normal;
}
kbd {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0 0.1rem;
  color: var(--text);
}

/* ── Intro text ─────────────────────────────────────────────── */
.intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.75;
}

/* ── Callout / Note / Tip boxes ─────────────────────────────── */
.callout,
.note {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem 1.125rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.callout strong, .note strong { color: var(--text); }

.tip {
  background: rgba(6, 182, 212, 0.07);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 0.875rem 1.125rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.tip p { margin: 0; color: var(--text-muted); }
.tip strong { color: var(--text); }

.warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 0.875rem 1.125rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.warning strong { color: var(--text); }

/* ── Step layout (quickstart, workflows) ────────────────────── */
.step {
  display: flex;
  gap: 1.25rem;
  margin: 2rem 0;
  align-items: flex-start;
}
.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.step-content { flex: 1; }
.step-content h3 { margin: 0 0 0.5rem; color: var(--text); }

/* ── Feature cards / two-col grid ──────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.75rem 0;
}
.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
}
.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.feature-card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.feature-icon { width: 22px; height: 22px; color: var(--primary); }

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: rgba(6, 182, 212, 0.12);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-small {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  background: rgba(6, 182, 212, 0.12);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ── Install method cards ───────────────────────────────────── */
.install-method {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.375rem 1.5rem;
  margin: 1.5rem 0;
  transition: border-color 0.2s;
}
.install-method:hover { border-color: rgba(6, 182, 212, 0.35); }
.install-method h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.875rem;
  color: var(--text);
  font-size: 1.05rem;
}
.install-method p { margin-bottom: 0.75rem; }

/* ── Keybind table ──────────────────────────────────────────── */
.keybind-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}
.keybind-table th,
.keybind-table td {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.keybind-table th {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.keybind-table td { color: var(--text-muted); }
.keybind-table tr:last-child td { border-bottom: none; }

/* ── Docs card grid (overview page) ────────────────────────── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.docs-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.375rem;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
}
.docs-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
  text-decoration: none;
}
.docs-card h3 { color: var(--text); font-size: 1rem; margin: 0 0 0.375rem; }
.docs-card p  { color: var(--text-muted); font-size: 0.875rem; margin: 0; }
.docs-card .icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

/* ── Page navigation buttons ────────────────────────────────── */
.docs-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}
.docs-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  font-size: 0.875rem;
}
.docs-nav-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  transform: translateY(-2px);
  text-decoration: none;
}
.docs-nav-btn-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.1rem;
}
.docs-nav-btn-title { font-weight: 600; display: block; }

/* ── Mobile menu button & overlay ───────────────────────────── */
.mobile-menu-btn,
.mobile-home-btn {
  display: none;
  position: fixed;
  top: 1rem;
  z-index: 1001;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  color: var(--text);
  cursor: pointer;
  font-size: 1.375rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.mobile-menu-btn { left: 1rem; }
.mobile-home-btn  { left: 4.25rem; }
.mobile-menu-btn:hover,
.mobile-home-btn:hover  { background: var(--bg-tertiary); transform: scale(1.05); text-decoration: none; }

.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.mobile-sidebar-overlay.active { display: block; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mobile-menu-btn,
  .mobile-home-btn { display: flex; }

  .sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 0;
    z-index: 1000;
    transition: left 0.28s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.25);
  }
  .sidebar.mobile-open { left: 0 !important; }

  .docs-content {
    margin-left: 0 !important;
    padding: 1.5rem 1.25rem 2rem !important;
    padding-top: 5rem !important;
    max-width: 100% !important;
  }

  .docs-navbar-links { display: none; }
  .two-col { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
  .docs-content { padding: 1.25rem 1rem 2rem !important; padding-top: 5rem !important; }
  .docs-page-nav { flex-direction: column; }
  .docs-nav-btn  { width: 100%; justify-content: center; }
  .docs-grid { grid-template-columns: 1fr !important; }
}

@media (min-width: 768px) and (max-width: 900px) {
  .docs-content { margin-left: 0; }
}
