/* ============================================================
   CastAway Help — Main Stylesheet
   Palette: deep charcoal sidebar, caribbean blue primary, warm coral secondary
   Part of the TuneTracker suite help system
   ============================================================ */

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

:root {
    /* Primary accent — caribbean blue (navigation, active states, links) */
    --teal:           #1A8A9A;
    --teal-light:     #3CC4D4;
    --teal-pale:      #EAF8FA;
    --teal-border:    #7ED4E0;

    /* Secondary accent — warm coral (warnings, callouts) */
    --orange:         #C86B5A;
    --orange-light:   #D48878;
    --orange-pale:    #FDF2F0;
    --orange-border:  #E0A898;

    /* Sidebar */
    --sidebar-bg:     #1E1E22;
    --sidebar-hover:  #2C2C34;
    --sidebar-active: #1A8A9A;
    --sidebar-text:   #CCCCCC;
    --sidebar-muted:  #666678;
    --sidebar-width:  228px;

    /* Neutrals */
    --gray-100:       #F5F4F2;
    --gray-200:       #E8E6E2;
    --gray-300:       #D0CCC6;
    --gray-600:       #6A6460;
    --gray-800:       #1E1A18;
    --text:           #1E1A18;
    --text-secondary: #6A6460;

    /* Links use caribbean blue */
    --link:           #1A8A9A;

    /* Callout boxes */
    --tip-bg:         #EAF8FA;
    --tip-border:     #1A8A9A;
    --note-bg:        #FFFAEC;
    --note-border:    #C8960A;
    --warn-bg:        #FDF2F0;
    --warn-border:    #C86B5A;

    --radius:         7px;
    --shadow:         0 2px 10px rgba(0,0,0,0.09);
}

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 .accent { color: var(--teal-light); }
.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(26,138,154,0.22);
    border-left-color: var(--teal-light);
    color: #fff;
    font-weight: 500;
}

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

.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(--teal-border);
    letter-spacing: -0.3px;
}
h2 {
    font-size: 16px; font-weight: 700; color: var(--teal);
    margin: 28px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--teal);
}
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: #0E5A66;
}

/* -- Breadcrumb --------------------------------------------- */
.breadcrumb {
    font-size: 11px; color: var(--text-secondary);
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 5px;
}
.breadcrumb a { color: var(--teal); }
.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: #0E4A52; 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(--teal-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(26,138,154,0.18);
    border-color: var(--teal-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(--teal); margin-bottom: 4px; }
.topic-card .card-desc  { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* -- Step list ---------------------------------------------- */
.step-list { list-style: none; padding: 0; margin: 14px 0; }
.step-list li {
    display: flex; gap: 13px; align-items: flex-start;
    margin-bottom: 14px; font-size: 13px;
}
.step-num {
    flex-shrink: 0;
    width: 22px; height: 22px;
    background: var(--teal);
    color: #fff;
    border-radius: 50%;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}

/* -- Keyboard 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;
}

/* -- 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;
}
.zoom-btn:hover { background: var(--gray-200); }
.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;
}
.zoom-reset:hover { background: var(--gray-200); color: var(--gray-800); }
