/* Documentation Styles */
:root {
    /* Light theme colors */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #666;
    --border-color: #e1e8ed;
    --accent-color: #1a73e8;
    --accent-bg: #e8f0fe;
    --code-bg: #ffffff;
    --code-text: #24292e;
    --code-inline-bg: #f6f8fa;
    --code-inline-text: #0969da;
    --sidebar-bg: #ffffff;
    --hover-bg: #f8f9fa;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #7d8590;
    --border-color: #30363d;
    --accent-color: #58a6ff;
    --accent-bg: #1c2128;
    --code-bg: #0d1117;
    --code-text: #f0f6fc;
    --code-inline-bg: #21262d;
    --code-inline-text: #79c0ff;
    --sidebar-bg: #161b22;
    --hover-bg: #21262d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

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



.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-header .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-color), #4285f4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.sidebar-header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.version {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    border: 1px solid var(--border-color);
}

.theme-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
    border-color: var(--accent-color);
}


.sidebar-content {
    padding: 16px 0;
}

.section {
    margin-bottom: 24px;
}

.section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section ul {
    list-style: none;
}

.section ul li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 8px 20px 8px 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

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

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

/* Main Content Styles */
.content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
}

.content-wrapper {
    max-width: 1000px;
    padding: 32px 40px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    padding: 0;
    border: none;
}

.page-header .page-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.title-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.title-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.logo-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.logo-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Typography */
h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 16px 0;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px 0;
}

h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 8px 0;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Code Styles */
pre {
    background: var(--code-bg) !important;
    color: var(--code-text) !important;
    border-radius: 8px;
    padding: 40px 16px 16px 16px;
    margin: 16px 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    white-space: pre !important;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Code copy button */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    color: var(--code-text);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.8;
    transition: all 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.copy-btn:hover {
    opacity: 1;
    background: var(--hover-bg);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.copy-btn:active {
    transform: scale(0.95);
}

code {
    background: var(--code-inline-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    color: var(--code-inline-text);
    word-break: keep-all;
    white-space: nowrap;
}

pre code {
    background: none !important;
    padding: 0;
    color: var(--code-text) !important;
    font-size: 14px;
    white-space: pre !important;
    display: block;
    overflow-x: visible;
    transition: color 0.3s ease;
    word-wrap: normal;
    word-break: normal;
    min-width: max-content;
}

/* Lists */
ul, ol {
    margin: 16px 0;
    padding-left: 24px;
}

ul li, ol li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

ul li strong, ol li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Sections */
section {
    margin-bottom: 48px;
    scroll-margin-top: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

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

td {
    color: var(--text-secondary);
}

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

a:hover {
    text-decoration: underline;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    align-items: center;
    padding: 0 60px 0 20px;
}

.mobile-header h1 {
    font-size: 18px;
    margin: 0;
    color: var(--accent-color);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

/* Pyrogram-style responsive design */

/* Desktop (1024px+): Always show sidebar */
@media (min-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(0);
    }
    
    .content {
        margin-left: 280px;
    }
    
    .hamburger {
        display: none;
    }
    
    .mobile-overlay {
        display: none;
    }
}

/* Tablet and Mobile (0-1023px): Hamburger menu */
@media (max-width: 1023px) {
    .hamburger {
        display: flex !important;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1001;
        width: 44px;
        height: 44px;
        font-size: 18px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
        padding-top: 60px;
    }
    
    .content-wrapper {
        padding: 20px 24px !important;
        max-width: 100%;
    }
    
    /* Mobile/tablet specific styles */
    .header {
        display: none;
    }
    
    .page-header {
        margin-bottom: 32px;
        padding-bottom: 16px;
    }
    
    .page-header h1 {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .page-header .page-description {
        font-size: 16px;
        line-height: 1.5;
    }
    
    .nav-link {
        padding: 12px 20px 12px 32px;
        font-size: 15px;
    }
    
    .section h3 {
        font-size: 15px;
        padding: 12px 20px;
    }
    
    .content-wrapper {
        padding: 20px 15px;
        max-width: 100%;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    h2 {
        font-size: 20px;
        margin: 24px 0 12px 0;
    }
    
    h3 {
        font-size: 18px;
        margin: 20px 0 10px 0;
    }
    
    pre {
        font-size: 13px;
        padding: 36px 16px 16px 16px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        margin: 16px 0;
        border-radius: 6px;
        -webkit-overflow-scrolling: touch;
        white-space: pre !important;
        width: 100%;
        max-width: calc(100vw - 48px);
    }
    
    pre code {
        font-size: 13px;
        white-space: pre !important;
        display: block;
        overflow-x: visible;
        word-wrap: normal;
        word-break: normal;
        min-width: max-content;
    }
    
    code {
        font-size: 12px;
        word-break: keep-all;
        white-space: nowrap;
        padding: 1px 4px;
    }
    
    .copy-btn {
        font-size: 11px;
        padding: 4px 6px;
        top: 6px;
        right: 6px;
    }
    
    .section {
        margin-bottom: 32px;
    }
    
    /* Sayfayı tam genişliğe sığdır */
    .content-wrapper {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Yatay scrollbar'ı önle */
    body {
        overflow-x: hidden;
    }
}

/* Hamburger menu - Pyrogram style (only on mobile/tablet) */
.hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 16px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.hamburger:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
}

.hamburger:active {
    transform: scale(0.95);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hide hamburger when sidebar is active */
.sidebar.active ~ .hamburger {
    opacity: 0;
    pointer-events: none;
}

body.menu-open .hamburger {
    opacity: 0;
    pointer-events: none;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Search Box */
.search-box {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    margin-left: 8px;
}

.badge.async {
    background: #e8f5e8;
    color: #2d7d32;
}

.badge.deprecated {
    background: #fff3e0;
    color: #ef6c00;
}

.badge.new {
    background: #e3f2fd;
    color: #1976d2;
}

/* Prism.js Syntax Highlighting - Light Theme Override */
:root pre[class*="language-"] {
    background: var(--code-bg) !important;
    color: var(--code-text) !important;
}

:root code[class*="language-"] {
    color: var(--code-text) !important;
}

/* Prism Token Colors - Light Theme */
:root .token.comment,
:root .token.prolog,
:root .token.doctype,
:root .token.cdata {
    color: #6a737d !important;
    font-style: italic;
}

:root .token.punctuation {
    color: #24292e !important;
}

:root .token.property,
:root .token.tag,
:root .token.boolean,
:root .token.number,
:root .token.constant,
:root .token.symbol,
:root .token.deleted {
    color: #005cc5 !important;
}

:root .token.selector,
:root .token.attr-name,
:root .token.string,
:root .token.char,
:root .token.builtin,
:root .token.inserted {
    color: #032f62 !important;
}

:root .token.operator,
:root .token.entity,
:root .token.url,
:root .language-css .token.string,
:root .style .token.string {
    color: #d73a49 !important;
}

:root .token.atrule,
:root .token.attr-value,
:root .token.keyword {
    color: #d73a49 !important;
}

:root .token.function,
:root .token.class-name {
    color: #6f42c1 !important;
}

:root .token.regex,
:root .token.important,
:root .token.variable {
    color: #e36209 !important;
}

/* Prism Token Colors - Dark Theme */
[data-theme="dark"] pre[class*="language-"] {
    background: var(--code-bg) !important;
    color: var(--code-text) !important;
}

[data-theme="dark"] code[class*="language-"] {
    color: var(--code-text) !important;
}

[data-theme="dark"] .token.comment,
[data-theme="dark"] .token.prolog,
[data-theme="dark"] .token.doctype,
[data-theme="dark"] .token.cdata {
    color: #8b949e !important;
    font-style: italic;
}

[data-theme="dark"] .token.punctuation {
    color: #f0f6fc !important;
}

[data-theme="dark"] .token.property,
[data-theme="dark"] .token.tag,
[data-theme="dark"] .token.boolean,
[data-theme="dark"] .token.number,
[data-theme="dark"] .token.constant,
[data-theme="dark"] .token.symbol,
[data-theme="dark"] .token.deleted {
    color: #79c0ff !important;
}

[data-theme="dark"] .token.selector,
[data-theme="dark"] .token.attr-name,
[data-theme="dark"] .token.string,
[data-theme="dark"] .token.char,
[data-theme="dark"] .token.builtin,
[data-theme="dark"] .token.inserted {
    color: #a5d6ff !important;
}

[data-theme="dark"] .token.operator,
[data-theme="dark"] .token.entity,
[data-theme="dark"] .token.url,
[data-theme="dark"] .language-css .token.string,
[data-theme="dark"] .style .token.string {
    color: #ff7b72 !important;
}

[data-theme="dark"] .token.atrule,
[data-theme="dark"] .token.attr-value,
[data-theme="dark"] .token.keyword {
    color: #ff7b72 !important;
}

[data-theme="dark"] .token.function,
[data-theme="dark"] .token.class-name {
    color: #d2a8ff !important;
}

[data-theme="dark"] .token.regex,
[data-theme="dark"] .token.important,
[data-theme="dark"] .token.variable {
    color: #ffa657 !important;
}