/* === CSS Custom Properties === */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface2:     #1c2128;
  --border:       #30363d;
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --accent:       #2f81f7;
  --accent-hover: #388bfd;
  --success:      #3fb950;
  --danger:       #f85149;
  --warning:      #d29922;
  --code-bg:      #1a1f29;

  --radius:       6px;
  --radius-sm:    4px;
  --font-mono:    'Consolas', 'Monaco', 'Cascadia Code', monospace;
  --font-sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-height:   56px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

img { max-width: 100%; display: block; }

ul, ol { padding-left: 1.5rem; }

/* === Layout === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.container-sm {
  max-width: 760px;
}

.main-content {
  flex: 1;
}

/* === Navbar === */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand:hover { color: var(--accent); text-decoration: none; }

.version-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--text); text-decoration: none; }

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
}

.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* === Language selector === */
.lang-select {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  margin-left: 0.25rem;
}

.lang-select:hover { border-color: var(--text-muted); color: var(--text); }
.lang-select option { background: var(--surface); color: var(--text); }

/* === Footer === */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* === Page Header === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* === Search === */
.search-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-form-full {
  margin-bottom: 1.5rem;
}

.search-form-full .form-control {
  flex: 1;
}

.search-results-info {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* === Typography === */
h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }
h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }

p { margin-bottom: 0.75rem; }

.text-muted { color: var(--text-muted); }
.required { color: var(--danger); }
.separator { color: var(--text-muted); margin: 0 0.25rem; }

/* === Empty state === */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert-danger {
  background: rgba(248, 81, 73, 0.1);
  border-color: rgba(248, 81, 73, 0.4);
  color: #ffa198;
}

.alert-success {
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.4);
  color: #56d364;
}

/* === Pagination === */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

/* === Mobile === */
@media (max-width: 600px) {
  .navbar-toggle { display: flex; }

  .navbar-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .navbar-menu.open { display: flex; }

  .navbar-inner { position: relative; }

  .nav-link { display: block; padding: 0.6rem 0.8rem; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .search-form { width: 100%; }
}
