/* =============================================
   YLive Studio — Tutorial Custom CSS
   Override Driver.js styles to match YLive theme
   ============================================= */

/* Overlay — pastikan di atas semua elemen */
.driver-overlay {
    z-index: 200000 !important;
}

/* Popover container */
.driver-popover {
    z-index: 200001 !important;
    background: #ffffff !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(0, 0, 0, 0.03) !important;
    border: none !important;
    padding: 1.5rem !important;
    max-width: 380px !important;
    font-family: var(--font-family), 'Inter', sans-serif !important;
}

/* Popover arrow */
.driver-popover-arrow {
    border: none !important;
}

.driver-popover-arrow-side-left,
.driver-popover-arrow-side-right,
.driver-popover-arrow-side-top,
.driver-popover-arrow-side-bottom {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Title */
.driver-popover-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em;
}

/* Description */
.driver-popover-description {
    font-size: 0.875rem !important;
    color: #64748b !important;
    line-height: 1.7 !important;
    margin-bottom: 0 !important;
    font-weight: 400 !important;
}

/* Footer with buttons */
.driver-popover-footer {
    margin-top: 1.25rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
}

/* Progress text (1 of 5) */
.driver-popover-progress-text {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
}

/* Navigation buttons container */
.driver-popover-navigation-btns {
    display: flex !important;
    gap: 0.5rem !important;
}

/* All buttons base style */
.driver-popover-prev-btn,
.driver-popover-next-btn {
    border: none !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 99px !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-shadow: none !important;
}

/* Previous button */
.driver-popover-prev-btn {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.driver-popover-prev-btn:hover {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

/* Next button — theme color */
.driver-popover-next-btn {
    background: var(--theme-color, #28a745) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.driver-popover-next-btn:hover {
    background: var(--theme-color-hover, #218838) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4) !important;
}

/* Close button */
.driver-popover-close-btn {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    background: #f8fafc !important;
    border: none !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.driver-popover-close-btn:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

/* Highlighted element ring */
.driver-active-element {
    border-radius: 0.75rem !important;
}

/* =============================================
   Help Button Sidebar Overrides (Flat Style)
   ============================================= */
#tutorial-help-btn.has-new .badge-dot {
    display: block !important;
    animation: tutorial-dot-ping 1.5s ease-in-out infinite;
}

@keyframes tutorial-dot-ping {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

/* =============================================
   Tutorial Menu Floating Position (Right Above Help Button)
   ============================================= */
#tutorial-menu {
    position: fixed;
    bottom: 65px;
    right: 20px;
    z-index: 10001;
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    min-width: 280px;
    display: none;
    animation: tutorial-menu-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

#tutorial-menu.show {
    display: block;
}

/* Ensure sidebar text hidden when collapsed */
.sidebar.collapsed .sidebar-text {
    display: none;
}


.menu-container::-webkit-scrollbar {
    width: 4px;
}

.menu-container::-webkit-scrollbar-track {
    background: transparent;
}

.menu-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.menu-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

@keyframes tutorial-menu-in {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#tutorial-menu .menu-header {
    padding: 0.75rem 0.75rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

#tutorial-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

#tutorial-menu .menu-item:hover {
    background: #f1f5f9;
    color: var(--theme-color, #28a745);
    transform: translateX(3px);
}

#tutorial-menu .menu-item .check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

#tutorial-menu .menu-item.completed .check {
    background: var(--theme-color, #28a745);
    border-color: var(--theme-color, #28a745);
    color: #fff;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
}

#tutorial-menu .menu-item.completed span:not(.check) {
    color: #94a3b8;
    text-decoration: line-through;
    opacity: 0.7;
}

#tutorial-menu .menu-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0.4rem 0.75rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .driver-popover {
        max-width: 90vw !important;
        margin: 0 auto !important;
    }

    #tutorial-menu {
        bottom: 65px;
        right: 16px;
        min-width: 220px;
    }
}
