/* retoor <retoor@molodetz.nl> */
/* DWN Documentation Styles */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --bg-code: #0d1117;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --accent: #4a90d9;
    --accent-hover: #5da0e9;
    --border-color: #2d3748;
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 5px;
}

.sidebar-header .version {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-section {
    margin-bottom: 10px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-link {
    display: block;
    padding: 8px 20px 8px 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--bg-tertiary);
    color: var(--accent);
    border-left-color: var(--accent);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

.page-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.page-header .lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

h2 {
    font-size: 1.75rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

h3 {
    font-size: 1.35rem;
    margin: 30px 0 15px;
    color: var(--text-primary);
}

h4 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
    color: var(--text-secondary);
}

p {
    margin-bottom: 15px;
}

ul, ol {
    margin: 0 0 20px 25px;
}

li {
    margin-bottom: 8px;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

pre {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-secondary);
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.shortcut-table code {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-get { background: var(--success); color: #000; }
.badge-post { background: var(--accent); color: #fff; }
.badge-required { background: var(--error); color: #fff; }
.badge-optional { background: var(--text-muted); color: #fff; }

.method-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 25px 0;
    overflow: hidden;
}

.method-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.method-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
}

.method-body {
    padding: 20px;
}

.param-table {
    margin: 15px 0;
}

.param-table th {
    background: var(--bg-primary);
}

.example-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: -1px;
}

.example-tab {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.example-tab:hover,
.example-tab.active {
    background: var(--bg-code);
    color: var(--text-primary);
}

.example-content {
    display: none;
}

.example-content.active {
    display: block;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(74, 144, 217, 0.1);
    border-color: var(--accent);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    border-color: var(--warning);
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border-color: var(--success);
}

.toc {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.toc-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin: 5px 0;
}

.toc-list a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--accent);
    color: #fff;
}

.code-block {
    position: relative;
}

.search-box {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-input::placeholder {
    color: var(--text-muted);
}

footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 20px;
    }

    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 200;
        padding: 10px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        color: var(--text-primary);
        cursor: pointer;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
}

.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero .tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-start {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    margin: 40px 0;
}

.quick-start h3 {
    margin-top: 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin: 20px 0;
}

.step-num {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.anchor {
    color: var(--text-muted);
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

h2:hover .anchor,
h3:hover .anchor {
    opacity: 1;
}
