/**
 * DocIt Documentation Portal Styles
 * Clean, modern styling for documentation viewing and editing
 */

/* ============================================
   CSS Variables / Theme
   ============================================ */
:root {
    --docit-primary: #2563eb;
    --docit-primary-hover: #1d4ed8;
    --docit-primary-light: #dbeafe;
    --docit-bg-primary: #ffffff;
    --docit-bg-secondary: #f8fafc;
    --docit-bg-tertiary: #f1f5f9;
    --docit-text-primary: #1e293b;
    --docit-text-secondary: #64748b;
    --docit-text-muted: #94a3b8;
    --docit-border: #e2e8f0;
    --docit-sidebar-width: 280px;
    --docit-sidebar-collapsed-width: 0px;
    --docit-header-height: 56px;
    --docit-content-max-width: 900px;
    --docit-font-sans:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    --docit-font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
}

/* ============================================
   Base Layout
   ============================================ */
.docit-app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#topnav-container .navbar {
    height: var(--docit-header-height);
}

.docit-body-layout {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.docit-sidebar {
    width: var(--docit-sidebar-width);
    background: var(--docit-bg-secondary);
    border-right: 1px solid var(--docit-border);
    overflow-y: auto;
    transition:
        width 0.3s ease,
        transform 0.3s ease;
    height: calc(100vh - var(--docit-header-height));
    position: sticky;
    top: var(--docit-header-height);
}

.docit-main {
    flex-grow: 1;
    overflow-y: auto;
    height: calc(100vh - var(--docit-header-height));
}

.docit-content {
    width: 100%;
    max-width: var(--docit-content-max-width);
    margin: 0 auto;
    padding: 2rem;
}

/* Collapsed sidebar state */
.sidebar-collapsed .docit-sidebar {
    width: var(--docit-sidebar-collapsed-width);
    transform: translateX(calc(-1 * var(--docit-sidebar-width)));
}

.sidebar-collapsed .toggle-chevron {
    transform: rotate(0deg);
}

/* ============================================
   Sidebar Navigation & TopNav
   ============================================ */
.topnav-sidebar-toggle {
    background: none;
    border: none;
    color: white;
    padding: 0 0.5rem;
}

.toggle-chevron {
    transition: transform 0.3s ease;
    transform: rotate(180deg);
}

.docit-sidebar-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.docit-nav-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--docit-border);
    background: var(--docit-bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
}

.docit-nav-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.docit-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.docit-page-toolbar {
    margin-top: -20px;
}

.docit-nav-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--docit-border);
}

.docit-book-item,
.docit-page-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    margin: 0 0.75rem 0.25rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
    color: var(--docit-text-secondary);
    text-decoration: none;
}

.docit-book-item:hover,
.docit-page-link:hover {
    background: var(--docit-bg-tertiary);
    color: var(--docit-text-primary);
}

.docit-book-item.active,
.docit-page-link.active {
    font-weight: bold;
    color: var(--docit-text-primary);
}

.docit-book-item .book-title {
    flex: 1;
    font-weight: 500;
}

/* ============================================
   Page Content
   ============================================ */
.docit-page-container {
    animation: fadeIn 0.3s ease;
}

.docit-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--docit-border);
}

.docit-page-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.docit-page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
}

.docit-page-meta {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--docit-text-muted);
}

.docit-page-meta span {
    margin-right: 1rem;
}

/* Content Styling */
.docit-content h1,
.docit-content h2,
.docit-content h3,
.docit-content h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}
.docit-content p {
    margin-bottom: 1.25rem;
}
.docit-content a {
    color: var(--docit-primary);
    text-decoration: none;
}
.docit-content a:hover {
    text-decoration: underline;
}
/*.docit-content ul,
.docit-content ol {
    margin-bottom: 1.25rem;
    padding-left: 2rem;
}*/

.docit-content code {
    background: var(--docit-bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: var(--docit-font-mono);
}
.docit-content pre {
    background: var(--docit-bg-secondary);
    border: 1px solid var(--docit-border);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

/* ============================================
   Editor Styles
   ============================================ */
.docit-edit-container {
    display: flex;
    flex-direction: column;
}
.docit-edit-header {
    background: var(--docit-bg-secondary);
    border-bottom: 1px solid var(--docit-border);
    padding: 1rem 1.5rem;
}
.docit-edit-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.docit-edit-body {
    flex-grow: 1;
}

/* ============================================
   Loading & Empty States
   ============================================ */
.docit-loading,
.docit-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--docit-text-muted);
}
.docit-empty-state i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}
.docit-empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--docit-text-primary);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.highlight .hll {
    background-color: #ffffcc;
}
.highlight {
    background: #f8f8f8;
}
.highlight .c {
    color: #408080;
    font-style: italic;
} /* Comment */
.highlight .err {
    border: 1px solid #ff0000;
} /* Error */
.highlight .k {
    color: #008000;
    font-weight: bold;
} /* Keyword */
.highlight .o {
    color: #666666;
} /* Operator */
.highlight .ch {
    color: #408080;
    font-style: italic;
} /* Comment.Hashbang */
.highlight .cm {
    color: #408080;
    font-style: italic;
} /* Comment.Multiline */
.highlight .cp {
    color: #bc7a00;
} /* Comment.Preproc */
.highlight .cpf {
    color: #408080;
    font-style: italic;
} /* Comment.PreprocFile */
.highlight .c1 {
    color: #408080;
    font-style: italic;
} /* Comment.Single */
.highlight .cs {
    color: #408080;
    font-style: italic;
} /* Comment.Special */
.highlight .gd {
    color: #a00000;
} /* Generic.Deleted */
.highlight .ge {
    font-style: italic;
} /* Generic.Emph */
.highlight .gr {
    color: #ff0000;
} /* Generic.Error */
.highlight .gh {
    color: #000080;
    font-weight: bold;
} /* Generic.Heading */
.highlight .gi {
    color: #00a000;
} /* Generic.Inserted */
.highlight .go {
    color: #888888;
} /* Generic.Output */
.highlight .gp {
    color: #000080;
    font-weight: bold;
} /* Generic.Prompt */
.highlight .gs {
    font-weight: bold;
} /* Generic.Strong */
.highlight .gu {
    color: #800080;
    font-weight: bold;
} /* Generic.Subheading */
.highlight .gt {
    color: #0044dd;
} /* Generic.Traceback */
.highlight .kc {
    color: #008000;
    font-weight: bold;
} /* Keyword.Constant */
.highlight .kd {
    color: #008000;
    font-weight: bold;
} /* Keyword.Declaration */
.highlight .kn {
    color: #008000;
    font-weight: bold;
} /* Keyword.Namespace */
.highlight .kp {
    color: #008000;
} /* Keyword.Pseudo */
.highlight .kr {
    color: #008000;
    font-weight: bold;
} /* Keyword.Reserved */
.highlight .kt {
    color: #b00040;
} /* Keyword.Type */
.highlight .m {
    color: #666666;
} /* Literal.Number */
.highlight .s {
    color: #ba2121;
} /* Literal.String */
.highlight .na {
    color: #7d9029;
} /* Name.Attribute */
.highlight .nb {
    color: #008000;
} /* Name.Builtin */
.highlight .nc {
    color: #0000ff;
    font-weight: bold;
} /* Name.Class */
.highlight .no {
    color: #880000;
} /* Name.Constant */
.highlight .nd {
    color: #aa22ff;
} /* Name.Decorator */
.highlight .ni {
    color: #999999;
    font-weight: bold;
} /* Name.Entity */
.highlight .ne {
    color: #d2413a;
    font-weight: bold;
} /* Name.Exception */
.highlight .nf {
    color: #0000ff;
} /* Name.Function */
.highlight .nl {
    color: #a0a000;
} /* Name.Label */
.highlight .nn {
    color: #0000ff;
    font-weight: bold;
} /* Name.Namespace */
.highlight .nt {
    color: #008000;
    font-weight: bold;
} /* Name.Tag */
.highlight .nv {
    color: #19177c;
} /* Name.Variable */
.highlight .ow {
    color: #aa22ff;
    font-weight: bold;
} /* Operator.Word */
.highlight .w {
    color: #bbbbbb;
} /* Text.Whitespace */
.highlight .mb {
    color: #666666;
} /* Literal.Number.Bin */
.highlight .mf {
    color: #666666;
} /* Literal.Number.Float */
.highlight .mh {
    color: #666666;
} /* Literal.Number.Hex */
.highlight .mi {
    color: #666666;
} /* Literal.Number.Integer */
.highlight .mo {
    color: #666666;
} /* Literal.Number.Oct */
.highlight .sa {
    color: #ba2121;
} /* Literal.String.Affix */
.highlight .sb {
    color: #ba2121;
} /* Literal.String.Backtick */
.highlight .sc {
    color: #ba2121;
} /* Literal.String.Char */
.highlight .dl {
    color: #ba2121;
} /* Literal.String.Delimiter */
.highlight .sd {
    color: #ba2121;
    font-style: italic;
} /* Literal.String.Doc */
.highlight .s2 {
    color: #ba2121;
} /* Literal.String.Double */
.highlight .se {
    color: #bb6622;
    font-weight: bold;
} /* Literal.String.Escape */
.highlight .sh {
    color: #ba2121;
} /* Literal.String.Heredoc */
.highlight .si {
    color: #bb6688;
    font-weight: bold;
} /* Literal.String.Interpol */
.highlight .sx {
    color: #008000;
} /* Literal.String.Other */
.highlight .sr {
    color: #bb6688;
} /* Literal.String.Regex */
.highlight .s1 {
    color: #ba2121;
} /* Literal.String.Single */
.highlight .ss {
    color: #19177c;
} /* Literal.String.Symbol */
.highlight .bp {
    color: #008000;
} /* Name.Builtin.Pseudo */
.highlight .fm {
    color: #0000ff;
} /* Name.Function.Magic */
.highlight .vc {
    color: #19177c;
} /* Name.Variable.Class */
.highlight .vg {
    color: #19177c;
} /* Name.Variable.Global */
.highlight .vi {
    color: #19177c;
} /* Name.Variable.Instance */
.highlight .vm {
    color: #19177c;
} /* Name.Variable.Magic */
.highlight .il {
    color: #666666;
} /* Literal.Number.Integer.Long */
