/* ============================================================
   navbar.css — Topbar / Navbar Component Styles
   ============================================================ */

/* ── Topbar Shell ───────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: var(--sidebar-width);
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    transition: right var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

body.sidebar-collapsed .topbar {
    right: var(--sidebar-collapsed-w);
}

.topbar-inner {
    height: 100%;
    gap: .5rem;
}

/* ── Toggle Buttons ─────────────────────────────────────────── */
.topbar-mobile-toggle,
.topbar-collapse-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: .3rem .5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    line-height: 1;
}

.topbar-mobile-toggle:hover,
.topbar-collapse-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ── Context Title ──────────────────────────────────────────── */
.topbar-context-text {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: .2rem .6rem;
    background: var(--secondary-soft);
    border-radius: 20px;
}

/* ── Search ─────────────────────────────────────────────────── */
.topbar-search .input-group {
    width: 220px;
}

.topbar-search .form-control {
    background: #f8fafc;
    border-color: var(--border-color);
    font-size: .82rem;
    height: 34px;
}

.topbar-search .form-control:focus {
    background: #fff;
    width: 280px;
    transition: width .3s ease;
}

.topbar-search .input-group-text {
    border-color: var(--border-color);
    height: 34px;
}

/* ── Action Buttons ─────────────────────────────────────────── */
.topbar-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: .85rem;
    padding: .3rem .65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .3rem;
    transition: all var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    height: 34px;
    white-space: nowrap;
}

.topbar-btn:hover {
    background: var(--secondary-soft);
    color: var(--text-main);
    border-color: #d1d5db;
}

.topbar-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.topbar-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* ── Notification Badge ─────────────────────────────────────── */
.topbar-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    width: 17px; height: 17px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* ── Notification Dropdown ──────────────────────────────────── */
.notification-dropdown {
    width: 320px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.notification-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-size: .85rem;
}

.notification-list { max-height: 280px; overflow-y: auto; }

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background var(--transition);
    color: var(--text-main);
}

.notification-item:hover { background: #f8fafc; text-decoration: none; }

.notification-item.unread { background: #f0f7ff; }
.notification-item.unread:hover { background: #e8f0fe; }

.notification-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.bg-primary-soft { background: var(--primary-soft); }
.bg-warning-soft { background: var(--warning-soft); }
.bg-danger-soft  { background: var(--danger-soft); }
.bg-success-soft { background: var(--success-soft); }

.notification-body { flex: 1; min-width: 0; }

.notification-text {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: .15rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: .72rem;
    color: var(--text-muted);
}

.notification-footer {
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    font-size: .8rem;
}

/* ── User Button ────────────────────────────────────────────── */
.topbar-user-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: .3rem .65rem;
    cursor: pointer;
    transition: all var(--transition);
    height: 34px;
}

.topbar-user-btn:hover {
    background: var(--secondary-soft);
    border-color: #d1d5db;
}

.topbar-user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.topbar-user-name {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.topbar-user-role {
    display: block;
    font-size: .68rem;
    color: var(--text-muted);
    line-height: 1;
}

/* ── Dropdown Menus ─────────────────────────────────────────── */
.dropdown-menu {
    font-family: 'Cairo', sans-serif;
    font-size: .83rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: .3rem 0;
    min-width: 180px;
}

.dropdown-item {
    padding: .5rem 1rem;
    color: var(--text-main);
    font-size: .83rem;
    transition: background var(--transition);
}

.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-soft); color: var(--danger); }

.dropdown-header {
    font-size: .82rem;
    color: var(--text-main);
    padding: .5rem 1rem;
}

/* ── Mobile Topbar ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .topbar {
        right: 0 !important;
        left: 0;
    }
}

@media (max-width: 575.98px) {
    .topbar-search { display: none !important; }
    .notification-dropdown { width: 280px; }
}
