/* --- Sub-Page Universal Styles --- */
.subpage-main {
    padding-top: 100px;
    min-height: 100vh;
    overflow-x: hidden;
}

.subpage-hero {
    position: relative;
    padding: calc(6rem + env(safe-area-inset-top)) 0 6rem;
    overflow: hidden;
}

/* Legal page document header spacing (replaces inline style="margin-top:2rem") */
.doc-header-main {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Inline text inputs (used in Map Fixer Find & Replace) */
.form-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
    transition: border-color 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: rgba(var(--brand-indigo-rgb), 0.5);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.hero-bg-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(var(--brand-indigo-rgb), 0.25) 0%, transparent 80%);
    z-index: -1;
    pointer-events: none;
}

.subpage-hero .hero-subtitle {
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* --- FAQ Interactivity --- */
.faq-question-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.faq-share-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.8rem;
    /* Slightly larger hit area */
    margin: -0.8rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.faq-share-btn i {
    pointer-events: none;
    /* Icon won't intercept the button tap */
}

.faq-item:hover .faq-share-btn,
.faq-share-btn:focus {
    opacity: 1;
    pointer-events: auto;
    color: var(--brand-cyan);
    transform: scale(1.15);
}

@media (max-width: 992px) {
    .faq-share-btn {
        opacity: 1;
        pointer-events: auto;
        color: rgba(255, 255, 255, 0.5);
        margin-right: 0.25rem;
        /* Better spacing on mobile */
    }
}


@media (min-width: 769px) {
    .hidden-for-desktop {
        display: none;
    }

    .hidden-for-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .subpage-main {
        padding-top: 80px;
    }

    .subpage-hero {
        padding: calc(3rem + env(safe-area-inset-top)) 1rem 2rem;
    }

    .subpage-hero h1 {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
    }

    .hidden-for-mobile {
        display: none;
    }

    .hidden-for-desktop {
        display: block;
    }

    .copy-btn {
        min-width: 80px;
    }

    .upload-card-inner {
        padding: 1.5rem;
    }

    .upload-zone-title {
        font-size: 1.05rem;
    }

    .upload-zone-hint {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .subpage-hero {
        padding: 2.5rem 1rem 1.5rem;
    }

    .upload-card-inner {
        padding: 1.25rem;
    }

    .upload-zone {
        padding: 1.5rem 1rem;
    }
}


/* --- FAQ Hub: Category Jump Nav --- */
.faq-jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 0 1rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.faq-jump-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(8px);
}

.faq-jump-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.faq-jump-btn i {
    font-size: 0.8rem;
}


/* --- FAQ Hub: Category Accent Colors --- */
.faq-category {
    scroll-margin-top: 120px;
}

/* Game */
.faq-category[data-theme="game"] .category-title i {
    color: hsl(28, 100%, 60%);
    background: hsla(28, 100%, 60%, 0.12);
    border-color: hsla(28, 100%, 60%, 0.25);
    box-shadow: 0 0 18px hsla(28, 100%, 60%, 0.2);
}

.faq-category[data-theme="game"] .category-title {
    color: hsl(28, 100%, 75%);
    text-shadow: 0 0 30px hsla(28, 100%, 60%, 0.25);
}

.faq-category[data-theme="game"] .faq-item.active {
    border-color: hsla(28, 100%, 60%, 0.3);
    box-shadow: 0 0 18px hsla(28, 100%, 60%, 0.07);
}

.faq-category[data-theme="game"] .faq-question i {
    color: hsl(28, 100%, 60%);
}

/* Support */
.faq-category[data-theme="support"] .category-title i {
    color: var(--brand-indigo);
    background: rgba(var(--brand-indigo-rgb), 0.12);
    border-color: rgba(var(--brand-indigo-rgb), 0.25);
    box-shadow: 0 0 18px rgba(var(--brand-indigo-rgb), 0.2);
}

.faq-category[data-theme="support"] .category-title {
    color: #a78bfa;
}

.faq-category[data-theme="support"] .faq-item.active {
    border-color: rgba(var(--brand-indigo-rgb), 0.3);
}

.faq-category[data-theme="support"] .faq-question i {
    color: var(--brand-indigo);
}

/* Hosting */
.faq-category[data-theme="hosting"] .category-title i {
    color: var(--brand-cyan);
    background: rgba(var(--brand-cyan-rgb), 0.12);
    border-color: rgba(var(--brand-cyan-rgb), 0.25);
    box-shadow: 0 0 18px rgba(var(--brand-cyan-rgb), 0.2);
}

.faq-category[data-theme="hosting"] .category-title {
    color: var(--brand-cyan);
}

.faq-category[data-theme="hosting"] .faq-item.active {
    border-color: rgba(var(--brand-cyan-rgb), 0.3);
}

.faq-category[data-theme="hosting"] .faq-question i {
    color: var(--brand-cyan);
}

/* Builder */
.faq-category[data-theme="builder"] .category-title i {
    color: hsl(290, 80%, 65%);
    background: hsla(290, 80%, 65%, 0.12);
    border-color: hsla(290, 80%, 65%, 0.25);
    box-shadow: 0 0 18px hsla(290, 80%, 65%, 0.2);
}

.faq-category[data-theme="builder"] .category-title {
    color: hsl(290, 80%, 80%);
}

.faq-category[data-theme="builder"] .faq-item.active {
    border-color: hsla(290, 80%, 65%, 0.3);
}

.faq-category[data-theme="builder"] .faq-question i {
    color: hsl(290, 80%, 65%);
}

/* Map */
.faq-category[data-theme="map"] .category-title i {
    color: hsl(155, 70%, 55%);
    background: hsla(155, 70%, 55%, 0.12);
    border-color: hsla(155, 70%, 55%, 0.25);
    box-shadow: 0 0 18px hsla(155, 70%, 55%, 0.2);
}

.faq-category[data-theme="map"] .category-title {
    color: hsl(155, 70%, 70%);
}

.faq-category[data-theme="map"] .faq-item.active {
    border-color: hsla(155, 70%, 55%, 0.3);
}

.faq-category[data-theme="map"] .faq-question i {
    color: hsl(155, 70%, 55%);
}

/* Commands */
.faq-category[data-theme="command"] .category-title i {
    color: hsl(50, 100%, 60%);
    background: hsla(50, 100%, 60%, 0.12);
    border-color: hsla(50, 100%, 60%, 0.25);
    box-shadow: 0 0 18px hsla(50, 100%, 60%, 0.2);
}

.faq-category[data-theme="command"] .category-title {
    color: hsl(50, 100%, 75%);
}

.faq-category[data-theme="command"] .faq-item.active {
    border-color: hsla(50, 100%, 60%, 0.3);
}

.faq-category[data-theme="command"] .faq-question i {
    color: hsl(50, 100%, 60%);
}


/* --- FAQ Hub: Category Header Layout --- */
.category-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.category-title {
    margin-bottom: 0 !important;
}

.faq-count-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}


/* --- FAQ Hub: Answer Content Styling --- */
.faq-answer-content ul,
.faq-answer-content ol {
    margin: 0.75rem 0 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.faq-answer-content li {
    line-height: 1.6;
}

.faq-answer-content p {
    margin-bottom: 0.75rem;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer-content strong,
.faq-answer-content a {
    color: rgba(255, 255, 255, 0.9);
}

.faq-answer-content a {
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--brand-indigo-rgb), 0.4);
    transition: all 0.2s;
}

.faq-answer-content a:hover {
    color: white;
    border-bottom-color: white;
}


/* --- FAQ Hub: Callout Boxes --- */
.faq-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.faq-callout.tip {
    background: hsla(155, 70%, 55%, 0.08);
    border: 1px solid hsla(155, 70%, 55%, 0.2);
    color: hsl(155, 70%, 70%);
}

.faq-callout.warn {
    background: hsla(28, 100%, 60%, 0.08);
    border: 1px solid hsla(28, 100%, 60%, 0.2);
    color: hsl(28, 100%, 75%);
}

.faq-callout.info {
    background: rgba(var(--brand-indigo-rgb), 0.08);
    border: 1px solid rgba(var(--brand-indigo-rgb), 0.2);
    color: #a78bfa;
}

.faq-callout i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}


/* --- FAQ Hub: Cheat Code Table --- */
.cheat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.cheat-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cheat-table tr:last-child td {
    border-bottom: none;
}

.cheat-table td:last-child {
    color: rgba(255, 255, 255, 0.7);
}

/* --- Slash Commands: Badges & Typography --- */
.admin-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(var(--brand-red-rgb), 0.15);
    color: var(--brand-red);
    border: 1px solid rgba(var(--brand-red-rgb), 0.3);
    margin-left: 0.5rem;
    vertical-align: middle;
    text-align: center;
    letter-spacing: 0.5px;
}

.removed-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(120, 120, 120, 0.15);
    color: #9a9a9a;
    border: 1px solid rgba(120, 120, 120, 0.3);
    margin-left: 0.5rem;
    vertical-align: middle;
    letter-spacing: 0.5px;
    position: relative;
}

.removed-badge::before {
    content: 'REMOVED';
}

.dashboard-content ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dashboard-content ul li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.dashboard-content ul li::before {
    content: none;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--brand-indigo);
    font-size: 0.9rem;
    top: 2px;
}

/* --- Slash Commands: Command List Cards --- */
.dashboard-content ul.command-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.dashboard-content ul.command-list li {
    padding: 1.5rem;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.dashboard-content ul.command-list li:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.dashboard-content ul.command-list li::before {
    display: none;
}

/* --- Slash Commands: Code Elements --- */
code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: rgba(var(--brand-purple-rgb), 0.15);
    color: #e2e8f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid rgba(var(--brand-purple-rgb), 0.3);
    transition: all 0.2s ease;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    margin: 0 0.1rem;
}

code[onclick] {
    cursor: pointer;
}

code[onclick]:hover {
    background: rgba(var(--brand-cyan-rgb), 0.2);
    border-color: rgba(var(--brand-cyan-rgb), 0.4);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--brand-cyan-rgb), 0.15);
}

.code-example {
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--brand-cyan);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* --- Slash Commands: Cards & Grids --- */
.summon-category {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
}

.summon-category h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--neon-purple);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.summon-category h3 i {
    color: var(--brand-cyan);
}

.command-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.command-grid code {
    padding: 0.5rem 0.75rem;
}

.params-list li {
    padding-left: 0 !important;
}

.params-list li::before {
    display: none;
}

/* --- Legal & Policy Pages --- */
.legal-content-container {
    max-width: 900px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 4rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.legal-content-container h2 {
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legal-content-container h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.5rem;
    background: var(--brand-purple);
    border-radius: 2px;
}

.legal-content-container h2:first-of-type {
    margin-top: 0;
}

.legal-content-container p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.legal-content-container ul {
    margin-bottom: 2rem;
    padding-left: 0;
    /* Reset for cards */
    list-style: none;
}

.legal-content-container ul li {
    margin-bottom: 1.25rem;
    position: relative;
    padding: 1.5rem 2rem;
    /* Consistent with other dashboard cards */
    background: rgba(var(--brand-indigo-rgb), 0.03);
    /* Subtle backdrop */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    transition: var(--transition-smooth);
}

.legal-content-container ul li:hover {
    background: rgba(var(--brand-indigo-rgb), 0.06);
    border-color: rgba(var(--brand-indigo-rgb), 0.2);
    color: white;
}

/* Remove any and all bullet points for legal cards */
.legal-content-container ul li::before {
    display: none !important;
}


.legal-content-container code {
    background: rgba(var(--brand-cyan-rgb), 0.1);
    border: 1px solid rgba(var(--brand-cyan-rgb), 0.2);
    color: var(--brand-cyan);
}

@media (max-width: 768px) {
    .legal-content-container {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
        margin: 0.25rem;
    }

    .legal-content-container h2 {
        font-size: 1.4rem;
    }
}

/* --- No-Sidebar Layout Helpers --- */
.dashboard-content.no-sidebar {
    padding-top: 4rem;
    max-width: 1100px;
    /* More focused for reading */
}

/* Hide sidebar-dependent elements on no-sidebar pages */
.no-sidebar+.menu-toggle,
.dashboard-layout:has(.no-sidebar) .menu-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .dashboard-content.no-sidebar {
        padding: 1.5rem;
    }
}

/* --- Documentation Search Bar --- */
.doc-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 2rem 0;
    z-index: 50;
}

.doc-search-wrapper .doc-search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3.25rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.doc-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-cyan);
    box-shadow: 0 0 20px rgba(var(--brand-cyan-rgb), 0.2);
}

.doc-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.doc-search-wrapper .search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: color 0.3s ease;
}

.doc-search-input:focus~.search-icon {
    color: var(--brand-cyan);
}

.doc-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.doc-search-clear:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.doc-search-clear.hidden {
    display: none;
}

/* Base styles for the outer results container */
.doc-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow-y: auto;
    max-height: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    z-index: 100;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.doc-search-results.hidden {
    display: block;
    /* We use opacity/pointer-events instead of display:none for smooth animation */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

/* Individual Search Category */
.search-result-category {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-cyan);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Target elements inside the results */
.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover,
.search-result-item.active {
    background: rgba(255, 255, 255, 0.05);
}

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

.search-result-code {
    font-family: monospace;
    font-size: 0.95rem;
    color: hsl(28, 100%, 75%);
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.search-result-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.search-no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* --- Icon & Separator Utilities --- */
.icon-bolt-gradient {
    background: var(--bolt-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    filter: drop-shadow(0 0 5px rgba(255, 143, 68, 0.4));
    vertical-align: middle;
}

.doc-arrow-separator {
    margin: 0 8px;
    opacity: 0.5;
    font-size: 0.9em;
    vertical-align: middle;
}

.warn-icon {
    color: var(--brand-warning);
    margin-right: 4px;
}

/* --- Search: highlight flash on matched list item --- */
@keyframes searchFlash {
    0% {
        background: rgba(var(--brand-cyan-rgb), 0.22);
        border-color: rgba(var(--brand-cyan-rgb), 0.5);
    }

    60% {
        background: rgba(var(--brand-cyan-rgb), 0.12);
        border-color: rgba(var(--brand-cyan-rgb), 0.3);
    }

    100% {
        background: transparent;
        border-color: transparent;
    }
}

.search-highlight {
    animation: searchFlash 2.2s ease forwards;
    border-radius: 8px;
    outline: 2px solid rgba(var(--brand-cyan-rgb), 0.4);
    outline-offset: 4px;
}

/* Query match highlighting inside result dropdown */
.search-result-code mark,
.search-result-desc mark {
    background: rgba(var(--brand-cyan-rgb), 0.2);
    color: var(--brand-cyan);
    border-radius: 3px;
    padding: 0 2px;
    font-style: normal;
}

/* "+N more" indicator in results */
.search-result-more {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    font-style: italic;
}