/* FAQ-Off - Main Stylesheet */

/* C9 Color Palette */
:root {
    --c9-dark-blue: #0F1C2B;
    --c9-medium-blue: #1A304D;
    --c9-light-blue: #2A4F7F;
    --c9-accent-blue: #00A3FF;
    --c9-white: #FFFFFF;
    --c9-text-light: #E0E0E0;
    --c9-text-medium: #A0A0A0;
    --c9-border-dark: #0A1520;
    --c9-border-light: #3D6AAB;
    --c9-parchment-bg: #EAEFF4;
    --c9-parchment-border: #809BB0;
    --c9-parchment-shadow: rgba(15, 28, 43, 0.3);
    --c9-link-color: #0056B3;
    --c9-link-hover: #007BFF;
    --c9-infobox-header: var(--c9-medium-blue);
    --c9-infobox-text: var(--c9-white);
    --c9-infobox-bg-light: #DAE2EB;
    --c9-infobox-bg-dark: #C1CEDA;
    --c9-infobox-border: #6B8BAA;
    --c9-table-header: #BCC8D6;
    --c9-table-row-odd: #F5F7F9;
    --c9-table-row-even: #E8ECF1;
    --c9-error-red: #D9534F;
    --c9-success-green: #5CB85C;
}

body {
    font-family: "Verdana", "Arial", sans-serif;
    background-color: var(--c9-dark-blue);
    background-image: linear-gradient(to bottom, #0d1a29, #1a314e);
    color: var(--c9-text-light);
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    background: var(--c9-medium-blue);
}
::-webkit-scrollbar-thumb {
    background: var(--c9-light-blue);
    border: 1px solid var(--c9-medium-blue);
}

/* The main parchment texture */
.rs-parchment {
    background-color: var(--c9-parchment-bg);
    background-image: repeating-linear-gradient(0deg, transparent, transparent 19px, #d2dce6 20px),
                      repeating-linear-gradient(90deg, transparent, transparent 19px, #d2dce6 20px);
    background-size: 100% 100%;
    border: 2px solid var(--c9-parchment-border);
    box-shadow: inset 0 0 20px var(--c9-parchment-shadow);
    color: #333;
}

/* Interface panels */
.rs-panel {
    background-color: var(--c9-medium-blue);
    border: 2px solid var(--c9-border-dark);
    color: var(--c9-text-light);
}

/* Links */
.wiki-link {
    color: var(--c9-link-color);
    text-decoration: none;
}
.wiki-link:hover {
    text-decoration: underline;
    color: var(--c9-link-hover);
}
.wiki-link-red {
    color: var(--c9-error-red);
}
.wiki-link-external::after {
    content: " ↗";
    font-size: 0.7em;
}

/* Infobox styling */
.infobox {
    border: 2px solid var(--c9-infobox-border);
    background-color: var(--c9-infobox-bg-dark);
    width: 300px;
    float: right;
    clear: right;
    margin: 0 0 1em 1em;
    padding: 5px;
    font-size: 0.85rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    color: #333;
}
.infobox-header {
    background-color: var(--c9-infobox-header);
    color: var(--c9-infobox-text);
    font-weight: bold;
    text-align: center;
    padding: 5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* Tab system styling */
.wiki-tab {
    background: linear-gradient(to bottom, var(--c9-light-blue), var(--c9-medium-blue));
    border: 1px solid var(--c9-border-dark);
    border-bottom: none;
    color: var(--c9-text-light);
    font-weight: bold;
    padding: 8px 16px;
    margin-right: 4px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    position: relative;
    top: 1px;
}
.wiki-tab.active {
    background: var(--c9-parchment-bg);
    color: #333;
    border-bottom: 1px solid var(--c9-parchment-bg);
    z-index: 10;
}

/* Table styling */
.wikitable {
    background-color: var(--c9-table-row-odd);
    border: 1px solid var(--c9-parchment-border);
    border-collapse: collapse;
    color: black;
    width: 100%;
    font-size: 0.9rem;
}
.wikitable th {
    background-color: var(--c9-table-header);
    border: 1px solid var(--c9-parchment-border);
    padding: 0.5em;
    text-align: left;
    vertical-align: top;
}
.wikitable td {
    border: 1px solid var(--c9-parchment-border);
    padding: 0.5em;
    vertical-align: top;
}
.wikitable tr:nth-child(odd) {
    background-color: var(--c9-table-row-odd);
}
.wikitable tr:nth-child(even) {
    background-color: var(--c9-table-row-even);
}

/* Section header rows in tables (bold headers spanning row) */
.wikitable th .font-bold,
.wikitable th strong,
.wikitable td .font-bold:only-child,
.wikitable th:has(> .font-bold:only-child) {
    display: block;
}
.wikitable tr:has(th .font-bold:only-child):has(td:empty),
.wikitable tr:has(th .font-bold:only-child):has(td:contains('&nbsp;')) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
/* Style rows where th has a section header */
.wikitable th .font-bold {
    color: inherit;
}

/* Table section headers - blue banner style */
.wikitable tr.table-section-header,
tr.table-section-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}
.wikitable tr.table-section-header td,
.wikitable tr.table-section-header th,
tr.table-section-header td,
tr.table-section-header th {
    background: transparent !important;
    color: white !important;
    border-color: #1d4ed8 !important;
    font-weight: bold;
    font-size: 1rem;
    text-align: center !important;
    padding: 0.75em !important;
}
.wikitable tr.table-section-header td .font-bold,
.wikitable tr.table-section-header td strong,
.wikitable tr.table-section-header th .font-bold,
.wikitable tr.table-section-header th strong,
tr.table-section-header .font-bold,
tr.table-section-header strong {
    color: white !important;
}
/* Hide second cell and expand first cell */
.wikitable tr.table-section-header td:only-child,
.wikitable tr.table-section-header th:only-child {
    border: 1px solid #1d4ed8 !important;
}

/* Table of Contents */
.toc {
    background: var(--c9-table-row-odd);
    border: 1px solid var(--c9-parchment-border);
    display: inline-block;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    min-width: 200px;
}
.toc-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.toc-list {
    list-style: decimal inside;
    font-size: 0.8rem;
    color: var(--c9-link-color);
}
.toc-list li {
    padding: 0.2rem 0;
}
.toc-list a:hover {
    text-decoration: underline;
}

/* Content headers */
.content h2 {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--c9-parchment-border);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
}
.content h3 {
    font-weight: bold;
    color: var(--c9-link-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}
.content ul, .content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.content li {
    margin-bottom: 0.25rem;
}

/* Blockquote */
.content blockquote {
    border: 1px solid var(--c9-parchment-border);
    background: var(--c9-table-row-odd);
    padding: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #555;
}

/* Code blocks */
.content code {
    background: #e0e5eb;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 0.85em;
}
.content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}
.content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Note/Warning boxes */
.note-box {
    border-left: 4px solid var(--c9-accent-blue);
    background: #e8f4fd;
    padding: 1rem;
    margin: 1rem 0;
}
.warning-box {
    border-left: 4px solid var(--c9-error-red);
    background: #fef2f2;
    padding: 1rem;
    margin: 1rem 0;
}
.success-box {
    border-left: 4px solid var(--c9-success-green);
    background: #f0fdf4;
    padding: 1rem;
    margin: 1rem 0;
}

/* Sheet metadata styling */
.sheet-metadata {
    background: var(--c9-table-row-odd);
    border: 1px solid var(--c9-parchment-border);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.sheet-metadata h3 {
    margin-bottom: 0.75rem;
}
.sheet-metadata ul {
    margin-left: 1rem;
}
.sheet-metadata .wikitable th {
    font-size: 0.8rem;
    padding: 0.4rem;
}

/* Internal wiki links */
.wiki-link-internal {
    color: var(--c9-link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--c9-link-color);
}
.wiki-link-internal:hover {
    text-decoration: none;
    border-bottom: 1px solid var(--c9-link-hover);
    color: var(--c9-link-hover);
}

/* Loom video embeds */
.loom-embed {
    background: var(--c9-table-row-odd);
    border: 1px solid var(--c9-parchment-border);
    border-radius: 4px;
    padding: 0.75rem;
    margin: 1rem 0;
}
.loom-embed iframe {
    border-radius: 4px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}
.breadcrumb a {
    color: var(--c9-link-color);
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb span {
    margin: 0 0.3rem;
}

/* Page list */
.page-list {
    list-style: none;
    padding: 0;
}
.page-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.page-list li:last-child {
    border-bottom: none;
}
.page-list .page-icon {
    width: 1.5rem;
    display: inline-block;
    text-align: center;
}
.page-list .doc-icon { color: #4285f4; }
.page-list .sheet-icon { color: #34a853; }
.page-list .form-icon { color: #673ab7; }
.page-list .video-icon { color: #ea4335; }
.page-list .file-icon { color: #666; }

/* Category tags */
.category-tag {
    display: inline-block;
    background: var(--c9-medium-blue);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-right: 0.3rem;
}

/* Search results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c9-dark-blue);
    border: 1px solid var(--c9-light-blue);
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-results.active {
    display: block;
}
.search-result-item {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--c9-medium-blue);
    cursor: pointer;
}
.search-result-item:hover {
    background: var(--c9-medium-blue);
}
.search-result-item:last-child {
    border-bottom: none;
}

/* Mobile specific overrides */
@media (max-width: 768px) {
    .infobox {
        float: none;
        width: 100%;
        margin: 1em 0;
    }
    .sidebar-col {
        display: none;
    }
}

/* Office Toggle */
.office-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--c9-text-medium);
}
.office-toggle-switch {
    position: relative;
    width: 60px;
    height: 24px;
    background: var(--c9-dark-blue);
    border: 1px solid var(--c9-light-blue);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.office-toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--c9-accent-blue);
    border-radius: 50%;
    transition: all 0.3s ease;
}
.office-toggle-switch.c9b::before {
    left: 38px;
    background: #f59e0b;
}
.office-toggle-label {
    font-weight: bold;
    min-width: 28px;
    text-align: center;
}
.office-toggle-label.active {
    color: var(--c9-accent-blue);
}
.office-toggle-label.active.c9b {
    color: #f59e0b;
}

/* Office-specific content */
.c9-only, .c9b-only {
    position: relative;
}
.c9-only::before, .c9b-only::before {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
}
.c9-only::before {
    content: 'AU';
    background: var(--c9-accent-blue);
    color: white;
}
.c9b-only::before {
    content: 'BALI';
    background: #f59e0b;
    color: white;
}

/* Hide content based on office selection */
body.office-c9 .c9b-only {
    display: none;
}
body.office-c9b .c9-only {
    display: none;
}

/* Office indicator badge */
.office-badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 0.5rem;
}
.office-badge.au {
    background: var(--c9-accent-blue);
    color: white;
}
.office-badge.bali {
    background: #f59e0b;
    color: white;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    .rs-parchment {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    header, aside, footer, .wiki-tab {
        display: none;
    }
}
