:root {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

.global-nav-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}

.global-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(26, 39, 68, 0.08);
  background: #f3f4f6;
  color: #1a2744;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.global-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.global-lang-btn:hover,
.global-theme-btn:hover {
  transform: translateY(-1px);
}

.global-lang-btn:hover {
  background: #e5e7eb;
}

.global-theme-btn:hover {
  background: #f3f4f6;
}

html.dark .global-lang-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5d574;
}

html.dark .global-lang-btn:hover {
  background: #374151;
}

html.dark .global-theme-btn {
  color: #d1d5db;
}

html.dark .global-theme-btn:hover {
  background: #1f2937;
}

.global-theme-btn .theme-icon-sun {
  display: none;
}

html.dark .global-theme-btn .theme-icon-sun {
  display: inline;
  color: #facc15;
}

html.dark .global-theme-btn .theme-icon-moon {
  display: none;
}

/* Dark overrides for theory pages */
html.dark body {
  background: #0f1522 !important;
  color: #e4e7ef !important;
}

html.dark .navbar,
html.dark .page-header,
html.dark header,
html.dark .header-section,
html.dark footer {
  background: #121a2a !important;
}

html.dark .content-wrapper,
html.dark .framework-card,
html.dark .theory-card,
html.dark main,
html.dark .container {
  background: #1a2234 !important;
  color: #e4e7ef !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
}

html.dark p,
html.dark li,
html.dark .card-desc,
html.dark .triad-desc,
html.dark .framework-description,
html.dark .header-desc,
html.dark .page-subtitle {
  color: #cfd7e6 !important;
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark .card-title,
html.dark .theory-title,
html.dark strong {
  color: #f5d574 !important;
}

html.dark blockquote {
  background: #11192a !important;
  color: #dbe4f5 !important;
}

html.dark .page-nav,
html.dark .section-divider {
  border-color: rgba(255, 255, 255, 0.18) !important;
}

@media (max-width: 768px) {
  .global-nav-controls {
    margin-left: 8px;
    gap: 8px;
  }

  .global-theme-btn {
    width: 32px;
    height: 32px;
  }

  .global-lang-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

/* Google Translate widget/banners hidden (translation only) */
#google_translate_element {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame.skiptranslate {
  display: none !important;
}

body {
  top: 0 !important;
}
