/* WorkTraq Custom Theme for mdBook
 * Matches the WorkTraq webapp styling
 */

/* Import Open Sans font */
@import url('https://fonts.bunny.net/css?family=open-sans:300,300i,400,400i,500,500i&display=swap');

/* WorkTraq Brand Colors */
:root {
    --forestgreen: #005437;
    --orchid: #DEBAD6;
    --indigo: #340744;
    --violet: #741AAC;
    --red: #C2185B;
    --oranje: #FF8F00;
    --white: #ffffff;
    --white-ter: #f5f5f5;
    --white-bis: #fafafa;
}

/* Override mdBook CSS variables for light theme */
.light {
    --bg: var(--white);
    --fg: #4a4a4a;

    --sidebar-bg: var(--violet);
    --sidebar-fg: var(--white);
    --sidebar-non-existant: rgba(255, 255, 255, 0.5);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --sidebar-spacer: rgba(255, 255, 255, 0.3);

    --scrollbar: var(--orchid);

    --icons: var(--violet);
    --icons-hover: var(--indigo);

    --links: var(--forestgreen);

    --inline-code-color: var(--indigo);

    --theme-popup-bg: var(--white);
    --theme-popup-border: #ccc;
    --theme-hover: var(--white-ter);

    --quote-bg: var(--white-ter);
    --quote-border: var(--violet);

    --table-border-color: #dbdbdb;
    --table-header-bg: var(--white-ter);
    --table-alternate-bg: var(--white-bis);

    --searchbar-border-color: #dbdbdb;
    --searchbar-bg: var(--white);
    --searchbar-fg: var(--indigo);
    --searchbar-shadow-color: rgba(0, 0, 0, 0.1);
    --searchresults-header-fg: var(--indigo);
    --searchresults-border-color: #dbdbdb;
    --searchresults-li-bg: var(--white-ter);
    --search-mark-bg: var(--orchid);
}

/* Base typography - only override font-family, keep mdbook's font-size */
html {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
}

/* Headings - match WorkTraq style */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    color: var(--indigo);
}

h1 {
    margin-top: 0;
}

h2 {
    border-bottom: 1px solid var(--orchid);
    padding-bottom: 0.5rem;
}

/* Sidebar styling */
.sidebar {
    font-size: 1.5rem;
}

.sidebar .sidebar-scrollbox {
    padding: 1rem;
}

.sidebar ol.chapter {
    padding-left: 0;
}

.sidebar ol.chapter li.chapter-item {
    margin-top: 0.5rem;
}

.sidebar ol.chapter li.chapter-item a {
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: block;
    transition: background-color 0.2s ease;
}

.sidebar ol.chapter li.chapter-item a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.sidebar ol.chapter li.chapter-item.expanded > a,
.sidebar ol.chapter li.chapter-item a.active {
    background-color: rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

/* Nested chapters */
.sidebar ol.chapter li.chapter-item ol.section {
    padding-left: 1rem;
}

.sidebar ol.chapter li.chapter-item ol.section li {
    margin-top: 0.25rem;
}

.sidebar ol.chapter li.chapter-item ol.section a {
    font-size: 1.4rem;
    padding: 0.4rem 0.75rem;
}

/* Sidebar title */
.sidebar .sidebar-scrollbox .sidebar-title {
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* Menu bar / header */
#menu-bar {
    background-color: var(--white);
    border-bottom: 1px solid #dbdbdb;
}

#menu-bar .icon-button {
    color: var(--violet);
}

#menu-bar .icon-button:hover {
    color: var(--indigo);
}

/* Main content area */
.content {
    max-width: 900px;
    padding: 1.5rem 2rem;
}

.content main {
    margin-top: 0;
}

/* Links */
a {
    color: var(--forestgreen);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Code blocks */
pre {
    background-color: var(--white-ter);
    border-radius: 4px;
    padding: 1rem;
    border: 1px solid #dbdbdb;
}

code {
    font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

:not(pre) > code {
    background-color: var(--white-ter);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: var(--indigo);
}

/* Tables - Bulma style */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table thead th {
    background-color: var(--white-ter);
    border-bottom: 2px solid #dbdbdb;
    padding: 0.75rem;
    text-align: left;
    color: var(--indigo);
    font-weight: 500;
}

table tbody td {
    border-bottom: 1px solid #dbdbdb;
    padding: 0.75rem;
}

table tbody tr:hover {
    background-color: var(--white-bis);
}

/* Blockquotes - styled like Bulma messages */
blockquote {
    background-color: var(--white-ter);
    border-left: 4px solid var(--violet);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

blockquote p {
    margin: 0;
}

/* Info/warning/tip boxes using blockquotes with emoji */
blockquote:has(p:first-child:starts-with("")) {
    border-left-color: #3298dc;
    background-color: #f5f9fc;
}

/* Hide all chapter navigation */
.nav-chapters,
.nav-wrapper {
    display: none;
}

/* Search */
#searchbar {
    border-radius: 4px;
    border: 1px solid #dbdbdb;
    padding: 0.5rem 0.75rem;
}

#searchbar:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 2px rgba(116, 26, 172, 0.2);
    outline: none;
}

/* Search results */
.searchresults-outer {
    border-radius: 4px;
}

#searchresults li.active {
    background-color: var(--orchid);
}

/* Buttons - Bulma style */
.button, button {
    border-radius: 4px;
    font-weight: 400;
}

/* Print styles */
@media print {
    .sidebar,
    #menu-bar,
    .nav-chapters {
        display: none;
    }

    .content {
        max-width: 100%;
    }
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }
}

/* Hide theme toggle and other unnecessary controls */
#theme-list {
    display: none;
}

.theme-toggle {
    display: none;
}
