/* =================================================================
   SBM COMMAND MENU (Futuristic Glassmorphism)
   ================================================================= */

/* 1. Nút Kích Hoạt (Hamburger) */
.sbm-cmd-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    z-index: 2000; /* Cao hơn menu */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sbm-text-color);
}

.sbm-cmd-toggle:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1) rotate(90deg); /* Xoay nhẹ khi hover */
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); /* Glow effect */
}

/* Icon Hamburger chuyển thành X */
.sbm-cmd-icon {
    width: 24px;
    height: 24px;
    position: relative;
}
.sbm-cmd-icon span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.sbm-cmd-icon span:nth-child(1) { top: 4px; }
.sbm-cmd-icon span:nth-child(2) { top: 11px; }
.sbm-cmd-icon span:nth-child(3) { top: 18px; }

/* Trạng thái mở (Biến thành dấu X) */
.sbm-command-wrapper.is-active .sbm-cmd-toggle {
    background: var(--sbm-primary-color);
    color: #fff;
    border-color: transparent;
}
.sbm-command-wrapper.is-active .sbm-cmd-icon span:nth-child(1) { top: 11px; transform: rotate(135deg); }
.sbm-command-wrapper.is-active .sbm-cmd-icon span:nth-child(2) { opacity: 0; left: -60px; }
.sbm-command-wrapper.is-active .sbm-cmd-icon span:nth-child(3) { top: 11px; transform: rotate(-135deg); }

/* 2. Menu Xổ Xuống (The Holographic Box) */
.sbm-cmd-menu {
    position: absolute;
    top: 60px; /* Cách nút 1 chút */
    right: 0;
    width: 260px;
    background: rgba(255, 255, 255, 0.7); /* Trong suốt */
    backdrop-filter: blur(20px); /* Làm mờ nền cực mạnh */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5); /* Viền phát sáng bên trong */
    
    /* Trạng thái ẩn mặc định */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.9);
    transform-origin: top right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1999;
}

/* Trạng thái hiện menu */
.sbm-command-wrapper.is-active .sbm-cmd-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 3. Các mục trong Menu (Items) */
.sbm-cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.sbm-cmd-item:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--sbm-primary-color);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sbm-cmd-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

/* Phân cách mục Admin */
.sbm-cmd-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent);
    margin: 8px 0;
}

.sbm-cmd-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0 16px;
    margin: 8px 0 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Hiệu ứng Staggered (Xuất hiện lần lượt) */
.sbm-command-wrapper.is-active .sbm-cmd-item {
    animation: sbm-slide-in 0.4s forwards;
    opacity: 0;
}
.sbm-command-wrapper.is-active .sbm-cmd-item:nth-child(1) { animation-delay: 0.05s; }
.sbm-command-wrapper.is-active .sbm-cmd-item:nth-child(2) { animation-delay: 0.1s; }
.sbm-command-wrapper.is-active .sbm-cmd-item:nth-child(3) { animation-delay: 0.15s; }
/* ... thêm tiếp nếu nhiều item */

@keyframes sbm-slide-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Giao diện Session List */
.sbm-session-item { padding: 15px; border-bottom: 1px solid #e5e7eb; cursor: pointer; transition: 0.2s; }
.sbm-session-item:hover { background: #f3f4f6; }
.sbm-session-item.is-active { background: #e0f2fe; border-left: 4px solid #3b82f6; }
.sbm-session-id { font-weight: 700; color: #1f2937; font-size: 0.9rem; margin-bottom: 5px; word-break: break-all; }
.sbm-session-meta { font-size: 0.75rem; color: #6b7280; display: flex; justify-content: space-between; }

/* Giao diện Timeline Hành trình */
.sbm-timeline { position: relative; padding-left: 20px; margin-top: 15px; }
.sbm-timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: #e5e7eb; }
.sbm-timeline-item { position: relative; margin-bottom: 20px; }
.sbm-timeline-dot { position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #3b82f6; border: 2px solid #fff; box-shadow: 0 0 0 2px #e0f2fe; }

.sbm-t-time { font-size: 0.75rem; color: #9ca3af; margin-bottom: 2px; font-family: monospace; }
.sbm-t-type { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; margin-bottom: 4px; }
.sbm-t-type.PAGE_VIEW { background: #dcfce7; color: #166534; }
.sbm-t-type.CLICK { background: #fef9c3; color: #166534; }
.sbm-t-type.SCROLL_DEPTH { background: #f3f4f6; color: #4b5563; }
.sbm-t-type.VIEW_CHANGE { background: #e0e7ff; color: #1e40af; }

.sbm-t-target { font-size: 0.9rem; color: #111827; font-weight: 500; }
.sbm-t-url { font-size: 0.75rem; color: #6b7280; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }