/* Modern mdBook Theme for Portctl */

:root {
    --bg: #0f172a;
    --fg: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-fg: #94a3b8;
    --sidebar-active: #38bdf8;
    --link-color: #38bdf8;
    --code-bg: #1e293b;
    --quote-bg: #1e293b;
    --quote-border: #38bdf8;
    --heading-color: #f8fafc;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
}

/* Typography */
body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--fg);
    background-color: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--heading-color);
    margin-top: 2em;
}

h1 { font-size: 2.5rem; letter-spacing: -0.025em; border-bottom: none; }
h2 { font-size: 1.75rem; letter-spacing: -0.025em; border-bottom: 1px solid #334155; padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; }

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid #334155;
}

.sidebar-scrollbox {
    padding: 1rem;
}

.chapter li a {
    color: var(--sidebar-fg);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.chapter li a:hover {
    background-color: #334155;
    color: #f1f5f9;
    text-decoration: none;
}

.chapter li a.active {
    color: var(--sidebar-active);
    background-color: rgba(56, 189, 248, 0.1);
    font-weight: 600;
}

/* Content Area */
.content {
    padding: 0 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Code Blocks */
pre {
    background-color: var(--code-bg) !important;
    border-radius: 0.5rem;
    border: 1px solid #334155;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: #e2e8f0;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* Blockquotes / Alerts */
blockquote {
    background-color: var(--quote-bg);
    border-left: 4px solid var(--quote-border);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #cbd5e1;
}

/* Tables */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 2rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #334155;
}

th {
    background-color: #1e293b;
    color: #f8fafc;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
    color: #cbd5e1;
}

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

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Buttons (if any) */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #38bdf8;
    color: #0f172a;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:hover {
    background-color: #7dd3fc;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
