/* ═══════════════════════════════════════════════════════════════
   Walkthrough / Guided Tour System
   Self-contained styles — safe to include on any page
   ═══════════════════════════════════════════════════════════════ */

/* ── Spotlight overlay (box-shadow trick) ── */
.walkthrough-spotlight {
    position: fixed;
    z-index: 10000;
    border-radius: 6px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* ── Tooltip card ── */
.walkthrough-tooltip {
    position: fixed;
    z-index: 10001;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 20px 22px 16px;
    max-width: 360px;
    min-width: 260px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.walkthrough-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Arrow ── */
.walkthrough-arrow {
    position: absolute;
    width: 0;
    height: 0;
}
/* Arrow pointing up (tooltip is below the element) */
.walkthrough-arrow.arrow-up {
    top: -8px;
    left: 24px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
}
/* Arrow pointing down (tooltip is above the element) */
.walkthrough-arrow.arrow-down {
    bottom: -8px;
    left: 24px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}
/* Arrow pointing left (tooltip is to the right) */
.walkthrough-arrow.arrow-left {
    left: -8px;
    top: 20px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #fff;
}
/* Arrow pointing right (tooltip is to the left) */
.walkthrough-arrow.arrow-right {
    right: -8px;
    top: 20px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #fff;
}

/* ── Step counter ── */
.walkthrough-step-counter {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Title ── */
.walkthrough-title {
    font-size: 16px;
    font-weight: 700;
    color: #1B4F8A;
    margin-bottom: 6px;
    line-height: 1.3;
}

/* ── Description ── */
.walkthrough-description {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
    margin-bottom: 16px;
}

/* ── Button row ── */
.walkthrough-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.walkthrough-buttons button {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
}
.walkthrough-btn-next {
    background: #1B4F8A;
    color: #fff;
}
.walkthrough-btn-next:hover {
    background: #164070;
}
.walkthrough-btn-back {
    background: #e9ecef;
    color: #555;
}
.walkthrough-btn-back:hover {
    background: #dde0e3;
}
.walkthrough-btn-dismiss {
    background: none;
    color: #999;
    margin-left: auto;
    padding: 7px 10px;
}
.walkthrough-btn-dismiss:hover {
    color: #666;
}

/* ── "Don't show again" checkbox ── */
.walkthrough-dismiss-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.walkthrough-dismiss-check label {
    font-size: 11px;
    color: #999;
    cursor: pointer;
    user-select: none;
}
.walkthrough-dismiss-check input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* ── Menu modal (walkthrough picker) ── */
.walkthrough-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.walkthrough-menu-overlay.visible {
    opacity: 1;
}
.walkthrough-menu {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    padding: 24px 28px;
    max-width: 420px;
    width: 90vw;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}
.walkthrough-menu h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #1B4F8A;
}
.walkthrough-menu .walkthrough-menu-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}
.walkthrough-menu-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.walkthrough-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}
.walkthrough-menu-item:hover {
    background: #f0f4ff;
}
.walkthrough-menu-item .wm-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e8eef6;
    color: #1B4F8A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.walkthrough-menu-item .wm-info {
    flex: 1;
    min-width: 0;
}
.walkthrough-menu-item .wm-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.walkthrough-menu-item .wm-steps {
    font-size: 11px;
    color: #999;
}
.walkthrough-menu-item .wm-play {
    color: #1B4F8A;
    font-size: 14px;
    flex-shrink: 0;
}
.walkthrough-menu-item.wm-completed .wm-icon {
    background: #d4edda;
    color: #28a745;
}
.walkthrough-menu-close {
    display: block;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.walkthrough-menu-close:hover {
    background: #f5f5f5;
}

/* ── Floating help button ── */
.walkthrough-help-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1B4F8A;
    color: #fff;
    display: none; /* shown by JS when walkthroughs are registered */
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(27, 79, 138, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    border: none;
}
.walkthrough-help-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(27, 79, 138, 0.45);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .walkthrough-tooltip {
        max-width: 300px;
        min-width: 220px;
        padding: 16px 18px 14px;
    }
    .walkthrough-menu {
        padding: 18px 20px;
    }
    .walkthrough-help-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 16px;
        right: 16px;
    }
}
