/* Help window — M3 Expressive styling with dark/light mode */

/* Roboto Flex — variable font, bundled locally */
@font-face {
  font-family: 'Roboto Flex';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('./roboto-flex-nDQikIyu.woff2') format('woff2');
}

/* ============================================================
   Color tokens — set by applyTheme() JS in help.html via CSS variables.
   Fallbacks are the light-mode defaults so the page renders before JS runs.
   ============================================================ */
:root {
  --md-primary:            #000000;
  --md-surface:            #ffffff;
  --md-on-surface:         #333333;
  --md-on-surface-variant: rgba(0,0,0,0.45);
  --md-primary-container:  rgba(0,0,0,0.08);
  --md-outline-variant:    rgba(0,0,0,0.10);
}

/* Derived semantic tokens used by nav + content */
body {
  --nav-bg:               var(--md-surface);
  --nav-title-color:      var(--md-on-surface-variant);
  --nav-link-color:       var(--md-on-surface-variant);
  --nav-link-hover-bg:    var(--md-outline-variant);
  --nav-active-bg:        var(--md-primary-container);
  --nav-active-color:     var(--md-primary);
  --nav-active-weight:    600;
  --nav-border:           var(--md-outline-variant);
  --surface:              var(--md-surface);
  --on-surface:           var(--md-on-surface);
  --on-surface-variant:   var(--md-on-surface-variant);
  --divider:              var(--md-outline-variant);
  --th-color:             var(--md-on-surface-variant);
  --h2-border:            var(--md-outline-variant);
}

body.theme-light {
  --kbd-bg:      #e0e0e0;
  --kbd-border:  #bbb;
  --code-bg:     #e8e8e8;
  --version-color: #888;
}

body.theme-dark {
  --kbd-bg:      rgba(255,255,255,0.10);
  --kbd-border:  rgba(255,255,255,0.20);
  --code-bg:     rgba(255,255,255,0.08);
  --version-color: rgba(255,255,255,0.4);
}

/* ============================================================
   Base
   ============================================================ */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Roboto Flex', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  overflow: hidden;
  background: var(--surface);
  color: var(--on-surface);
  user-select: text;
}

/* ============================================================
   Left nav sidebar (M3 Expressive Navigation Drawer style)
   ============================================================ */

.help-nav {
  width: 216px;
  flex-shrink: 0;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  overflow-y: auto;
  padding: 16px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-nav-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nav-title-color);
  padding: 4px 12px 8px;
}

/* Reset default list styles */
.help-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.help-nav > ul > li > ul {
  padding-left: 0;
  margin-bottom: 2px;
}

.help-nav a {
  display: block;
  padding: 7px 16px;
  border-radius: 28px; /* M3 full-pill active indicator */
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--nav-link-color);
  transition: background 180ms cubic-bezier(0.2, 0, 0, 1),
              color 180ms cubic-bezier(0.2, 0, 0, 1),
              font-variation-settings 180ms cubic-bezier(0.2, 0, 0, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.help-nav a:hover {
  background: var(--nav-link-hover-bg);
}

/* M3 active indicator — filled pill */
.help-nav a.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-color);
  font-weight: var(--nav-active-weight);
}

/* h3 sub-items */
.help-nav a.nav-h3 {
  font-size: 13px;
  font-weight: 400;
  padding: 5px 16px 5px 28px;
  color: var(--on-surface-variant);
}

.help-nav a.nav-h3.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-color);
  font-weight: 600;
}

/* ============================================================
   Main scrollable content
   ============================================================ */

.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 28px 32px 24px;
  min-width: 0;
}

h1 {
  font-size: 23px;
  font-weight: 500;
  margin: 0 0 4px;
}

.version {
  font-size: 13px;
  color: var(--version-color);
  margin: 0 0 16px;
}

h2 {
  font-size: 17px;
  font-weight: 500;
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--h2-border);
  scroll-margin-top: 16px;
}

h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 14px 0 4px;
  scroll-margin-top: 16px;
}

p {
  margin: 4px 0 8px;
}

ul {
  margin: 4px 0 8px;
  padding-left: 20px;
}

li {
  margin: 2px 0;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: 'Roboto Mono', Consolas, monospace;
  font-size: 13px;
  background: var(--kbd-bg);
  border: 1px solid var(--kbd-border);
  border-radius: 4px;
  color: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 15px;
}

th, td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--divider);
}

th {
  font-weight: 500;
  font-size: 13px;
  color: var(--th-color);
}

code {
  font-family: 'Roboto Mono', Consolas, monospace;
  font-size: 13px;
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 4px;
}

.color-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}

/* PIREP turbulence intensity colors */
.color-smooth { background: rgb(51,128,255); }
.color-light { background: rgb(0,204,0); }
.color-moderate { background: rgb(255,153,0); }
.color-severe { background: rgb(255,0,0); }
.color-extreme { background: rgb(255,0,255); }

/* Airspace class colors */
.color-class-b { background: #4582f8; }
.color-class-c { background: #ff00ff; }
.color-class-d { background: #87cefa; }

/* ============================================================
   Custom scrollbars — M3-aligned (thin, rounded, themed)
   ============================================================ */

/* Chromium supports ::-webkit-scrollbar in Electron */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(73, 69, 79, 0.28);   /* M3 outline-variant-ish at low opacity */
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;         /* creates visual padding around thumb */
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(73, 69, 79, 0.48);
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  background-clip: padding-box;
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.32);
  background-clip: padding-box;
}

