@charset "UTF-8";
/*
 *  help.css — TradeDM Help System
 *  Matches TradeDM Privacy/Terms page design tokens
 */

:root {
    --color-bg:        #FFFFFF;
    --color-hero-bg:   #0B1220;
    --color-text:      #1E293B;
    --color-muted:     #64748B;
    --color-border:    #E2E8F0;
    --color-cta:       #2563EB;
    --color-cta-h:     #1D4ED8;
    --radius:          12px;
    --max:             1100px;

    /* help_popup.css overrides */
    --help-primary:       var(--color-hero-bg);
    --help-primary-hover: var(--color-cta-h);
    --help-accent:        var(--color-cta);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
}

a { color: var(--color-cta); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ====== PAGE LAYOUT (pin footer) ====== */

.help-page {
    display: flex; flex-direction: column; min-height: 100dvh;
}


/* ====== NAV ====== */

.help-nav {
    background: var(--color-hero-bg);
    padding: .9rem 0;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.help-nav-inner {
    width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.help-nav-logo {
    display: flex; align-items: center; gap: .45rem;
    text-decoration: none;
}
.help-nav-logo img { height: 28px; width: auto; }

.help-nav-title {
    color: rgba(255,255,255,.7); font-size: .9rem; font-weight: 500;
    margin-left: 8px;
}

.help-nav-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.help-nav-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: .5rem 1.1rem; border-radius: 8px;
    font-size: .875rem; font-weight: 600; color: #CBD5E1;
    text-decoration: none; transition: color .15s;
}
.help-nav-btn:hover { color: #fff; text-decoration: none; }
.help-nav-btn svg { width: 14px; height: 14px; }


/* ====== TABS ====== */

.help-tabs {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1.25rem;
}

.help-tabs-inner {
    display: flex; gap: 0; max-width: var(--max); margin: 0 auto;
}

.help-tab {
    padding: 14px 20px;
    font-size: .875rem; font-weight: 600; color: var(--color-muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    user-select: none;
}
.help-tab:hover { color: var(--color-text); text-decoration: none; }
.help-tab.active { color: var(--color-cta); border-bottom-color: var(--color-cta); }


/* ====== CONTENT ====== */

.help-content {
    flex: 1;
    max-width: var(--max); margin: 0 auto; padding: .8rem 1.25rem 4rem;
    width: 100%;
}


/* ====== FAQ LIST (flat outline) ====== */

.help-search-bar {
    display: flex; align-items: center; gap: 10px;
    justify-content: flex-end;
}

.help-search-bar input {
    flex: 1; max-width: 280px;
    padding: 8px 12px; font-size: .875rem;
    border: 1px solid var(--color-border); border-radius: 8px;
    background: var(--color-bg); color: var(--color-text);
    outline: none; transition: border-color .15s;
    font-family: inherit;
}
.help-search-bar input:focus { border-color: var(--color-cta); }
.help-search-bar input::placeholder { color: var(--color-muted); }

.help-search-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid var(--color-border); background: var(--color-bg);
    cursor: pointer; transition: border-color .15s;
}
.help-search-btn:hover { border-color: var(--color-cta); }
.help-search-btn svg { fill: var(--color-muted); width: 14px; height: 14px; }
.help-search-btn:hover svg { fill: var(--color-cta); }

#allthefaqs { margin-top: 8px; }

.qa_set { margin: 0; }

.qa_questiongroup {
    padding: 12px 4px; cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background .1s;
}
.qa_questiongroup:hover { background: #F8FAFC; }

.qa_question {
    font-size: .975rem; line-height: 1.5; font-weight: 700;
    color: var(--color-text); margin: 0; display: flex; align-items: flex-start; gap: 10px;
}
.qa_question svg.svgtoggle {
    flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; cursor: pointer;
}
.qa_question svg.svgtoggle polygon { fill: var(--color-muted); }

.questiontext { flex: 1; }

.qa_answergroup {
    display: none; padding: 12px 8px 20px 30px;
    font-size: .975rem; line-height: 1.7; color: #374151;
    border-bottom: 1px solid var(--color-border);
}

.qa_edit { margin-left: 10px; display: none; font-size: .75rem; font-weight: 600; color: var(--color-cta); cursor: pointer; }
.qa_edit:hover { text-decoration: underline; }
.qordercode { margin-left: 8px; font-size: .7rem; font-weight: 400; color: var(--color-muted); display: none; }
.qacode { margin-left: 8px; font-size: .7rem; font-weight: 600; color: var(--color-muted); display: none; }
.qa_hidden_label { margin-left: 8px; font-size: .7rem; color: #EF4444; font-style: italic; }


/* ====== ADMIN CONTROLS ====== */

.help-admin-controls {
    display: none; margin-bottom: 12px;
}

.help-checkbox-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem; font-weight: 500; color: var(--color-muted);
    cursor: pointer; user-select: none;
}
.help-checkbox-label input[type="checkbox"] {
    width: 15px; height: 15px; accent-color: var(--color-cta);
}


/* ====== CONTACT FORM ====== */

.help-form-intro {
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}
.help-form-intro p {
    font-size: .975rem; color: #374151; line-height: 1.7; margin: 0 0 8px;
}

.help-form-section { margin-bottom: 20px; }
.help-form-section h3 {
    font-size: 1rem; font-weight: 700; color: var(--color-text); margin: 0 0 2px;
}
.help-form-section .help-form-subtitle {
    font-size: .82rem; color: var(--color-muted); font-style: italic; margin: 0 0 10px;
}

.help-form-input {
    display: block; width: 100%; max-width: 360px;
    padding: 9px 12px; font-size: .925rem; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: 8px;
    background: var(--color-bg); color: var(--color-text);
    margin-bottom: 6px; outline: none; transition: border-color .15s;
}
.help-form-input:focus { border-color: var(--color-cta); }
.help-form-input::placeholder { color: var(--color-muted); }

.help-form-select {
    padding: 9px 12px; font-size: .925rem; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: 8px;
    background: var(--color-bg); color: var(--color-text);
    outline: none; cursor: pointer; min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 32px;
}

.help-form-textarea {
    display: block; width: 100%;
    padding: 10px 12px; font-size: .925rem; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: 8px;
    background: var(--color-bg); color: var(--color-text);
    outline: none; resize: vertical; min-height: 120px;
    transition: border-color .15s;
}
.help-form-textarea:focus { border-color: var(--color-cta); }
.help-form-textarea::placeholder { color: var(--color-muted); }

.form_error {
    display: none; max-width: 360px; padding: 10px 12px; margin: 6px 0;
    font-size: .82rem; text-align: center;
    background: #FEF2F2; border: 1px solid #EF4444; border-radius: 8px;
    color: #DC2626;
}

.help-form-buttons {
    display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}

.help-btn {
    display: inline-block; padding: .5rem 1.1rem;
    border-radius: 8px; font-size: .875rem; font-weight: 600;
    cursor: pointer; transition: background .15s, color .15s;
    text-decoration: none; border: none; font-family: inherit;
}
.help-btn:hover { text-decoration: none; }

.help-btn-primary { background: var(--color-cta); color: #fff; }
.help-btn-primary:hover { background: var(--color-cta-h); }

.help-btn-secondary { color: var(--color-muted); background: transparent; border: 1px solid var(--color-border); }
.help-btn-secondary:hover { border-color: var(--color-cta); color: var(--color-cta); }


/* ====== SPINNER ====== */

.top_async { display: none; }

@keyframes help-spin { to { transform: rotate(360deg); } }
.help-spinner::before {
    content: ''; display: block; width: 18px; height: 18px;
    border: 2px solid var(--color-border); border-top-color: var(--color-cta);
    border-radius: 50%; animation: help-spin .6s linear infinite;
}


/* ====== FOOTER (matches app-footer from page_chrome.php) ====== */

.app-footer {
    background: var(--color-hero-bg); color: rgba(255,255,255,.6);
    padding: 0 0 28px; font-size: .8rem;
    margin-top: auto;
}
.app-footer .foot-bottom {
    width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 1.25rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 16px;
}
.app-footer .foot-left { display: flex; flex-direction: column; gap: 10px; }
.app-footer .foot-links { display: flex; gap: 18px; }
.app-footer .foot-links a { color: rgba(255,255,255,.55); transition: color .15s; text-decoration: none; }
.app-footer .foot-links a:hover { color: var(--color-cta); text-decoration: none; }
.app-footer .legal {
    font-size: .7rem; max-width: 52ch; line-height: 1.5; color: rgba(255,255,255,.4);
    text-align: right;
}
@media (max-width: 640px) { .app-footer .legal { text-align: left; } }


/* ====== QUILL EDITOR (help_creator) ====== */

#editor-container { min-height: 350px; background: var(--color-bg); }
#faq-question {
    display: block; width: 100%; margin: 10px 0;
    padding: 9px 12px; font-size: 1rem; font-weight: 700; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: 8px;
    background: var(--color-bg); color: var(--color-text); outline: none;
}
#faq-question:focus { border-color: var(--color-cta); }
#faq-question::placeholder { color: var(--color-muted); font-weight: 400; }
#editor-container, #toolbar-container { border-color: var(--color-border) !important; }

.help-editor-controls {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px;
}

.help-editor-input {
    width: 80px; padding: 7px 10px; font-size: .875rem; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: 8px;
    background: var(--color-bg); color: var(--color-text); outline: none;
}
.help-editor-input:focus { border-color: var(--color-cta); }
.help-editor-input::placeholder { color: var(--color-muted); }


/* ====== LEGACY COMPAT (ghost text system) ====== */

.ghostext { color: var(--color-muted) !important; }
.textentry { font-family: inherit; }


/* ====== RESPONSIVE ====== */

@media (max-width: 640px) {
    .help-nav-title { display: none; }
    .help-form-input { max-width: 100%; }
}
