/* Documentation Page Styles */
.docs-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 120px auto 80px;
    padding: 0 2rem;
}

.docs-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-nav h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-gray);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-nav h3:first-child {
    margin-top: 0;
}

.docs-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-nav ul li {
    margin-bottom: 0.5rem;
}

.docs-nav a {
    display: block;
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.docs-nav a:hover,
.docs-nav a.active {
    color: var(--primary-color);
    background: rgba(204, 0, 85, 0.1);
}

/* LTR hover - move right */
[dir="ltr"] .docs-nav a:hover,
[dir="ltr"] .docs-nav a.active {
    transform: translateX(5px);
}

/* RTL hover - move left */
[dir="rtl"] .docs-nav a:hover,
[dir="rtl"] .docs-nav a.active {
    transform: translateX(-5px);
}

.docs-content {
    max-width: 900px;
}

.docs-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.doc-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.doc-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.doc-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-section p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-gray);
}

.doc-section ul,
.doc-section ol {
    margin: 1rem 0 1rem 2rem;
    line-height: 1.8;
    color: var(--text-gray);
}

.doc-section li {
    margin-bottom: 0.5rem;
}

/* Document Images - Base Styles */
.doc-image {
    margin: 1.5rem 0;
    text-align: center;
}

.doc-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
}

.image-caption {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-top: 1rem;
    font-style: italic;
}

.steps-list {
    counter-reset: step-counter;
    list-style: none;
    margin: 0;
    padding: 0;
}

.steps-list li {
    counter-increment: step-counter;
    position: relative;
    padding: 1.5rem;
    padding-inline-end: 4rem;
    /* RTL: padding-right, LTR: padding-left - but we want number on start side */
    margin-bottom: 1.5rem;
    background: var(--dark-card);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    top: 1.5rem;
    inset-inline-end: 1.5rem;
    /* RTL: right, LTR: right - this is wrong, we need start */
    width: 35px;
    height: 35px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* LTR (English) - number on the left */
[dir="ltr"] .steps-list li {
    padding-left: 4rem;
    padding-right: 1.5rem;
}

[dir="ltr"] .steps-list li::before {
    left: 1.5rem;
    right: auto;
}

/* RTL (Arabic) - number on the right */
[dir="rtl"] .steps-list li {
    padding-right: 4rem;
    padding-left: 1.5rem;
}

[dir="rtl"] .steps-list li::before {
    right: 1.5rem;
    left: auto;
}

.steps-list strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.steps-list p {
    margin: 0;
}

/* Code Blocks */
.code-block {
    background: #1a1a2e;
    border-radius: 12px;
    margin: 1.5rem 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header span {
    color: var(--text-gray);
    font-size: 0.9rem;
    font-family: 'Fira Code', monospace;
}

.copy-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e8eaed;
}

code {
    background: rgba(204, 0, 85, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--primary-light);
}

/* Notes */
.note {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-inline-start: 4px solid;
    /* RTL: border-right, LTR: border-left */
}

/* LTR (English) - border on the left */
[dir="ltr"] .note {
    border-left: 4px solid;
    border-right: none;
}

/* RTL (Arabic) - border on the right */
[dir="rtl"] .note {
    border-right: 4px solid;
    border-left: none;
}

.note strong {
    display: block;
    margin-bottom: 0.5rem;
}

.note-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

.note-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
}

.note-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.note-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Tables */
.requirements-table,
.settings-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--dark-card);
    border-radius: 12px;
    overflow: hidden;
}

.requirements-table thead {
    background: rgba(204, 0, 85, 0.2);
}

.requirements-table th,
.requirements-table td,
.settings-table td {
    padding: 1rem 1.5rem;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.requirements-table th {
    font-weight: 600;
    color: var(--text-light);
}

.requirements-table td,
.settings-table td {
    color: var(--text-gray);
}

.settings-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-table tr:last-child {
    border-bottom: none;
}

/* FAQ */
.faq-item {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
}

/* LTR hover - move right */
[dir="ltr"] .faq-item:hover {
    transform: translateX(5px);
}

/* RTL hover - move left (which appears as right in RTL) */
[dir="rtl"] .faq-item:hover {
    transform: translateX(-5px);
}

.faq-item h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.faq-item p {
    margin: 0;
}

/* Troubleshooting */
.troubleshoot-item {
    background: var(--dark-card);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* LTR (English) - border on the left */
[dir="ltr"] .troubleshoot-item {
    border-left: 4px solid #ef4444;
    border-right: none;
}

/* RTL (Arabic) - border on the right */
[dir="rtl"] .troubleshoot-item {
    border-right: 4px solid #ef4444;
    border-left: none;
}

.troubleshoot-item h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #ef4444;
}

.troubleshoot-item ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 100px;
    }

    .docs-sidebar {
        position: static;
        max-height: none;
        order: -1;
    }
}

@media (max-width: 768px) {
    .docs-container {
        padding: 0 1rem;
        margin-bottom: 40px;
        margin-top: 80px;
        gap: 1.5rem;
    }

    .docs-title {
        font-size: 1.75rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .doc-section {
        margin-bottom: 2.5rem;
    }

    .doc-section h2 {
        font-size: 1.4rem;
        padding-bottom: 0.5rem;
    }

    .doc-section h3 {
        font-size: 1.15rem;
        margin-top: 1.5rem;
    }

    .doc-section h4 {
        font-size: 1.1rem;
    }

    .doc-section p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .steps-list li {
        padding: 1.25rem;
        padding-top: 3.5rem;
        margin-bottom: 1rem;
    }

    .steps-list li::before {
        top: 1rem;
        right: 50%;
        transform: translateX(50%);
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .steps-list strong {
        font-size: 1rem;
    }

    /* Sidebar Mobile Styles */
    .docs-sidebar {
        padding: 1.25rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .docs-nav h3 {
        font-size: 0.85rem;
        margin: 1.5rem 0 0.75rem;
    }

    .docs-nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
    }

    /* Responsive Tables */
    .requirements-table,
    .settings-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.9rem;
    }

    .requirements-table th,
    .requirements-table td,
    .settings-table td {
        padding: 0.75rem 1rem;
        min-width: 120px;
    }

    /* Responsive Images */
    .doc-image {
        margin: 1.25rem 0;
        overflow: hidden;
        border-radius: 10px;
    }

    .doc-image img {
        width: 100%;
        height: auto;
        border-radius: 10px;
        display: block;
    }

    .image-caption {
        font-size: 0.85rem !important;
        text-align: center;
        margin-top: 0.75rem !important;
    }

    .method-card {
        padding: 1.25rem;
        margin-top: 1.25rem !important;
    }

    .method-card h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .code-block {
        margin: 1rem 0;
        border-radius: 8px;
    }

    .code-block pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .code-header {
        padding: 0.75rem 1rem;
    }

    .code-header span {
        font-size: 0.8rem;
    }

    .copy-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Notes */
    .note {
        padding: 1rem;
        border-radius: 10px;
        margin: 1rem 0;
        font-size: 0.9rem;
    }

    .note strong {
        font-size: 0.95rem;
    }

    /* Import Methods Cards */
    .import-methods {
        margin-top: 1rem;
    }

    /* Permission Box */
    .permission-box {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .code-snippet-small {
        font-size: 0.8rem;
    }

    /* Step Items */
    .step-item {
        margin-bottom: 1.5rem;
        padding-left: 1rem;
    }

    .step-item h5 {
        font-size: 1rem;
    }

    .step-item ul,
    .step-item p {
        font-size: 0.9rem;
    }

    /* FAQ Items */
    .faq-item {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .faq-item h3 {
        font-size: 1.1rem;
    }

    /* Troubleshoot Items */
    .troubleshoot-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .troubleshoot-item h4 {
        font-size: 1rem;
    }

    /* Activation Steps */
    .activation-steps {
        padding-left: 1.25rem;
    }

    .activation-steps li {
        font-size: 0.9rem;
    }

    /* Spacer adjustments */
    .spacer {
        height: 25px !important;
    }

    /* Scroll margin for sections */
    .doc-section,
    [id] {
        scroll-margin-top: 80px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .docs-container {
        padding: 0 0.75rem;
        margin-top: 70px;
    }

    .docs-title {
        font-size: 1.5rem;
    }

    .doc-section h2 {
        font-size: 1.25rem;
    }

    .doc-section h3 {
        font-size: 1.05rem;
    }

    .docs-sidebar {
        padding: 1rem;
    }

    .docs-nav a {
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
    }

    .method-card {
        padding: 1rem;
    }

    .steps-list li {
        padding: 1rem;
        padding-top: 3rem;
    }

    .steps-list li::before {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }

    .note {
        padding: 0.875rem;
    }

    .code-block pre {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .requirements-table th,
    .requirements-table td,
    .settings-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .doc-image img {
        border-radius: 8px;
    }

    /* Hide sidebar on very small screens - show as collapsible */
    .docs-sidebar {
        max-height: 300px;
        overflow-y: auto;
    }
}


/* Detailed Guide Styles */
.permission-box {
    background: #1e293b;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.code-snippet-small {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--primary-light);
    word-break: break-all;
    margin-top: 0.5rem;
}

.step-item {
    margin-bottom: 2rem;
}

/* LTR (English) - border and padding on the left */
[dir="ltr"] .step-item {
    padding-left: 1.5rem;
    padding-right: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    border-right: none;
}

/* RTL (Arabic) - border and padding on the right */
[dir="rtl"] .step-item {
    padding-right: 1.5rem;
    padding-left: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    border-left: none;
}

.step-item h5 {
    color: var(--primary-light);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.method-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
}

.method-card h4 {
    margin-bottom: 1.5rem;
    color: white;
    border-bottom: 1px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
}