/* ==========================================================================
   Ctrl TASQ - Sidebar Spotlight Product Tour & Onboarding Engine CSS
   ========================================================================== */

/* Fullscreen Blurred Dark Overlay (Dimmable Backdrop) */
.ctrl-tour-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: all;
}
.ctrl-tour-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Elevate and force-display sidebar above the backdrop */
body.ctrl-tour-running .dashboard__sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    width: 250px !important;
    z-index: 99995 !important;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

body.ctrl-tour-running .dashboard__menu a:not(.ctrl-tour-highlight) {
    opacity: 0.45;
    transition: opacity 0.25s ease;
}

body.ctrl-tour-running .dashboard__menu a.ctrl-tour-highlight {
    opacity: 1 !important;
}

/* Sidebar Tab Spotlight Highlight */
.ctrl-tour-highlight {
    position: relative !important;
    z-index: 99998 !important;
    background: linear-gradient(135deg, #8a42ff 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    border-left: 4px solid #ffffff !important;
    box-shadow: 0 0 0 3px #ffffff, 0 0 20px #8a42ff, 0 0 40px rgba(138, 66, 255, 0.9) !important;
    transform: translateX(6px) scale(1.03) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ctrl-tour-highlight a, 
.ctrl-tour-highlight i, 
.ctrl-tour-highlight span, 
.ctrl-tour-highlight h4 {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.ctrl-tour-highlight::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.4);
    animation: ctrlTourBeacon 1.2s infinite ease-in-out;
}

@keyframes ctrlTourBeacon {
    0% { transform: translateY(-50%) scale(0.9); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: translateY(-50%) scale(1.1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: translateY(-50%) scale(0.9); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Floating Tour Pointer Card */
.ctrl-tour-card {
    position: fixed;
    z-index: 99999;
    width: 480px;
    max-width: 92vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.4);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    top: 50%;
    left: 50%;
}

.ctrl-tour-card.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Pointer Arrow pointing to the highlighted sidebar tab */
.ctrl-tour-card.has-pointer-left::before {
    content: '';
    position: absolute;
    left: -12px;
    top: var(--pointer-top, 35px);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 12px solid #ffffff;
    filter: drop-shadow(-3px 0 3px rgba(0,0,0,0.1));
}

/* Progress Bar */
.ctrl-tour-progress-wrap {
    height: 6px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}
.ctrl-tour-progress-bar {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, #8a42ff, #6366f1);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Header Row */
.ctrl-tour-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.ctrl-tour-step-badge {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a42ff;
    background: rgba(138, 66, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ctrl-tour-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.15s ease;
}
.ctrl-tour-close-btn:hover {
    color: #0f172a;
}

/* Live Interactive Visual Simulation Box */
.ctrl-tour-media-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e1e2d 100%);
    border-radius: 14px;
    padding: 16px;
    color: #ffffff;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.ctrl-tour-media-box::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(138, 66, 255, 0.3) 0%, transparent 70%);
    pointer-events: none;
}
.media-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    width: fit-content;
}
.media-anim-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.media-anim-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(138, 66, 255, 0.25);
    color: #c084fc;
    flex-shrink: 0;
}
.media-anim-text h6 {
    font-size: 13.5px;
    font-weight: 700;
    margin: 0 0 3px 0;
    color: #ffffff;
}
.media-anim-text p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

/* Voice Wave Visualizer Simulation */
.voice-wave-bars {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    margin-top: 8px;
}
.voice-wave-bar {
    width: 4px;
    height: 100%;
    background: #8a42ff;
    border-radius: 3px;
    animation: voiceWaveAnim 1.2s infinite ease-in-out;
}
.voice-wave-bar:nth-child(2) { animation-delay: 0.2s; height: 70%; background: #a855f7; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.4s; height: 100%; background: #c084fc; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.1s; height: 50%; background: #6366f1; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.5s; height: 85%; background: #38bdf8; }
.voice-wave-bar:nth-child(6) { animation-delay: 0.3s; height: 60%; background: #8a42ff; }

@keyframes voiceWaveAnim {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* Content Area */
.ctrl-tour-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ctrl-tour-desc {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 14px;
}
.ctrl-tour-nav-tip {
    font-size: 12.5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #8a42ff;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    color: #334155;
    margin-bottom: 18px;
}

/* Footer & Controls */
.ctrl-tour-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
}
.ctrl-tour-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ctrl-tour-never-label {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
    user-select: none;
}
.ctrl-tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.btn-tour-skip {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
    transition: color 0.15s ease;
}
.btn-tour-skip:hover {
    color: #0f172a;
}
.btn-tour-prev {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-tour-prev:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.btn-tour-next {
    background: linear-gradient(135deg, #8a42ff, #6366f1);
    color: #ffffff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(138, 66, 255, 0.3);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-tour-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(138, 66, 255, 0.4);
    color: #ffffff;
}

/* Header Tour Trigger Button */
.btn-product-tour-trigger {
    background: rgba(138, 66, 255, 0.1);
    color: #8a42ff !important;
    border: 1px solid rgba(138, 66, 255, 0.3);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-product-tour-trigger:hover {
    background: #8a42ff;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(138, 66, 255, 0.28);
    transform: translateY(-1px);
}
.btn-product-tour-trigger i {
    color: #f59e0b;
    font-size: 14px;
}
.btn-product-tour-trigger:hover i {
    color: #ffffff;
}
