/* ═══════════════════════════════════════════════════════════════════════════
   help.css — LexiLayers Help Center Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   Container & Layout
   ───────────────────────────────────────────────────────────────────────────── */

#help-center-page {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 80px; /* Space for mobile nav */
    display: block;
    position: relative;
    z-index: 50; /* Above footer */
}

/* Hide footer when Help Center is visible */
#help-center-page:not(.is-hidden) ~ #site-footer,
body:has(#help-center-page:not(.is-hidden)) #site-footer {
    display: none !important;
}

/* Light mode: subtle gradient background */
[data-theme="light"] #help-center-page {
    background: linear-gradient(180deg, #f8f9fc 0%, #eef1f8 100%);
}

.help-center-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.help-center-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

[data-theme="light"] .help-center-header {
    background: linear-gradient(135deg, #4f5bd5 0%, #667eea 100%);
}

.help-center-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.help-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
}

.help-menu-toggle:hover {
    background: rgba(255,255,255,0.15);
}

.help-center-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Sidebar Navigation
   ───────────────────────────────────────────────────────────────────────────── */

.help-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color, rgba(128,128,128,0.2));
    overflow-y: auto;
    flex-shrink: 0;
}

/* Light mode sidebar accent */
[data-theme="light"] .help-sidebar {
    background: #fff;
    border-right: 1px solid #e2e8f0;
}

.help-nav {
    padding: 16px 0;
}

.help-nav-category {
    margin-bottom: 4px;
}

.help-nav-category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.help-nav-category-btn:hover {
    background: rgba(128,128,128,0.1);
}

.help-nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.help-nav-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.2s;
}

.help-nav-category-btn.expanded .help-nav-chevron {
    transform: rotate(180deg);
}

.help-nav-topics {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.help-nav-topics.expanded {
    max-height: 500px;
}

.help-nav-topic-btn {
    display: block;
    width: 100%;
    padding: 10px 20px 10px 48px;
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.help-nav-topic-btn:hover {
    color: var(--text-primary);
    background: rgba(128,128,128,0.08);
}

.help-nav-topic-btn.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    font-weight: 500;
}

[data-theme="light"] .help-nav-topic-btn.active {
    color: #4f5bd5;
    background: rgba(79, 91, 213, 0.1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Search Box
   ───────────────────────────────────────────────────────────────────────────── */

.help-search-container {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, rgba(128,128,128,0.2));
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

[data-theme="light"] .help-search-container {
    background: #fff;
    border-bottom-color: #e2e8f0;
}

.help-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.help-search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary, #888);
    pointer-events: none;
}

#help-search-input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    border: 1px solid var(--border-color, rgba(128,128,128,0.3));
    border-radius: 8px;
    background: rgba(128,128,128,0.08);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#help-search-input::placeholder {
    color: var(--text-secondary, #888);
}

#help-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

[data-theme="light"] #help-search-input {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] #help-search-input:focus {
    border-color: #4f5bd5;
    box-shadow: 0 0 0 3px rgba(79, 91, 213, 0.12);
}

.help-search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
}

.help-search-clear:hover {
    background: rgba(128,128,128,0.15);
    color: var(--text-primary);
}

.help-search-clear svg {
    width: 14px;
    height: 14px;
}

/* Search Results */
.help-search-results {
    margin-top: 8px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.help-search-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 12px;
    margin-bottom: 4px;
    background: rgba(128,128,128,0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.help-search-result:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

[data-theme="light"] .help-search-result:hover {
    background: rgba(79, 91, 213, 0.08);
    border-color: rgba(79, 91, 213, 0.2);
}

.help-search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.help-search-result-category {
    font-size: 0.75rem;
    color: #667eea;
    margin-bottom: 6px;
}

[data-theme="light"] .help-search-result-category {
    color: #4f5bd5;
}

.help-search-result-snippet {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.help-search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    color: var(--text-secondary, #888);
    text-align: center;
}

.help-search-no-results svg {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.help-search-no-results p {
    margin: 0;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Content Area
   ───────────────────────────────────────────────────────────────────────────── */

.help-content-area {
    flex: 1;
    padding: 32px 40px 120px 40px; /* Extra bottom padding for scroll */
    overflow-y: auto;
    max-width: 900px;
}

/* Light mode content area */
[data-theme="light"] .help-content-area {
    background: transparent;
}

.help-article {
    color: var(--text-primary);
    line-height: 1.7;
}

.help-article h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
    color: var(--text-primary);
}

[data-theme="light"] .help-article h2 {
    border-bottom-color: #4f5bd5;
}

.help-article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 28px 0 12px 0;
    color: #667eea;
}

[data-theme="light"] .help-article h3 {
    color: #4f5bd5;
}

.help-article h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-primary);
}

.help-article p {
    margin: 0 0 16px 0;
    color: var(--text-secondary, #aaa);
}

[data-theme="light"] .help-article p {
    color: #555;
}

.help-article ul,
.help-article ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
    color: var(--text-secondary, #aaa);
}

[data-theme="light"] .help-article ul,
[data-theme="light"] .help-article ol {
    color: #555;
}

.help-article li {
    margin-bottom: 8px;
}

.help-article a {
    color: #667eea;
    text-decoration: none;
}

.help-article a:hover {
    text-decoration: underline;
}

/* Inline coin icon */
.help-inline-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 8px;
}

.help-coin-inline {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin: 0 2px;
}

.help-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

.help-article kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: rgba(128,128,128,0.15);
    border: 1px solid rgba(128,128,128,0.3);
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────────────────────────────────────── */

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.help-table th,
.help-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(128,128,128,0.2));
}

.help-table th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    font-weight: 600;
    color: var(--text-primary);
}

[data-theme="light"] .help-table th {
    background: linear-gradient(135deg, rgba(79, 91, 213, 0.12) 0%, rgba(102, 126, 234, 0.08) 100%);
}

.help-table td {
    color: var(--text-secondary, #aaa);
}

[data-theme="light"] .help-table td {
    color: #555;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Tip & Warning Boxes
   ───────────────────────────────────────────────────────────────────────────── */

.help-tip {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.help-tip strong {
    color: #667eea;
}

[data-theme="light"] .help-tip {
    background: rgba(79, 91, 213, 0.08);
    border-left-color: #4f5bd5;
}

[data-theme="light"] .help-tip strong {
    color: #4f5bd5;
}

.help-warning {
    background: rgba(234, 179, 8, 0.1);
    border-left: 4px solid #eab308;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.help-warning strong {
    color: #eab308;
}

[data-theme="light"] .help-warning {
    background: rgba(202, 138, 4, 0.1);
    border-left-color: #ca8a04;
}

[data-theme="light"] .help-warning strong {
    color: #b45309;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Tile Examples (for scoring section)
   ───────────────────────────────────────────────────────────────────────────── */

.tile-example {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin: 12px 0;
    background: rgba(128,128,128,0.05);
    border-radius: 10px;
}

.tile-demo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    border-radius: 8px;
    position: relative;
    flex-shrink: 0;
}

.tile-demo .tile-value {
    position: absolute;
    bottom: 3px;
    right: 4px;
    font-size: 10px;
    font-weight: 600;
    opacity: 0.7;
}

.tile-demo.tile-white {
    background: linear-gradient(180deg, #f7e8c4 70%, #ecd099 100%);
    border: 1.5px solid #c6b791;
    color: #1a1a1a !important; /* Dark text on light tile */
}

.tile-demo.tile-white .tile-value {
    color: #6b5421 !important;
}

.tile-demo.tile-lblue {
    background: linear-gradient(180deg, #6fbeff 60%, #2299ee 100%);
    border: 2px solid #2379c3;
    color: #fff;
}

.tile-demo.tile-dblue {
    background: linear-gradient(180deg, #415bfb 10%, #092e7e 100%);
    border: 2px solid #243cb6;
    color: #fff;
}

.tile-demo.tile-lgreen {
    background: linear-gradient(180deg, #85e4b1 70%, #19bf45 100%);
    border: 2px solid #19a345;
    color: #185530 !important; /* Dark text on light green */
}

.tile-demo.tile-lgreen .tile-value {
    color: #185530 !important;
}

.tile-demo.tile-dgreen {
    background: linear-gradient(180deg, #26b950 50%, #087c25 100%);
    border: 2px solid #057025;
    color: #fff;
}

.tile-info {
    flex: 1;
}

.tile-info strong {
    display: block;
    margin-bottom: 4px;
}

.tile-info p {
    margin: 0;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Row Multiplier Grid
   ───────────────────────────────────────────────────────────────────────────── */

.row-multiplier-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin: 16px 0;
}

.row-multiplier-grid .slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    background: rgba(128,128,128,0.1);
    border-radius: 8px;
    border: 1px solid rgba(128,128,128,0.2);
}

.row-multiplier-grid .slot-num {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
    margin-bottom: 4px;
}

.row-multiplier-grid .slot-mult {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.row-multiplier-grid .slot-highlight {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.row-multiplier-grid .slot-highlight .slot-mult {
    color: #667eea;
}

.row-multiplier-grid .slot-highlight2 {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.row-multiplier-grid .slot-highlight2 .slot-mult {
    color: #22c55e;
}

.row-multiplier-grid .slot-highlight3 {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.3);
}

.row-multiplier-grid .slot-highlight3 .slot-mult {
    color: #eab308;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Scoring Examples
   ───────────────────────────────────────────────────────────────────────────── */

.scoring-example {
    background: var(--card-bg);
    border: 1px solid var(--border-color, rgba(128,128,128,0.2));
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.example-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-bottom: 16px;
}

.example-tiles .tile-demo {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.example-calc {
    font-size: 0.9rem;
}

.example-calc p {
    margin: 6px 0;
    padding: 6px 10px;
    background: rgba(128,128,128,0.05);
    border-radius: 6px;
}

.example-calc .highlight {
    color: #667eea;
    font-weight: 600;
}

[data-theme="light"] .example-calc .highlight {
    color: #4f5bd5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FAQ Items
   ───────────────────────────────────────────────────────────────────────────── */

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color, rgba(128,128,128,0.15));
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
}

.faq-item p,
.faq-item ul {
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Status Dots (for online status section)
   ───────────────────────────────────────────────────────────────────────────── */

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online {
    background: #22c55e;
}

.status-dot.offline {
    background: #888;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Rank Badges (for rankings section)
   ───────────────────────────────────────────────────────────────────────────── */

.rank-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #333;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700, #daa520);
    color: #333;
}

.rank-badge.platinum {
    background: linear-gradient(135deg, #e5e4e2, #a0b2c6);
    color: #333;
}

.rank-badge.diamond {
    background: linear-gradient(135deg, #b9f2ff, #4fc3f7);
    color: #1a1a1a;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile Responsive
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .help-content-area {
        padding: 24px 20px;
    }

    .row-multiplier-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .help-menu-toggle {
        display: block;
    }

    .help-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--border-color, rgba(128,128,128,0.2));
    }

    .help-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }

    .help-search-container {
        padding: 12px;
    }

    .help-search-results {
        max-height: calc(100vh - 150px);
    }

    .help-center-layout {
        flex-direction: column;
    }

    .help-content-area {
        padding: 20px 16px 160px 16px;
        max-width: 100%;
    }

    .help-article h2 {
        font-size: 1.4rem;
    }

    .help-article h3 {
        font-size: 1.1rem;
    }

    .tile-example {
        flex-direction: column;
        text-align: center;
    }

    .example-tiles .tile-demo {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .row-multiplier-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 3px;
    }

    .row-multiplier-grid .slot {
        padding: 6px 2px;
    }

    .row-multiplier-grid .slot-num {
        font-size: 0.65rem;
    }

    .row-multiplier-grid .slot-mult {
        font-size: 0.75rem;
    }
}

/* Overlay for mobile sidebar */
.help-sidebar.open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 280px;
    width: calc(100vw - 280px);
    height: 100vh;
    background: rgba(0,0,0,0.5);
}

@media (min-width: 769px) {
    .help-sidebar.open::before {
        display: none;
    }
}
