/* Guided Tour — Sprint 13 / S13-1
 * Cyberpunk-Fee-Theme: cyan → pink → purple Gradient,
 * fairy-sparkle-Animations, shimmer-shadow. Subtle, professional
 * with a wink. Respects prefers-reduced-motion.
 */

.guided-tour-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        rgb(15, 23, 42, 0.55) 0%,
        rgb(2, 6, 23, 0.78) 100%
    );
    z-index: var(--z-tour);
    pointer-events: auto;
    animation: fairy-backdrop-fade 220ms ease-out;
}

@keyframes fairy-backdrop-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.guided-tour-highlight {
    position: absolute;
    border: 2px solid var(--primary-glow);
    border-radius: var(--r-lg);
    box-shadow:
        0 0 0 9999px rgb(2, 6, 23, 0.55),
        0 0 24px var(--primary-glow),
        0 0 40px var(--accent-tint),
        inset 0 0 12px var(--accent-tint);
    z-index: calc(var(--z-tour) + 1);
    pointer-events: none;
    transition: all 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fairy-highlight-pulse 3s ease-in-out infinite;
}

@keyframes fairy-highlight-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 9999px rgb(2, 6, 23, 0.55),
            0 0 24px var(--primary-glow),
            0 0 40px var(--accent-tint),
            inset 0 0 12px var(--accent-tint);
    }
    50% {
        box-shadow:
            0 0 0 9999px rgb(2, 6, 23, 0.55),
            0 0 32px var(--primary-glow),
            0 0 56px var(--accent-glow),
            inset 0 0 16px var(--accent-glow);
    }
}

@media (prefers-reduced-motion: reduce) {
    .guided-tour-backdrop { animation: none; }
    .guided-tour-highlight {
        transition: none;
        animation: none;
    }
}

.guided-tour-popover {
    z-index: calc(var(--z-tour) + 2);
    background: var(--surface);
    color: var(--fg);
    border-radius: var(--r-xl);
    padding: 1.25rem 1.5rem;
    max-width: 440px;
    min-width: 340px;
    font-size: 0.9375rem;
    line-height: 1.55;

    /* Cyberpunk-Fee Double-Border: innerer pink-cyan gradient + äußerer subtle shadow */
    box-shadow:
        0 0 0 1px var(--accent-tint),
        0 12px 40px var(--primary-tint),
        0 24px 64px rgb(15, 23, 42, 0.28);

    /* Shimmer-Border overlay */
    position: absolute;
}

.guided-tour-popover::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: var(--r-2xl);
    padding: 2px;
    background: linear-gradient(
        135deg,
        var(--primary-glow) 0%,
        var(--accent-glow) 45%,
        var(--accent-glow) 100%
    );
    background-size: 200% 200%;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: xor;
    mask-composite: exclude;
    animation: fairy-shimmer 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1; /* local stacking-context */
}

@keyframes fairy-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .guided-tour-popover::before { animation: none; }
}

[data-theme="dark"] .guided-tour-popover {
    background: var(--surface);
    color: var(--fg);
    box-shadow:
        0 0 0 1px var(--accent-tint),
        0 12px 40px var(--primary-glow),
        0 24px 72px rgb(0, 0, 0, 0.55); /* design-spec: tour popover deep-shadow for focus isolation */
}

.guided-tour-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.guided-tour-progress {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    /* Cyan-Pink-Gradient-Text */
    background: linear-gradient(90deg, var(--primary), var(--accent) 50%, var(--accent));
    background-clip: text;
    background-clip: text;
    color: transparent;
}

.guided-tour-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: rgb(100, 116, 139, 0.8);
    cursor: pointer;
    padding: 0 0.25rem;
    transition: color 180ms ease;
}

.guided-tour-close:hover {
    color: var(--accent);
}

.guided-tour-title {
    font-size: 1.1875rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sparkle-Icon prefix (only first step of tour) */
.guided-tour-title::before {
    content: "✨";
    font-size: 1rem;
    animation: fairy-pulse 2.5s ease-in-out infinite;
}

@keyframes fairy-pulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .guided-tour-title::before { animation: none; }
}

.guided-tour-body {
    margin-bottom: 1.25rem;
    color: var(--fg-2);
}

[data-theme="dark"] .guided-tour-body {
    color: var(--fg-2);
}

.guided-tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid var(--accent-tint);
    padding-top: 0.75rem;
}

.guided-tour-nav {
    display: flex;
    gap: 0.5rem;
}

/* .btn-primary styling delegated to Aurora v4 bridge
   (fairy-aurora-components.css). Removed the cyan-pink-gradient
   override — one consistent button identity app-wide. */

.guided-tour-mobile-hint {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: calc(var(--z-tour) + 10);
    max-width: 480px;
    margin: 0 auto;
    border-left: 4px solid var(--accent);
    box-shadow: 0 4px 16px var(--accent-tint);
}

/* Banner auf dem Dashboard */
.guided-tour-banner {
    position: relative;
    padding: 1rem 1.25rem;
    background: linear-gradient(
        135deg,
        var(--primary-tint) 0%,
        var(--accent-tint) 50%,
        var(--accent-tint) 100%
    );
    border-radius: var(--r-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.guided-tour-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--r-xl);
    padding: 1px;
    background: linear-gradient(
        135deg,
        var(--primary-glow),
        var(--accent-glow),
        var(--accent-glow)
    );
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.guided-tour-banner-icon {
    font-size: 1.75rem;
    color: var(--accent);
    flex-shrink: 0;
    animation: fairy-pulse 2.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .guided-tour-banner-icon { animation: none; }
}

.guided-tour-banner-content {
    flex-grow: 1;
}

.guided-tour-banner-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    background-clip: text;
    background-clip: text;
    color: transparent;
}

.guided-tour-banner-meta {
    font-size: 0.875rem;
    color: var(--fg-2);
}

[data-theme="dark"] .guided-tour-banner-meta {
    color: var(--fg-3);
}

.guided-tour-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================
   Help / Tour-Handout (statisches Druckbild)
   ============================================ */

.help-tour-steps {
    list-style: none;
    counter-reset: tour-step;
}

.help-tour-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent) 50%, var(--accent));
    color: var(--on-primary);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.help-tour-step-body {
    padding-left: 2.5rem;
    line-height: 1.6;
}

@media print {
    /* Print-Mode optimiert für A4-Handout */
    body { background: var(--print-bg) !important; color: var(--print-fg) !important; }
    .header, .footer, .mega-menu, .breadcrumb, .toast-container,
    .alert-dismissible, .d-print-none, .guided-tour-banner,
    .modal, .command-palette-modal { display: none !important; }
    .help-tour-handout { max-width: 100% !important; }
    .help-tour-step { break-inside: avoid; }
    .help-tour-step-number {
        background: var(--print-fg) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    a { color: var(--print-fg); text-decoration: none; }
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
        color: var(--fg-3);
    }
}
