/* ==========================================================================
   TechResider AI - Next-Gen Platform Tour & Onboarding Studio Styles
   Cosmic Obsidian Theme with Glassmorphic Popovers, Glowing Target Spotlights,
   Floating HUD Controller, and Celebration Particle Overlays.
   ========================================================================== */

:root {
    --tour-primary: #8b5cf6;
    --tour-primary-glow: rgba(139, 92, 246, 0.4);
    --tour-secondary: #06b6d4;
    --tour-accent: #10b981;
    --tour-rose: #f43f5e;
    --tour-bg: rgba(10, 15, 30, 0.94);
    --tour-border: rgba(255, 255, 255, 0.12);
    --tour-card-border: rgba(139, 92, 246, 0.35);
}

/* --- DRIVER.JS POPOVER REFINED OVERRIDES --- */

.driver-popover {
    background: var(--tour-bg) !important;
    backdrop-filter: blur(25px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(190%) !important;
    border: 1px solid var(--tour-card-border) !important;
    border-radius: 28px !important;
    color: #f8fafc !important;
    padding: 0 !important;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.85),
        0 0 40px var(--tour-primary-glow),
        inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
    max-width: 420px !important;
    width: calc(100vw - 32px) !important;
    overflow: hidden !important;
    animation: tourCardSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    z-index: 10000000 !important;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

@keyframes tourCardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card Top Progress Fill */
.driver-popover-progress-bar-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.driver-popover-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4, #10b981);
    transition: width 0.4s ease;
}

/* Popover Content Container */
.driver-popover-body-wrapper {
    padding: 24px 28px 24px !important;
}

/* Header & Title */
.driver-popover-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.driver-popover-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c4b5fd;
}

.driver-popover-badge-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a78bfa;
    box-shadow: 0 0 8px #a78bfa;
}

.driver-popover-title {
    background: linear-gradient(135deg, #ffffff 0%, #ddd6fe 60%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.driver-popover-description {
    color: #cbd5e1 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
    font-weight: 400 !important;
    margin-bottom: 16px !important;
}

/* Step Action / Pro Tip Box */
.driver-popover-action-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 10px 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #e2e8f0;
}

.driver-popover-action-btn {
    background: rgba(255, 255, 255, 0.1);
    hover: background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.driver-popover-action-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

/* Footer & Buttons */
.driver-popover-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 16px 28px 20px !important;
    margin-top: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: rgba(0, 0, 0, 0.2);
}

.driver-popover-progress-text {
    font-family: 'Outfit', sans-serif !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #a78bfa !important;
    letter-spacing: 0.05em !important;
}

.driver-popover-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.driver-popover-btn {
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 8px 18px !important;
    border-radius: 14px !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.driver-popover-prev-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

.driver-popover-prev-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.driver-popover-next-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 20px -4px rgba(139, 92, 246, 0.5) !important;
}

.driver-popover-next-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px -4px rgba(139, 92, 246, 0.7) !important;
    filter: brightness(1.1) !important;
}

.driver-popover-close-btn {
    color: rgba(255, 255, 255, 0.4) !important;
    padding: 6px !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
}

.driver-popover-close-btn:hover {
    color: #f43f5e !important;
    background: rgba(244, 63, 94, 0.15) !important;
}

/* Popover Arrows */
.driver-popover-arrow {
    border-color: var(--tour-bg) !important;
}

.driver-popover-arrow-side-left:after { border-left-color: var(--tour-bg) !important; }
.driver-popover-arrow-side-right:after { border-right-color: var(--tour-bg) !important; }
.driver-popover-arrow-side-top:after { border-top-color: var(--tour-bg) !important; }
.driver-popover-arrow-side-bottom:after { border-bottom-color: var(--tour-bg) !important; }

/* Highlight Active Element Pulse Ring */
.driver-active-element {
    box-shadow: 
        0 0 0 3px #8b5cf6,
        0 0 25px rgba(139, 92, 246, 0.5),
        0 0 50px rgba(6, 182, 212, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
    z-index: 1000000 !important;
}

.driver-overlay {
    background-color: rgba(2, 6, 23, 0.88) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 999999 !important;
}

/* ==========================================================================
   FLOATING HUD TOUR CONTROLLER
   ========================================================================== */

.trai-tour-hud {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000001;
    background: rgba(10, 15, 30, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 20px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(139, 92, 246, 0.2);
    font-family: 'Outfit', sans-serif;
    color: #f8fafc;
    animation: hudSlideUp 0.3s ease-out;
}

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

.trai-tour-hud-track-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trai-tour-hud-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.trai-tour-hud-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.trai-tour-hud-btn.active {
    background: rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.5);
}

/* ==========================================================================
   INTERACTIVE TOUR LAUNCHER MODAL
   ========================================================================== */

.trai-tour-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: tourModalFadeIn 0.3s ease-out;
}

@keyframes tourModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.trai-tour-modal-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 32px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.9), 0 0 50px rgba(139, 92, 246, 0.2);
    position: relative;
    color: #f8fafc;
    font-family: 'Outfit', sans-serif;
}

.trai-tour-track-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.trai-tour-track-card:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
}

.trai-tour-track-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   CONFETTI CELEBRATION CANVAS
   ========================================================================== */

#trai-tour-confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000010;
}