/* ══════════════════════════════════════════
   DoHub Shared Sidebar — all product pages
   ══════════════════════════════════════════ */

.dohub-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    background: var(--surface, #121825);
    border-right: 1px solid var(--border, #2a3550);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease;
}

.dohub-sidebar-brand {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, #2a3550);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dohub-sidebar-brand a {
    font-family: 'Almarai', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text, #e8ecf4);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.dohub-sidebar-brand a span {
    color: var(--accent, #00e4b8);
}

/* Product navigation dropdown */
.dohub-sidebar-navigate {
    padding: 12px;
    border-bottom: 1px solid var(--border, #2a3550);
}

.dohub-nav-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted, #7a8baa);
    margin-bottom: 6px;
    padding-left: 2px;
}

.dohub-sidebar-navigate select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2, #1a2233);
    border: 1px solid var(--border, #2a3550);
    border-radius: 10px;
    color: var(--text, #e8ecf4);
    font-family: 'Almarai', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8baa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s;
}

.dohub-sidebar-navigate select:hover,
.dohub-sidebar-navigate select:focus {
    border-color: var(--accent, #00e4b8);
    outline: none;
}

.dohub-sidebar-navigate select option {
    background: var(--surface, #121825);
    color: var(--text, #e8ecf4);
    padding: 8px;
}

/* Bottom link (Buy Credits) */
.dohub-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted, #7a8baa);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.dohub-sidebar-link:hover {
    background: var(--surface-2, #1a2233);
    color: var(--accent, #00e4b8);
}

/* Product-specific content area (history list, etc.) */
.dohub-sidebar-content {
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid var(--border, #2a3550);
}

/* Bottom section: lang picker + credits */
.dohub-sidebar-bottom {
    border-top: 1px solid var(--border, #2a3550);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dohub-sidebar-credits {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted, #7a8baa);
    padding: 4px 4px;
}

.dohub-sidebar-credits a {
    color: var(--accent, #00e4b8);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
}

.dohub-sidebar-credits a:hover {
    text-decoration: underline;
}

/* User panel */
.dohub-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-top: 1px solid var(--border, #2a3550);
}

.dohub-sidebar-user img {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border, #2a3550);
}

.dohub-sidebar-user .user-info {
    flex: 1; min-width: 0;
}

.dohub-sidebar-user .user-name {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dohub-sidebar-user .user-credits {
    font-family: 'JetBrains Mono', 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent, #00e4b8);
}

.dohub-sidebar-user .logout-btn {
    background: none; border: none;
    color: var(--text-muted, #7a8baa);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
}

.dohub-sidebar-user .logout-btn:hover {
    color: var(--danger, #ff5c6c);
}

/* Main content area — offset by sidebar width */
.dohub-main {
    margin-left: 260px;
    height: 100vh;
    overflow: auto;
    position: relative;
}

/* Mobile hamburger */
.dohub-mobile-toggle {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 300;
    background: var(--surface, #121825);
    border: 1px solid var(--border, #2a3550);
    color: var(--text, #e8ecf4);
    width: 40px; height: 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.dohub-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .dohub-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

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

    .dohub-sidebar-overlay.open {
        display: block;
    }

    .dohub-mobile-toggle {
        display: flex;
    }

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

/* ── RTL Support ── */
[dir="rtl"] .dohub-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border, #2a3550);
}

[dir="rtl"] .dohub-main {
    margin-left: 0;
    margin-right: 260px;
}

[dir="rtl"] .dohub-mobile-toggle {
    left: auto;
    right: 12px;
}

[dir="rtl"] .dohub-sidebar-navigate select {
    background-position: left 12px center;
    padding-left: 32px;
    padding-right: 12px;
}

@media (max-width: 768px) {
    [dir="rtl"] .dohub-sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .dohub-sidebar.open {
        transform: translateX(0);
    }

    [dir="rtl"] .dohub-main {
        margin-right: 0;
    }
}
