/*
 * =========================================================
 *              WEBSITE DEVELOPMENT CREDITS
 * =========================================================
 *
 * Co-Developer
 * AFM_1337_ — Md Arafat Hossen Mugdho
 * GitHub  : https://github.com/AFM-1337
 * Website : https://afm1337.shop
 * WhatsApp: https://wa.me/+8801310329198
 * Telegram: https://t.me/afm1337
 *
 * Co-Developer
 * DARK LMNx9 — Limon Hossain
 * GitHub  : https://github.com/LMNx9-JOHNY
 * Website : https://dark.lmnx9.workers.dev
 * WhatsApp: https://wa.me/+8801882168975
 * Telegram: https://t.me/x_LMNx9
 *
 * ---------------------------------------------------------
 *          Designed & Developed Together
 * =========================================================
 */

/* ============================================================
   BeBrainer SSC - Header & Navigation
   ============================================================ */

.bb-header {
    position: sticky;
    top: 0;
    z-index: 1300;
    height: var(--bb-header-h);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(86, 128, 233, 0.12);
    transition: all var(--bb-transition);
    
}

.bb-header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 30px rgba(30, 42, 74, 0.10);
    height: 64px;
}

.bb-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Logo */
.bb-logo-link {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.bb-logo-img {
    height: 40px;
    width: auto;
    transition: all var(--bb-transition);
}
.bb-header.scrolled .bb-logo-img { height: 40px; }

/* Navigation */
.bb-nav { margin-left: auto; }
.bb-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}
.bb-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--bb-radius);
    color: var(--bb-text-2);
    font-weight: 600;
    font-size: 14.5px;
    position: relative;
    transition: all var(--bb-transition);
}
.bb-nav-link:hover {
    color: var(--bb-primary);
    background: rgba(86, 128, 233, 0.08);
}
.bb-nav-link.active {
    color: var(--bb-primary);
    background: rgba(86, 128, 233, 0.1);
}
.bb-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 3px;
    border-radius: 3px;
    background: var(--bb-gradient);
    animation: bb-nav-line 0.35s ease;
}
@keyframes bb-nav-line {
    from { width: 0; }
    to { width: auto; }
}
.bb-nav-link img, .bb-nav-link svg {
    width: 16px;
    height: 16px;
}
.bb-nav-link .caret {
    width: 12px;
    height: 12px;
    transition: transform var(--bb-transition);
}

/* Dropdown */
.bb-nav-drop { position: relative; }
.bb-nav-drop > .bb-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-lg);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--bb-transition);
    z-index: 1300;
}
.bb-nav-drop:hover > .bb-dropdown,
.bb-nav-drop:focus-within > .bb-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.bb-nav-drop:hover .caret { transform: rotate(180deg); }
.bb-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--bb-radius);
    color: var(--bb-text);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--bb-transition);
}
.bb-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(86,128,233,0.1), rgba(136,96,208,0.1));
    color: var(--bb-primary);
    transform: translateX(4px);
}
.bb-dropdown-item img, .bb-dropdown-item svg { width: 16px; height: 16px; }

/* Header actions */
.bb-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Live search — one single inline bar */
.bb-search {
    position: relative;
    width: clamp(280px, 32vw, 420px);
    min-width: 0;
    border-radius: 10px;
}
.bb-search__field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border-radius: var(--bb-radius);
    border: 1.5px solid var(--bb-border);
    background: var(--bb-surface);
    color: var(--bb-text-3);
    transition: border-color var(--bb-transition), box-shadow var(--bb-transition);
}
.bb-search.is-open .bb-search__field,
.bb-search__field:focus-within {
    border-color: var(--bb-primary);
    box-shadow: 0 0 0 3px rgba(130, 59, 181, .14);
}
.bb-search__field > i { font-size: 14px; flex: 0 0 auto; }
.bb-search__input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14.5px;
    color: var(--bb-text);
}
.bb-search__input::placeholder { color: var(--bb-text-3); }
.bb-search__clear {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: var(--bb-radius-sm);
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--bb-text-2);
    background: var(--bb-bg-alt);
    font-size: 15px;
    line-height: 1;
}
.bb-search__clear.show { display: flex; }

.bb-search__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius);
    box-shadow: var(--bb-shadow-lg);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--bb-transition);
    z-index: 1400;
}
.bb-search__panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.bb-search__input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bb-border);
}
.bb-search__input-wrap img, .bb-search__input-wrap svg { width: 18px; height: 18px; opacity: 0.5; }
.bb-search__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--bb-text);
    background: transparent;
}
.bb-search__clear {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--bb-text-3);
    background: var(--bb-bg-alt);
    font-size: 14px;
}
.bb-search__clear.show { display: flex; }
.bb-search__body {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}
.bb-search__group-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--bb-text-3);
    padding: 10px 12px 4px;
}
.bb-search__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--bb-radius);
    transition: all 0.15s ease;
}
.bb-search__item:hover,
.bb-search__item.highlighted {
    background: linear-gradient(135deg, rgba(86,128,233,0.1), rgba(136,96,208,0.1));
}
.bb-search__item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bb-bg-alt);
    overflow: hidden;
}
.bb-search__item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bb-search__item-body { flex: 1; min-width: 0; }
.bb-search__item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bb-search__item-title mark {
    background: rgba(255, 193, 7, 0.35);
    color: var(--bb-text);
    border-radius: 3px;
    padding: 0 2px;
}
.bb-search__item-meta {
    font-size: 11.5px;
    color: var(--bb-text-3);
}
.bb-search__empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--bb-text-3);
    font-size: 14px;
}
.bb-search__footer {
    padding: 10px 16px;
    border-top: 1px solid var(--bb-border);
    font-size: 12px;
    color: var(--bb-text-3);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.bb-search__footer kbd {
    background: var(--bb-bg-alt);
    border: 1px solid var(--bb-border);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 11px;
}

/* User button */
.bb-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: var(--bb-radius-pill);
    border: 1px solid var(--bb-border);
    background: var(--bb-surface);
    transition: all var(--bb-transition);
    color: var(--bb-text);
    font-weight: 600;
    font-size: 13.5px;
    max-width: 200px;
}
.bb-user-btn:hover { border-color: var(--bb-primary); color: var(--bb-primary); transform: translateY(-2px); }
.bb-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--bb-primary);
}
.bb-user-btn > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bb-user-btn > img.bb-avatar ~ span { max-width: 120px; }

/* Mobile button */
.bb-mobile-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 35px;
    height: 45px;
    padding: 5px;
    border-radius: 10px;
    background: none;
    z-index: 1300;
}
.bb-mobile-btn .bar {
    display: block;
    height: 2.5px;
    border-radius: 3px;
    background: var(--bb-primary);
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    width: 100%;
}
.bb-mobile-btn.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.bb-mobile-btn.active .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.bb-mobile-btn.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile drawer overlay */
.bb-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 50, 0.55);
    z-index: 1240;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}
.bb-nav-overlay.open { opacity: 1; visibility: visible; }

/* ---------- Responsive nav (mobile drawer) ---------- */
@media (max-width: 1024px) {
    .bb-search { width: 220px; }
}

@media (max-width: 900px) {
    .bb-header,
    .bb-header.scrolled {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #fff;
    }

    .bb-mobile-btn { display: flex; }
    .bb-header-inner { gap: 12px; }

    .bb-nav {
        position: fixed;
        top: 63.5px;
        right: 0;
        bottom: 1;
        width: min(150px, 50vw);
        background: #fff;
        border-left: 1px solid var(--bb-border);
        box-shadow: -18px 0 50px rgba(28, 22, 48, 0.18);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        margin: 0;
        padding: 0px;
        z-index: 1350;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 8px;
    }
    .bb-nav.open { transform: translateX(0); }

    .bb-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 1px;
    }
    .bb-nav-link {
        justify-content: flex-start;
        padding: 5px 5px;
        font-size: 18px;
    }
    .bb-nav-link.active::after { display: none; }
    .bb-nav-link.active { border-radius: var(--bb-radius); }

/* ⚡ COLORFUL MOBILE MENU — BLUE TO PINK GRADIENT ⚡ */
.bb-nav-link[href="/"] {
    color: #1A56DB;
    background: linear-gradient(135deg, #EBF0FA 0%, #E0E7FF 100%);
}
.bb-nav-link[href="/auth/dashboard"] {
    color: #3B82F6;
    background: linear-gradient(135deg, #E8F0FE 0%, #EDE9FE 100%);
}
.bb-nav-link[href="/paid-course"] {
    color: #6D28D9;
    background: linear-gradient(135deg, #EDE9FE 0%, #FCE7F3 100%);
}
.bb-nav-link[href="/free-course"] {
    color: #7C3AED;
    background: linear-gradient(135deg, #F3E8FF 0%, #FDF2F8 100%);
}
.bb-nav-link[href="/special-pdf"] {
    color: #9333EA;
    background: linear-gradient(135deg, #FCE7F3 0%, #FDF2F8 100%);
}
.bb-nav-link[href="/our-success"] {
    color: #C026D3;
    background: linear-gradient(135deg, #FAE8FF 0%, #FDF2F8 100%);
}
.bb-nav-link[href="/live-class"] {
    color: #DB2777;
    background: linear-gradient(135deg, #FCE7F3 0%, #FDF2F8 100%);
}
.bb-nav-link[href="/quiz"] {
    color: #E11D48;
    background: linear-gradient(135deg, #FFE4E6 0%, #FDF2F8 100%);
}

    .bb-nav-drop > .bb-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 4px 0 4px 5px;
        display: none;
    }
    .bb-nav-drop.open > .bb-dropdown { display: block; }
    .bb-nav-drop .caret { margin-left: auto; }

}

@media (max-width: 640px) {
    .bb-header-actions .bb-btn--sm span { display: none; }
    .bb-header-actions .bb-btn--sm { padding: 9px 12px; }
    .bb-user-btn > span { display: none; }
    .bb-user-btn { padding: 4px; }
    .bb-header-actions { gap: 8px; }
}

/* ---------- Mobile search row + drawer safety ---------- */
@media (max-width: 900px) {
    .bb-header { height: auto; }
    .bb-header.scrolled { height: auto; }
    .bb-header-inner {
        flex-wrap: wrap;
        row-gap: 8px;
        padding-block: 10px;
    }
    .bb-logo-link { order: 1; }
    .bb-header-actions { order: 2; margin-left: auto; }
    .bb-search {
        order: 3;
        width: 100%;
        flex: 1 0 100%;
    }
    .bb-search__panel { left: 0; right: 0; }
    .bb-logo-img, .bb-header.scrolled .bb-logo-img { height: 40px; }
}

/* Page must never blur or shift when the drawer opens */
body.bb-nav-open {
    overflow: hidden;
    touch-action: none;
}
body.bb-nav-open #bbPageBody,
body.bb-nav-open main,
body.bb-nav-open footer {
    filter: none !important;
    backdrop-filter: none !important;
}

/* Desktop-এ text hide, hover-এ tooltip দেখাবে + COLORFUL ICONS */
@media (min-width: 901px) {
    .bb-nav-text {
        display: none;
    }
    
    .bb-nav-link {
        width: 42px;
        height: 42px;
        justify-content: center;
        padding: 0;
    }
    
/* ⚡ COLORFUL DESKTOP ICONS — BLUE TO PINK ⚡ */
.bb-nav-link[href="/"] i                    { color: #1A56DB; }
.bb-nav-link[href="/auth/dashboard"] i      { color: #2563EB; }
.bb-nav-link[href="/paid-course"] i          { color: #4F46E5; }
.bb-nav-link[href="/free-course"] i          { color: #7C3AED; }
.bb-nav-link[href="/special-pdf"] i          { color: #9333EA; }
.bb-nav-link[href="/our-success"] i          { color: #C026D3; }
.bb-nav-link[href="/live-class"] i          { color: #DB2777; }
.bb-nav-link[href="/quiz"] i          { color: #E11D48; }

    .bb-user-btn .bb-nav-text {
        display: none;
    }
    
    .bb-user-btn {
        padding: 4px;
    }
}

/* মোবাইলে text দেখাবে */
@media (max-width: 900px) {
    .bb-nav-text {
        display: inline;
    }
    
    .bb-nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 14px;
        gap: 12px;
    }
    
    .bb-user-btn .bb-nav-text {
        display: inline;
    }
}