/* ExactEstate Walkthrough Styling — Driver.js */
/* Matches the EE Design System (indigo/teal theme) */

:root {
    --ee-intro-overlay: rgba(15, 23, 42, 0.75);
    --ee-intro-helper-bg: rgba(255, 255, 255, 0.92);
    --ee-intro-helper-border: #3f51b5;
    --ee-intro-helper-shadow: 0 0 0 4px rgba(63, 81, 181, 0.24), 0 8px 32px rgba(0, 0, 0, 0.2);
    --ee-intro-tooltip-bg: #ffffff;
    --ee-intro-tooltip-text: #374151;
    --ee-intro-tooltip-header-bg: #3f51b5;
    --ee-intro-tooltip-header-text: #ffffff;
    --ee-intro-tooltip-actions-bg: #f8fafc;
    --ee-intro-tooltip-actions-border: #e2e8f0;
    --ee-intro-close-border: #ffffff;
    --ee-intro-prev-bg: #ffffff;
    --ee-intro-prev-text: #3f51b5;
    --ee-intro-prev-border: #3f51b5;
    --ee-intro-next-bg: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
    --ee-intro-next-bg-hover: linear-gradient(135deg, #303f9f 0%, #1a237e 100%);
    --ee-intro-next-text: #ffffff;
    --ee-intro-next-border: #3f51b5;
    --ee-intro-muted: #e2e8f0;
    --ee-intro-muted-hover: #94a3b8;
}

body.ee-dark,
html.ee-dark {
    --ee-intro-overlay: rgba(2, 6, 23, 0.82);
    --ee-intro-helper-bg: rgba(15, 23, 42, 0.9);
    --ee-intro-helper-border: #818cf8;
    --ee-intro-helper-shadow: 0 0 0 4px rgba(129, 140, 248, 0.24), 0 10px 36px rgba(0, 0, 0, 0.42);
    --ee-intro-tooltip-bg: #0f172a;
    --ee-intro-tooltip-text: #e2e8f0;
    --ee-intro-tooltip-header-bg: #1e293b;
    --ee-intro-tooltip-header-text: #f8fafc;
    --ee-intro-tooltip-actions-bg: #111827;
    --ee-intro-tooltip-actions-border: #334155;
    --ee-intro-close-border: #0f172a;
    --ee-intro-prev-bg: #0f172a;
    --ee-intro-prev-text: #c7d2fe;
    --ee-intro-prev-border: #818cf8;
    --ee-intro-next-bg: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    --ee-intro-next-bg-hover: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
    --ee-intro-next-text: #f8fafc;
    --ee-intro-next-border: #818cf8;
    --ee-intro-muted: #334155;
    --ee-intro-muted-hover: #64748b;
}

.ee-intro-drawer-active {
    z-index: 10000000 !important;
}

/* Highlight ring around the focused element — DO NOT alter the element's own
   colors. Earlier rules force-painted everything white + dark text, which
   ruined indigo hero cards, status badges, and any colored UI block. Now the
   highlight is a 2px indigo outline + soft halo only.
   The `ee-intro-keep-colors` opt-in escape hatch is left in place for any
   surface that explicitly wants the old white-on-dark "spotlight" treatment. */
.driver-active-element,
.driver-active-element.driver-no-interaction {
    border-radius: 8px !important;
    box-shadow:
        0 0 0 3px var(--ee-indigo, #3f51b5),
        0 0 0 6px rgba(63, 81, 181, 0.25),
        0 18px 40px rgba(15, 23, 42, 0.18) !important;
}

/* Opt-in legacy behavior: preserves the original "spotlight" look only if a
   surface explicitly adds class="ee-intro-spotlight" to its container. */
.driver-active-element.ee-intro-spotlight,
.driver-active-element.ee-intro-spotlight.driver-no-interaction {
    background: #ffffff !important;
}
.driver-active-element.ee-intro-spotlight,
.driver-active-element.ee-intro-spotlight *:not(i):not([class*="fa-"]) {
    color: #1e293b !important;
}
.driver-active-element.ee-intro-spotlight i,
.driver-active-element.ee-intro-spotlight [class*="fa-"] {
    color: #3f51b5 !important;
}

/* Tooltip container - ALWAYS centered on screen */
.driver-popover {
    background-color: var(--ee-intro-tooltip-bg) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    padding: 0 !important;
    min-width: 300px !important;
    max-width: 380px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    overflow: visible !important;
    /* Force center positioning — overrides Driver.js inline style */
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

.introjs-tooltip.ee-centered-tooltip.ee-intro-tooltip--drawer,
.driver-popover.ee-intro-tooltip--drawer {
    right: 452px !important;
    left: auto !important;
    transform: none !important;
}

.introjs-helperLayer.ee-intro-helper--drawer,
.driver-overlay.ee-intro-helper--drawer,
.driver-stage.ee-intro-helper--drawer {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Hide Driver.js default ×  close button — we inject our own */
.driver-popover-close-btn {
    display: none !important;
}

/* Custom X close button at top-right of tooltip */
.ee-intro-close-btn {
    position: absolute !important;
    top: -12px !important;
    right: -12px !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: 3px solid var(--ee-intro-close-border) !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    z-index: 10000001 !important;
    transition: all 0.2s ease !important;
}

.ee-intro-close-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: scale(1.1) !important;
}

.ee-intro-close-btn i {
    font-size: 14px !important;
    color: #fff !important;
    line-height: 1 !important;
}

.ee-intro-close-btn svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
}

/* Injected indigo header with step count */
.driver-popover-header-custom {
    background: #3f51b5 !important;
    padding: 14px 20px !important;
    border-radius: 12px 12px 0 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.driver-popover-header-custom span {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    display: flex !important;
    align-items: center !important;
}

/* Custom step title class */
.ee-step-title {
    color: var(--ee-intro-tooltip-header-text) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    display: flex !important;
    align-items: center !important;
}

/* Driver.js native title — hidden (we use header-custom instead) */
.driver-popover-title {
    display: none !important;
}

/* Tooltip description text */
.driver-popover-description {
    padding: 20px !important;
    color: var(--ee-intro-tooltip-text) !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    display: block !important;
    margin: 0 !important;
}

/* Button container — Back on left, Next on right */
.driver-popover-footer {
    padding: 14px 20px !important;
    background: var(--ee-intro-tooltip-actions-bg) !important;
    border-top: 1px solid var(--ee-intro-tooltip-actions-border) !important;
    border-radius: 0 0 12px 12px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
}

/* Progress text hidden — step count is in our custom header */
.driver-popover-progress-text {
    display: none !important;
}

/* Navigation buttons container — spread prev/next to opposite sides */
.driver-popover-navigation-btns {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    flex-grow: 1 !important;
}

/* All buttons base style */
.driver-popover-prev-btn,
.driver-popover-next-btn {
    all: unset !important;
    flex: 0 0 auto !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-shadow: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    min-width: fit-content !important;
    box-sizing: border-box !important;
}

.driver-popover-prev-btn i.fas,
.driver-popover-prev-btn i.far,
.driver-popover-prev-btn i.fal,
.driver-popover-next-btn i.fas,
.driver-popover-next-btn i.far,
.driver-popover-next-btn i.fal {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
}

.driver-popover-prev-btn svg,
.driver-popover-next-btn svg,
.driver-popover-header-custom svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

/* Previous button — outline style */
.driver-popover-prev-btn {
    background: #fff !important;
    color: #3f51b5 !important;
    border: 2px solid #3f51b5 !important;
}

.driver-popover-prev-btn:hover {
    background: #3f51b5 !important;
    color: #fff !important;
}

/* Next / Done button — solid indigo */
.driver-popover-next-btn {
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%) !important;
    color: #fff !important;
    border: 2px solid #3f51b5 !important;
}

.driver-popover-next-btn:hover {
    background: linear-gradient(135deg, #303f9f 0%, #1a237e 100%) !important;
    border-color: #303f9f !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.4) !important;
}

/* Disabled button state */
.driver-popover-btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.driver-popover-btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Arrow hidden — tooltip is always centered, arrow is meaningless */
.driver-popover-arrow {
    display: none !important;
}

/* Mobile */
@media (max-width: 480px) {
    .driver-popover {
        min-width: 280px !important;
        max-width: calc(100vw - 40px) !important;
    }

    .driver-popover-footer {
        gap: 8px !important;
        padding: 12px 16px !important;
    }

    .driver-popover-prev-btn,
    .driver-popover-next-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        gap: 4px !important;
    }
}

/* ============================================
   Help Button Highlight Animation
   Shows when walkthrough is available on page
   ============================================ */

@keyframes helpPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(63, 81, 181, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(63, 81, 181, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(63, 81, 181, 0);
        transform: scale(1);
    }
}

@keyframes helpBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-6px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.help-highlight {
    position: relative;
    animation: helpPulse 2s ease-in-out infinite, helpBounce 1s ease-in-out;
    border-radius: 50%;
    z-index: 100;
}

.help-highlight::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 50%;
    border: 2px solid #fff;
    animation: helpPulse 1.5s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#help_button {
    position: relative;
    display: inline-block;
}

.help-highlight::before {
    content: "Page walkthrough available!";
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
    z-index: 101;
}

.help-highlight:hover::before {
    opacity: 1;
    visibility: visible;
}
