/* Modern Documentation Styles - Works for both LTR and RTL */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-sidebar: #1a202c;
    --bg-sidebar-hover: #2d3748;
    --bg-sidebar-active: #667eea;
    --border-color: #e2e8f0;
    --code-bg: #f7fafc;
    --code-border: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Language Bar */
.doc-langbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.doc-logo img {
    height: 32px;
    display: block;
    transition: var(--transition);
}

.doc-logo img:hover {
    opacity: 0.8;
}

.doc-langlinks {
    display: flex;
    gap: 12px;
    align-items: center;
}

.doc-langlinks a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
}

.doc-langlinks a:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.doc-langlinks a strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Wrapper */
.wrapper {
    padding-top: 60px;
    min-height: 100vh;
}

/* Sidebar Styles */
.left-side {
    position: fixed;
    left: 0;
    top: 60px;
    width: var(--sidebar-width);
    height: calc(100vh - 60px);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #2d3748 100%);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: var(--transition);
}

.left-side::-webkit-scrollbar {
    width: 6px;
}

.left-side::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.left-side::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.left-side::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.left-content {
    padding: 20px 0;
}

.left-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.left-content ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.left-content ul li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.left-content ul li.active {
    background-color: var(--bg-sidebar-active);
    border-left: 3px solid #fff;
}

.left-content ul li.active > a {
    color: #fff;
    font-weight: 600;
}

.left-content ul li a {
    color: rgba(255, 255, 255, 0.85);
    display: block;
    padding: 12px 24px;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: var(--transition);
}

.left-content ul li a:hover {
    color: #fff;
    padding-left: 28px;
}

.left-content ul li.active a:hover {
    padding-left: 24px;
}

.left-content .p-3 {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.left-content .p-3 a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.left-content .p-3 a:hover {
    color: #fff;
}

/* Right Side Content */
.right-side {
    padding-left: var(--sidebar-width);
    min-height: calc(100vh - 60px);
}

.right-content {
    padding: 60px 80px;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

/* Common Section Styles */
.common_section {
    margin-bottom: 60px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bit_title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.bit_title.underline {
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 16px;
    margin-bottom: 32px;
}

.common_section h2 {
    font-size: 28px;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.3;
}

.common_section h3 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.4;
}

.common_section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.common_section h5 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.common_section p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 16px;
}

.common_section ul,
.common_section ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.common_section li {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.common_section ul li {
    list-style: none;
    position: relative;
    padding-left: 24px;
}

.common_section ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.common_section ol li {
    padding-left: 8px;
}

.common_section code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    color: #e83e8c;
    word-break: break-word;
}

.common_section pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

.common_section pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

.common_section strong {
    font-weight: 600;
    color: var(--text-primary);
}

.common_section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.common_section a:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-dark);
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-right: 12px;
    box-shadow: var(--shadow-sm);
}

/* RTL Support */
html[dir="rtl"] .left-side {
    left: auto;
    right: 0;
    border-left: none;
    border-right: 3px solid transparent;
}

html[dir="rtl"] .left-content ul li.active {
    border-left: none;
    border-right: 3px solid #fff;
}

html[dir="rtl"] .left-content ul li a:hover {
    padding-left: 24px;
    padding-right: 28px;
}

html[dir="rtl"] .left-content ul li.active a:hover {
    padding-right: 24px;
}

html[dir="rtl"] .right-side {
    padding-left: 0;
    padding-right: var(--sidebar-width);
}

html[dir="rtl"] .right-content {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .common_section {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .common_section h1,
html[dir="rtl"] .common_section h2,
html[dir="rtl"] .common_section h3,
html[dir="rtl"] .common_section h4,
html[dir="rtl"] .common_section h5,
html[dir="rtl"] .common_section h6 {
    text-align: right;
}

html[dir="rtl"] .common_section p {
    text-align: right;
}

html[dir="rtl"] .common_section ul,
html[dir="rtl"] .common_section ol {
    padding-right: 24px;
    padding-left: 0;
}

html[dir="rtl"] .common_section ul li {
    padding-right: 24px;
    padding-left: 0;
}

html[dir="rtl"] .common_section ul li::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .common_section ol li {
    padding-right: 8px;
    padding-left: 0;
}

html[dir="rtl"] .step-number {
    margin-right: 0;
    margin-left: 12px;
}

html[dir="rtl"] .doc-langbar {
    flex-direction: row-reverse;
}

html[dir="rtl"] code,
html[dir="rtl"] pre {
    direction: ltr;
    text-align: left;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .right-content {
        padding: 40px 50px;
    }
}

@media (max-width: 768px) {
    .left-side {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .left-side.open {
        transform: translateX(0);
    }
    
    html[dir="rtl"] .left-side {
        transform: translateX(100%);
    }
    
    html[dir="rtl"] .left-side.open {
        transform: translateX(0);
    }
    
    .right-side {
        padding-left: 0;
    }
    
    html[dir="rtl"] .right-side {
        padding-right: 0;
    }
    
    .right-content {
        padding: 30px 24px;
    }
    
    .bit_title {
        font-size: 28px;
    }
    
    .common_section h2 {
        font-size: 24px;
    }
    
    .common_section h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .doc-langbar {
        padding: 10px 16px;
    }
    
    .right-content {
        padding: 24px 16px;
    }
    
    .bit_title {
        font-size: 24px;
    }
    
    .common_section h2 {
        font-size: 22px;
    }
    
    .common_section h3 {
        font-size: 18px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* Print Styles */
@media print {
    .left-side,
    .doc-langbar {
        display: none;
    }
    
    .right-side {
        padding: 0;
    }
    
    .right-content {
        padding: 20px;
        max-width: 100%;
    }
}

