/* ============================================================
   ClockWork Help — Main Stylesheet
   Palette: deep charcoal sidebar, ClockWork green accent, warm neutrals
   Matching TuneTracker's broadcast-tool aesthetic
   ============================================================ */

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

:root {
    --accent:         #4A7A2E;
    --accent-light:   #5A9438;
    --accent-pale:    #EFF6EB;
    --accent-border:  #8AB878;
    --sidebar-bg:     #1E1E22;
    --sidebar-hover:  #2C2C34;
    --sidebar-active: #5A9438;
    --sidebar-text:   #CCCCCC;
    --sidebar-muted:  #666678;
    --sidebar-width:  228px;
    --gray-100:       #F5F4F2;
    --gray-200:       #E8E6E2;
    --gray-300:       #D0CCC6;
    --gray-600:       #6A6460;
    --gray-800:       #1E1A18;
    --text:           #1E1A18;
    --text-secondary: #6A6460;
    --link:           #3A6820;
    --tip-bg:         #EFF6EB;
    --tip-border:     #4A7A2E;
    --note-bg:        #FFFAEC;
    --note-border:    #C8960A;
    --warn-bg:        #FEF0F0;
    --warn-border:    #C84040;
    --radius:         7px;
    --shadow:         0 2px 10px rgba(0,0,0,0.09);

    /* Category row colors — match the app exactly */
    --cat-playback:   rgb(153, 217, 153);   /* green */
    --cat-auto:       rgb(153, 217, 224);   /* blue  */
    --cat-misc:       rgb(224, 224, 217);   /* gray  */
    --cat-switcher:   rgb(191, 204, 230);   /* blue-purple */
    --cat-invalid:    rgb(255, 217, 217);   /* pink  */
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    background: var(--gray-100);
}

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.sidebar-brand span { color: #4ADE40; }
.sidebar-sub {
    font-size: 11px;
    color: var(--sidebar-muted);
    margin-top: 2px;
}

.sidebar nav { padding: 8px 0 20px; flex: 1; }

.nav-section { margin-bottom: 2px; }

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 12px 16px 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.nav-section-title .arrow { font-size: 9px; transition: transform 0.2s; }
.nav-section-title.collapsed .arrow { transform: rotate(-90deg); }

.nav-items { overflow: hidden; }
.nav-items.collapsed { display: none; }

.nav-items a {
    display: block;
    padding: 5px 16px 5px 20px;
    font-size: 13px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-items a:hover { background: var(--sidebar-hover); color: #fff; }
.nav-items a.active {
    background: rgba(74,122,46,0.30);
    border-left-color: var(--accent-light);
    color: #fff;
    font-weight: 500;
}

/* ── Main ───────────────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.page-hero {
    background: linear-gradient(135deg, #1A2A10 0%, #2E5A18 60%, var(--accent) 100%);
    padding: 26px 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.page-hero-text h1 {
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.page-hero-text p { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: 2px; }

.content { max-width: 780px; padding: 34px 40px 60px; flex: 1; }

/* ── Typography ─────────────────────────────────────────── */
h1 {
    font-size: 22px; font-weight: 700; color: var(--gray-800);
    margin-bottom: 8px; padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-border);
    letter-spacing: -0.3px;
}
h2 {
    font-size: 16px; font-weight: 700; color: var(--accent);
    margin: 28px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
}
h3 { font-size: 14px; font-weight: 600; color: var(--gray-800); margin: 18px 0 6px; }
p { margin-bottom: 12px; }
ul, ol { margin: 0 0 14px 0; padding-left: 22px; }
li { margin-bottom: 5px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    font-family: "SF Mono", Monaco, Menlo, monospace;
    font-size: 12px;
    background: var(--gray-200);
    padding: 2px 5px; border-radius: 3px;
    color: #2E5A18;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
    font-size: 11px; color: var(--text-secondary);
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 5px;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb .sep { color: var(--gray-300); }

/* ── Tables ─────────────────────────────────────────────── */
.field-table {
    width: 100%; border-collapse: collapse; margin: 10px 0 20px;
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.field-table thead th {
    background: #1A3A10; color: #fff;
    font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase; padding: 8px 12px; text-align: left;
}
.field-table tbody tr:nth-child(odd)  { background: #fff; }
.field-table tbody tr:nth-child(even) { background: var(--gray-100); }
.field-table tbody tr:hover { background: var(--accent-pale); }
.field-table td {
    padding: 9px 12px; border-bottom: 1px solid var(--gray-200);
    font-size: 13px; vertical-align: top;
}
.field-table td:first-child { font-weight: 600; white-space: nowrap; width: 165px; color: var(--gray-800); }
.field-table tbody tr:last-child td { border-bottom: none; }

/* ── Callouts ───────────────────────────────────────────── */
.tip, .note, .warn {
    border-radius: var(--radius); padding: 12px 16px; margin: 16px 0;
    display: flex; gap: 10px; align-items: flex-start;
}
.tip  { background: var(--tip-bg);  border: 1px solid var(--tip-border);  }
.note { background: var(--note-bg); border: 1px solid var(--note-border); }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); }
.tip-icon, .note-icon, .warn-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.tip p, .note p, .warn p { margin: 0; font-size: 13px; }

/* ── Welcome topic grid ─────────────────────────────────── */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 13px; margin: 20px 0;
}
.topic-card {
    background: #fff; border: 1px solid var(--gray-300);
    border-radius: var(--radius); padding: 15px;
    text-decoration: none; color: var(--text);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
    display: block; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topic-card:hover {
    box-shadow: 0 4px 14px rgba(74,122,46,0.22);
    border-color: var(--accent-border); transform: translateY(-1px);
    text-decoration: none;
}
.topic-card .card-icon  { font-size: 22px; margin-bottom: 8px; }
.topic-card .card-title { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.topic-card .card-desc  { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* ── Event category swatches ────────────────────────────── */
.cat-swatch {
    display: inline-flex; align-items: center; gap: 9px;
    margin-bottom: 10px; font-size: 13px;
}
.swatch {
    width: 14px; height: 14px; border-radius: 3px;
    flex-shrink: 0; border: 1px solid rgba(0,0,0,0.12);
}
.swatch-playback  { background: var(--cat-playback);  }
.swatch-auto      { background: var(--cat-auto);      }
.swatch-misc      { background: var(--cat-misc);      }
.swatch-switcher  { background: var(--cat-switcher);  }
.swatch-invalid   { background: var(--cat-invalid);   }

/* ── Keyboard shortcut badges ───────────────────────────── */
kbd {
    display: inline-block;
    font-family: -apple-system, sans-serif;
    font-size: 11px;
    background: var(--gray-200);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--gray-800);
    box-shadow: 0 1px 0 var(--gray-300);
    white-space: nowrap;
}

/* ── Tab pill ───────────────────────────────────────────── */
.tab-pill {
    display: inline-block;
    background: #1A3A10;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 7px;
    letter-spacing: 0.2px;
}

/* ── Zoom controls ──────────────────────────────────────── */
.zoom-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 6px 14px;
    background: #ECEAE6;
    border-bottom: 1px solid var(--gray-300);
    flex-shrink: 0;
}

.zoom-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--gray-300);
    border-radius: 5px;
    background: #fff;
    color: var(--gray-800);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, border-color 0.1s;
}
.zoom-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-600);
}
.zoom-btn:active { background: var(--gray-300); }

.zoom-pct {
    font-size: 11px;
    color: var(--gray-600);
    min-width: 34px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.zoom-reset {
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--gray-300);
    border-radius: 5px;
    background: #fff;
    color: var(--gray-600);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}
.zoom-reset:hover {
    background: var(--gray-200);
    border-color: var(--gray-600);
    color: var(--gray-800);
}
.zoom-reset:active { background: var(--gray-300); }
