/* ==========================================================================
   INVENTORY TOUR GUIDE SYSTEM - BANGLA INTERACTIVE WALKTHROUGH
   Modern, Lightweight, Responsive & Self-Contained Tour Engine
   ========================================================================== */

:root {
    --tour-primary: #0284c7;
    --tour-primary-dark: #0369a1;
    --tour-primary-light: #e0f2fe;
    --tour-accent: #06b6d4;
    --tour-success: #10b981;
    --tour-warning: #f59e0b;
    --tour-danger: #ef4444;
    --tour-dark: #0f172a;
    --tour-card-bg: #ffffff;
    --tour-text: #1e293b;
    --tour-text-muted: #64748b;
    --tour-border: #e2e8f0;
    --tour-radius: 12px;
    --tour-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.25), 0 10px 15px -5px rgba(15, 23, 42, 0.1);
}

/* --------------------------------------------------------------------------
   1. OVERLAY & SPOTLIGHT
   -------------------------------------------------------------------------- */
.inventory-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.68);
    z-index: 999990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    pointer-events: auto;
}

.inventory-tour-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Elevate sidebar above overlay so menus are crisp and unblurred */
body.tour-active .main-sidebar {
    z-index: 999992 !important;
}

/* Dim non-highlighted sidebar menus */
body.tour-active .sidebar-menu > li:not(.tour-highlighted-target) {
    opacity: 0.35 !important;
    filter: grayscale(80%) !important;
    transition: opacity 0.3s ease !important;
}

/* Active Highlighted Menu Item in Sidebar - High Contrast White Text & Vivid Blue Glow */
body.tour-active .sidebar-menu > li.tour-highlighted-target,
body.tour-active .sidebar-menu .treeview-menu > li.tour-highlighted-target {
    opacity: 1 !important;
    filter: none !important;
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 25px rgba(2, 132, 199, 0.95), 0 0 0 3px #38bdf8 !important;
    transform: scale(1.03) !important;
    transform-origin: left center !important;
    position: relative !important;
    z-index: 999994 !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.tour-active .sidebar-menu > li.tour-highlighted-target > a,
body.tour-active .sidebar-menu > li.tour-highlighted-target > a span,
body.tour-active .sidebar-menu > li.tour-highlighted-target > a i,
body.tour-active .sidebar-menu > li.tour-highlighted-target > a .pull-right-container i,
body.tour-active .sidebar-menu .treeview-menu > li.tour-highlighted-target > a,
body.tour-active .sidebar-menu .treeview-menu > li.tour-highlighted-target > a span,
body.tour-active .sidebar-menu .treeview-menu > li.tour-highlighted-target > a i {
    color: #ffffff !important;
    font-weight: 900 !important;
    font-size: 14.5px !important;
    letter-spacing: 0.6px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Luminous Highlight Box over the Target Element */
.inventory-tour-spotlight {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 0 0 3px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.5);
    background: rgba(2, 132, 199, 0.15);
    pointer-events: none;
    z-index: 999993;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.inventory-tour-spotlight-pulse {
    position: absolute;
    inset: -6px;
    border: 2px solid #38bdf8;
    border-radius: 12px;
    animation: tourPulse 2s infinite;
    pointer-events: none;
}

@keyframes tourPulse {
    0% { transform: scale(0.98); opacity: 0.9; }
    50% { transform: scale(1.03); opacity: 0.3; }
    100% { transform: scale(0.98); opacity: 0.9; }
}

/* Prominent Callout Banner in the Popover Card */
.tour-active-menu-callout {
    background: #f0f9ff;
    border: 1.5px solid #0284c7;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.tour-callout-icon {
    width: 32px;
    height: 32px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    animation: bounceLeft 1.2s infinite;
}

@keyframes bounceLeft {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
}

.tour-callout-content {
    flex: 1;
    min-width: 0;
}

.tour-callout-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0369a1;
    margin-bottom: 2px;
}

.tour-callout-name {
    font-size: 16px;
    font-weight: 900;
    color: #0c4a6e;
    line-height: 1.2;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   2. POPOVER CARD
   -------------------------------------------------------------------------- */
.inventory-tour-popover {
    position: absolute;
    width: 440px;
    max-width: calc(100vw - 30px);
    background: var(--tour-card-bg);
    border-radius: var(--tour-radius);
    box-shadow: var(--tour-shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    z-index: 999995;
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Source Sans Pro', 'Kalpurush', 'SolaimanLipi', sans-serif;
    color: var(--tour-text);
    overflow: hidden;
}

.inventory-tour-popover.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Top Progress Track */
.tour-card-progress {
    width: 100%;
    height: 4px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.tour-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #06b6d4, #10b981);
    width: 0%;
    transition: width 0.3s ease;
}

/* Header */
.tour-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--tour-border);
    background: #fafafa;
}

.tour-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-badge-step {
    background: #0284c7;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
}

.tour-badge-category {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}

.tour-btn-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.tour-btn-close:hover {
    color: var(--tour-danger);
    background: #fee2e2;
}

/* Body */
.tour-card-body {
    padding: 16px 18px;
}

.tour-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tour-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.tour-title-text {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin: 0;
}

.tour-desc {
    font-size: 13.5px;
    color: #334155;
    line-height: 1.6;
    margin: 0 0 12px;
}

/* Pro-Tip Box */
.tour-tip-box {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 12.5px;
    color: #92400e;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}

.tour-tip-box i {
    font-size: 14px;
    color: #d97706;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Submenu Tag Pills */
.tour-submenus-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.tour-submenus-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tour-submenus-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tour-sub-tag {
    font-size: 11.5px;
    background: #f1f5f9;
    color: #334155;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

/* Footer & Controls */
.tour-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid var(--tour-border);
    gap: 10px;
    flex-wrap: wrap;
}

.tour-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tour-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Controls buttons */
.tour-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    line-height: 1.4;
}

.tour-btn-primary {
    background: #0284c7;
    color: #ffffff;
}
.tour-btn-primary:hover {
    background: #0369a1;
}

.tour-btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
}
.tour-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.tour-btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tour-btn-tool {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 9px;
    font-size: 12px;
}
.tour-btn-tool:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.tour-btn-tool.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Voice Speaking Indicator Animation */
.tour-voice-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 2px;
}
.tour-voice-wave span {
    width: 2px;
    height: 8px;
    background: #ffffff;
    border-radius: 2px;
    animation: waveAnim 0.8s infinite ease-in-out;
}
.tour-voice-wave span:nth-child(2) { animation-delay: 0.2s; height: 12px; }
.tour-voice-wave span:nth-child(3) { animation-delay: 0.4s; height: 7px; }

@keyframes waveAnim {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1.4); }
}

/* Auto-Play Timer Bar */
.tour-autoplay-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #10b981;
    width: 0%;
    transition: width 0.1s linear;
}

/* Popover Arrow */
.tour-popover-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--tour-card-bg);
    transform: rotate(45deg);
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    z-index: -1;
}

/* --------------------------------------------------------------------------
   3. TOPBAR LAUNCHER BUTTON
   -------------------------------------------------------------------------- */
.btn-inventory-tour-topbar {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    border-radius: 20px !important;
    padding: 5px 13px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
    transition: all 0.2s ease !important;
    height: 32px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.btn-inventory-tour-topbar:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.45) !important;
}

.btn-inventory-tour-topbar .tour-compass-icon {
    font-size: 14px;
    color: #bae6fd;
    animation: tourCompassSpin 10s infinite linear;
}

@keyframes tourCompassSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   4. FLOATING QUICK HELP LAUNCHER (BOTTOM-RIGHT) - DISABLED
   -------------------------------------------------------------------------- */
.inventory-tour-floating-fab {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.inventory-tour-floating-fab:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(2, 132, 199, 0.6);
}

.inventory-tour-floating-fab i {
    font-size: 16px;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. WELCOME BANNER FOR FIRST TIME USERS
   -------------------------------------------------------------------------- */
.inventory-tour-welcome-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 20px 40px -5px rgba(15, 23, 42, 0.3);
    border: 1px solid #cbd5e1;
    border-top: 4px solid #0284c7;
    z-index: 99999;
    font-family: 'Source Sans Pro', 'Kalpurush', sans-serif;
    display: none;
    animation: toastSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.tour-welcome-title {
    font-size: 15.5px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tour-welcome-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 14px;
}

.tour-welcome-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive adjust for mobile */
@media (max-width: 768px) {
    .inventory-tour-popover {
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        right: 10px !important;
    }
    .tour-topbar-text {
        display: none !important;
    }
    .inventory-tour-floating-fab span {
        display: none;
    }
    .inventory-tour-floating-fab {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}
