/**
 * Workflow Tour — Pulsende Highlights auf echten UI-Elementen
 *
 * @package OptionFinder_Member_Area
 * @version 1.0.0
 */

/* =====================================================
   OVERLAY + SPOTLIGHT
   ===================================================== */
.ofma-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: none;
}

.ofma-tour-overlay--active {
    pointer-events: auto;
}

/* SVG-Mask Overlay: dunkler Hintergrund mit Loch */
.ofma-tour-overlay__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Pulsender Ring um das Highlight-Element */
.ofma-tour-highlight {
    position: absolute;
    z-index: 10001;
    border-radius: 8px;
    pointer-events: none;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.5);
    animation: ofma-tour-pulse 1.5s ease-in-out infinite;
    transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}

@keyframes ofma-tour-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.15); }
}

/* =====================================================
   TOOLTIP / POPOVER
   ===================================================== */
.ofma-tour-tooltip {
    position: absolute;
    z-index: 10001;
    width: 340px;
    background: var(--ofma-bg-card, #fff);
    border: 1px solid var(--ofma-border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.ofma-tour-tooltip--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Pfeil */
.ofma-tour-tooltip__arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--ofma-bg-card, #fff);
    border: 1px solid var(--ofma-border, #e2e8f0);
    transform: rotate(45deg);
    z-index: -1;
}

.ofma-tour-tooltip--bottom .ofma-tour-tooltip__arrow {
    top: -7px;
    left: 24px;
    border-right: none;
    border-bottom: none;
}

.ofma-tour-tooltip--top .ofma-tour-tooltip__arrow {
    bottom: -7px;
    left: 24px;
    border-left: none;
    border-top: none;
}

.ofma-tour-tooltip--left .ofma-tour-tooltip__arrow {
    right: -7px;
    top: 16px;
    border-left: none;
    border-top: none;
}

.ofma-tour-tooltip--right .ofma-tour-tooltip__arrow {
    left: -7px;
    top: 16px;
    border-right: none;
    border-bottom: none;
}

/* Inhalt */
.ofma-tour-tooltip__step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: grab;
}

.ofma-tour-tooltip__step:active {
    cursor: grabbing;
}

.ofma-tour-tooltip__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ofma-secondary, #8b5cf6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.ofma-tour-tooltip__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ofma-text, #1e293b);
}

.ofma-tour-tooltip__desc {
    font-size: 12px;
    color: var(--ofma-text-secondary, #64748b);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Buttons */
.ofma-tour-tooltip__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ofma-tour-tooltip__progress {
    font-size: 11px;
    color: var(--ofma-text-muted, #94a3b8);
}

.ofma-tour-tooltip__btns {
    display: flex;
    gap: 6px;
}

.ofma-tour-tooltip__btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.ofma-tour-tooltip__btn--close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    color: var(--ofma-text-muted, #94a3b8);
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border: none;
    cursor: pointer;
}

.ofma-tour-tooltip__btn--close:hover {
    color: var(--ofma-text, #1e293b);
}

.ofma-tour-tooltip__btn--prev {
    background: none;
    color: var(--ofma-text-secondary, #64748b);
    border: 1px solid var(--ofma-border, #e2e8f0);
}

.ofma-tour-tooltip__btn--prev:hover {
    color: var(--ofma-text, #1e293b);
    border-color: var(--ofma-text-muted, #94a3b8);
}

.ofma-tour-tooltip__btn--next {
    background: var(--ofma-secondary, #8b5cf6);
    color: #fff;
}

.ofma-tour-tooltip__btn--next:hover {
    background: #7c3aed;
}

.ofma-tour-tooltip__btn--done {
    background: var(--ofma-success, #10b981);
    color: #fff;
}

.ofma-tour-tooltip__btn--done:hover {
    background: #059669;
}

/* =====================================================
   ZIEL-ELEMENT FREIGEBEN (klickbar durch Overlay)
   ===================================================== */
.ofma-tour-target {
    position: relative;
    z-index: auto;
    pointer-events: auto;
}

/* Quadrant-Elemente: absolute Positionierung beibehalten */
.trademap-quadrant-label.ofma-tour-target,
.trademap-quadrant-overlay.ofma-tour-target {
    position: absolute;
}

/* Quadrant-Overlay: Klicks auf darunterliegende Bubbles durchlassen */
.trademap-quadrant-overlay.ofma-tour-target {
    pointer-events: none;
}

/* Filter-Highlight: Zahnrad + Eigener-Filter via Section-Container */
.ofma-tour-filter-active .filter-config-gear,
.ofma-tour-filter-active .filter-card-add {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5);
    border-radius: 6px;
}

/* Tour über Order-Modal anheben (z-index: 1000002) */
.ofma-tour-above-modal .ofma-tour-overlay {
    z-index: 1000003;
}
.ofma-tour-above-modal .ofma-tour-highlight {
    z-index: 1000004;
}
.ofma-tour-above-modal .ofma-tour-tooltip {
    z-index: 1000004;
}

/* Highlight verstecken solange ein Modal offen ist */
.ofma-tour-filter-active.ofma-tour-filter-hidden .filter-config-gear,
.ofma-tour-filter-active.ofma-tour-filter-hidden .filter-card-add {
    box-shadow: none;
}

/* =====================================================
   DARK MODE
   ===================================================== */
.ofma-tour-tooltip[data-theme="dark"] {
    background: #1e293b;
    border-color: #475569;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__arrow {
    background: #1e293b;
    border-color: #475569;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__title {
    color: #e2e8f0;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__desc {
    color: #94a3b8;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__progress {
    color: #64748b;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__btn--close {
    color: #64748b;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__btn--close:hover {
    color: #e2e8f0;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__btn--prev {
    color: #94a3b8;
    border-color: #475569;
}

.ofma-tour-tooltip[data-theme="dark"] .ofma-tour-tooltip__btn--prev:hover {
    color: #e2e8f0;
    border-color: #94a3b8;
}

.ofma-tour-highlight[data-theme="dark"] {
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6);
}

@keyframes ofma-tour-pulse-dark {
    0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.2); }
}

.ofma-tour-highlight[data-theme="dark"] {
    animation-name: ofma-tour-pulse-dark;
}
