/* ======================================== */
/* guided-tour.css - Guided tour, help     */
/* articles, callouts, step cards          */
/* ======================================== */

/* ======================================== */
/*            Guided Tour                   */
/* ======================================== */

/* Tour Container - erzeugt einen eigenen Stacking Context ganz oben */
.tour-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647; /* Maximum z-index */
    pointer-events: none;
    isolation: isolate;
}

/* Spotlight mit box-shadow für Overlay */
.tour-spotlight {
    position: fixed;
    border-radius: 8px;
    /* pointer-events: none damit man durch das Loch klicken kann */
    pointer-events: none;
    /* Sanfte Animation beim Wechseln */
    transition: all 0.25s ease-out;
    /* Box-shadow erzeugt das dunkle Overlay mit Loch */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    /* Pulsierender Rahmen */
    border: 3px solid var(--primary, #007bff);
    animation: tourPulse 1.5s ease-in-out infinite;
}

@keyframes tourPulse {
    0%, 100% {
        border-color: var(--primary, #007bff);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65), 0 0 0 4px rgba(0, 123, 255, 0.3);
    }
    50% {
        border-color: #4da3ff;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65), 0 0 15px 6px rgba(0, 123, 255, 0.5);
    }
}

.tour-tooltip {
    position: fixed;
    z-index: 1;
    pointer-events: auto;
    background: var(--body-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 16px;
    width: 340px;
    max-width: calc(100vw - 32px);
    animation: tourFadeIn 0.3s ease-out;
}

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

.tour-tooltip-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--body-bg, #fff);
    transform: rotate(45deg);
}

/* Fix positionierter Tooltip unten rechts */
.tour-tooltip.tour-fixed {
    bottom: 24px;
    right: 24px;
    top: auto;
    left: auto;
}

/* Arrow nicht mehr nötig bei fixer Position */
.tour-tooltip.tour-fixed .tour-tooltip-arrow {
    display: none;
}

/* Legacy arrow styles für dynamische Positionierung */
.tour-tooltip.bottom .tour-tooltip-arrow {
    top: -7px;
    left: 24px;
}

.tour-tooltip.top .tour-tooltip-arrow {
    bottom: -7px;
    left: 24px;
}

.tour-tooltip.left .tour-tooltip-arrow {
    right: -7px;
    top: 24px;
}

.tour-tooltip.right .tour-tooltip-arrow {
    left: -7px;
    top: 24px;
}

.tour-tooltip.center .tour-tooltip-arrow {
    display: none;
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tour-step-counter {
    font-size: 0.75rem;
    color: var(--gray-300);
    font-weight: 600;
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 10px;
}

.tour-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-300);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tour-close-btn:hover {
    background: var(--gray-100);
    color: var(--text-color);
}

.tour-tooltip-title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.tour-tooltip-content {
    font-size: 0.9rem;
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: 16px;
    max-height: 250px;
    overflow-y: auto;
}

.tour-tooltip-content p { margin: 0 0 8px 0; }
.tour-tooltip-content ul { margin: 8px 0; padding-left: 20px; }
.tour-tooltip-content li { margin-bottom: 6px; }
.tour-tooltip-content b, .tour-tooltip-content strong { color: var(--text-color); font-weight: 600; }

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.tour-tooltip-footer .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    cursor: pointer;
}

.tour-finish-buttons {
    display: flex;
    gap: 8px;
}

/* Article Text (Help Content) - muss global sein für MarkupString */
.article-text {
    line-height: 1.6;
    color: var(--text-color);
    font-size: 13px;
}

.article-text p {
    margin: 0 0 10px 0;
}

.article-text ul {
    margin: 0 0 10px 0;
    padding-left: 24px;
    list-style-type: disc;
}

.article-text ol {
    margin: 0 0 10px 0;
    padding-left: 24px;
    list-style-type: decimal;
}

.article-text li {
    margin-bottom: 4px;
    display: list-item;
}

.article-text strong {
    font-weight: 600;
}

.article-text h3 {
    margin: 16px 0 8px 0;
    padding: 4px 0 4px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    border-left: 2px solid var(--gray-400);
    background: var(--gray-100);
}

.article-text h3:first-child {
    margin-top: 0;
}

.article-text h4 {
    margin: 12px 0 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.article-text h4:first-child {
    margin-top: 0;
}

.article-text blockquote {
    margin: 8px 0 10px 0;
    padding: 6px 10px;
    background: var(--gray-100);
    border-left: 2px solid var(--gray-400);
    font-style: italic;
    font-size: 12px;
}

.article-text blockquote p {
    margin: 0;
}

.article-text em {
    font-style: italic;
    color: var(--gray-500);
}

/* Help Section Cards */
.article-text .help-section {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.article-text .help-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.article-text .help-section-header i {
    font-size: 18px;
    color: var(--primary);
}

.article-text .help-section-body {
    padding: 14px;
}

.article-text .help-section-body > *:last-child {
    margin-bottom: 0;
}

/* Callout Boxes */
.article-text .callout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.article-text .callout i {
    font-size: 18px;
    flex-shrink: 0;
}

.article-text .callout-tip {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary-hover);
}

.article-text .callout-tip i {
    color: var(--primary);
}

.article-text .callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: #92400e;
}

.article-text .callout-warning i {
    color: var(--warning);
}

.article-text .callout-info {
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid var(--info);
    color: #075985;
}

.article-text .callout-info i {
    color: var(--info);
}

/* Step Cards */
.article-text .steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.article-text .step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}

.article-text .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.article-text .step-content {
    flex: 1;
    padding-top: 2px;
}

.article-text code {
    background: var(--gray-100);
    padding: 1px 4px;
    border-radius: 2px;
    font-family: monospace;
    font-size: 12px;
}

@media (max-width: 480px) {
    .tour-tooltip.tour-fixed {
        width: calc(100vw - 32px);
        left: 4px !important;
        right: 0;
        bottom: 16px;
    }
    .tour-tooltip-arrow { display: none; }
}
