/* AlphaDesk Documentation Styles - Interactive Brokers Inspired */

:root {
    --ib-navy: #003d82;
    --ib-navy-dark: #002855;
    --ib-navy-light: #0055aa;
    --ib-blue: #0088cc;
    --ib-gray: #f5f7fa;
    --ib-border: #dde2e8;
    --ib-text: #333333;
    --ib-text-light: #666666;
    --sidebar-width: 280px;
    --header-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--ib-text);
    background: #ffffff;
}

/* Documentation Header */
.docs-header {
    background: var(--ib-navy);
    color: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--ib-navy-light);
}

.docs-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 2rem;
    max-width: 100%;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.docs-logo i {
    font-size: 1.8rem;
}

.docs-nav {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.docs-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.docs-nav a:hover,
.docs-nav a.active {
    color: white;
}

.back-to-main {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.back-to-main:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Documentation Layout */
.docs-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Left Sidebar */
.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--ib-gray);
    border-right: 1px solid var(--ib-border);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 2rem 0;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ib-text-light);
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    color: var(--ib-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: white;
    color: var(--ib-navy);
}

.sidebar-menu a.active {
    background: white;
    color: var(--ib-navy);
    border-left-color: var(--ib-navy);
    font-weight: 600;
}

.sidebar-menu a i {
    margin-right: 0.75rem;
    width: 1.2rem;
    text-align: center;
    color: var(--ib-navy-light);
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    margin-left: 2rem;
    margin-top: 0.25rem;
}

.sidebar-submenu a {
    padding: 0.4rem 1.5rem;
    font-size: 0.9rem;
}

/* Main Content */
.docs-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 3rem;
    max-width: 900px;
}

.docs-content h1 {
    font-size: 2.5rem;
    color: var(--ib-navy);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.docs-content h2 {
    font-size: 1.8rem;
    color: var(--ib-navy);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ib-border);
}

.docs-content h3 {
    font-size: 1.4rem;
    color: var(--ib-navy-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.docs-content h4 {
    font-size: 1.1rem;
    color: var(--ib-navy-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.docs-subtitle {
    font-size: 1.2rem;
    color: var(--ib-text-light);
    margin-bottom: 2rem;
}

.docs-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.docs-content a {
    color: var(--ib-blue);
    text-decoration: none;
}

.docs-content a:hover {
    text-decoration: underline;
}

/* Code Blocks */
.docs-content pre {
    background: #f6f8fa;
    border: 1px solid var(--ib-border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.docs-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #f6f8fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.docs-content pre code {
    background: none;
    padding: 0;
}

/* Info Boxes */
.info-box {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box-note {
    background: #e8f4fd;
    border-left-color: var(--ib-blue);
}

.info-box-warning {
    background: #fff4e6;
    border-left-color: #ff9800;
}

.info-box-success {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.info-box-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* API Reference Styles */
.api-endpoint {
    background: white;
    border: 1px solid var(--ib-border);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.api-method {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 1rem;
}

.method-get {
    background: #e8f5e9;
    color: #2e7d32;
}

.method-post {
    background: #e3f2fd;
    color: #1565c0;
}

.method-put {
    background: #fff4e6;
    color: #f57c00;
}

.method-delete {
    background: #ffebee;
    color: #c62828;
}

.api-path {
    font-family: 'SFMono-Regular', monospace;
    font-size: 1.1rem;
    color: var(--ib-navy-dark);
}

.api-description {
    margin: 1rem 0;
    color: var(--ib-text-light);
}

.api-section {
    margin: 1.5rem 0;
}

.api-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ib-navy);
    margin-bottom: 0.75rem;
}

.api-params {
    list-style: none;
    padding: 0;
}

.api-param {
    padding: 0.75rem;
    border-bottom: 1px solid var(--ib-border);
}

.api-param:last-child {
    border-bottom: none;
}

.param-name {
    font-family: 'SFMono-Regular', monospace;
    font-weight: 700;
    color: var(--ib-navy-dark);
}

.param-type {
    color: var(--ib-blue);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.param-required {
    color: #c62828;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.param-description {
    margin-top: 0.25rem;
    color: var(--ib-text-light);
    font-size: 0.95rem;
}

/* Tables */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.docs-content th {
    background: var(--ib-gray);
    padding: 0.75rem;
    text-align: left;
    font-weight: 700;
    color: var(--ib-navy);
    border: 1px solid var(--ib-border);
}

.docs-content td {
    padding: 0.75rem;
    border: 1px solid var(--ib-border);
}

.docs-content tr:nth-child(even) {
    background: #fafbfc;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--ib-navy);
    color: white;
}

.btn-primary:hover {
    background: var(--ib-navy-light);
}

.btn-secondary {
    background: white;
    color: var(--ib-navy);
    border: 2px solid var(--ib-navy);
}

.btn-secondary:hover {
    background: var(--ib-navy);
    color: white;
}

/* Footer */
.docs-footer {
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    background: var(--ib-gray);
    border-top: 1px solid var(--ib-border);
    text-align: center;
    color: var(--ib-text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    .docs-main {
        margin-left: 0;
        padding: 2rem;
    }

    .docs-footer {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .docs-header-content {
        padding: 0 1rem;
    }

    .docs-logo {
        font-size: 1.2rem;
    }

    .docs-nav {
        display: none;
    }

    .docs-main {
        padding: 1.5rem;
    }

    .docs-content h1 {
        font-size: 2rem;
    }

    .docs-content h2 {
        font-size: 1.5rem;
    }
}
