/* ==========================================================================
   CMSchule Guided Tour Component (assets/tour/tour.css)
   100% Vanilla CSS, Zero-Dependency, Modern Spotlight Onboarding System
   ========================================================================== */

:root {
    --cmschule-tour-primary: #4F46E5;
    --cmschule-tour-primary-hover: #4338CA;
    --cmschule-tour-border: #E2E8F0;
    --cmschule-tour-bg: #FFFFFF;
    --cmschule-tour-text-title: #0F172A;
    --cmschule-tour-text-body: #475569;
}

/* Tour Root Overlay Container */
.cmschule-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99990;
    pointer-events: auto;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmschule-tour-overlay.cmschule-tour-active {
    opacity: 1;
}

/* Dynamic Spotlight Cutout Frame */
.cmschule-tour-spotlight {
    position: fixed;
    border-radius: 8px;
    border: 2px solid #6366F1;
    /* Infinite box-shadow creates the dimmed background with an exact cutout */
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.72), 0 0 24px rgba(99, 102, 241, 0.5);
    pointer-events: none;
    z-index: 99991;
    transition: top 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                left 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.25s ease;
}

/* Floating Tour Popover / Card */
.cmschule-tour-popover {
    position: fixed;
    width: 350px;
    max-width: calc(100vw - 32px);
    background: var(--cmschule-tour-bg);
    color: var(--cmschule-tour-text-body);
    border: 1px solid var(--cmschule-tour-border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 20px 35px -8px rgba(15, 23, 42, 0.3), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 99995;
    text-align: left;
    transition: top 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                left 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s ease,
                opacity 0.2s ease;
    animation: cmschuleTourPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Popover Header */
.cmschule-tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cmschule-tour-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--cmschule-tour-text-title);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmschule-tour-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #64748B;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.cmschule-tour-close:hover {
    color: var(--cmschule-tour-text-title);
    background: #F1F5F9;
}

/* Popover Body */
.cmschule-tour-body {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--cmschule-tour-text-body);
    margin: 0 0 16px 0;
}

/* Popover Footer */
.cmschule-tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F1F5F9;
    padding-top: 12px;
}

/* Step Indicator & Progress Dots */
.cmschule-tour-progress {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cmschule-tour-step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #CBD5E1;
    transition: all 0.2s ease;
}

.cmschule-tour-step-dot.active {
    width: 18px;
    border-radius: 4px;
    background: var(--cmschule-tour-primary);
}

.cmschule-tour-step-count {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-left: 6px;
    font-weight: 500;
}

/* Actions Group */
.cmschule-tour-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmschule-tour-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.80rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cmschule-tour-btn-ghost {
    background: transparent;
    color: #64748B;
    border: 1px solid transparent;
}

.cmschule-tour-btn-ghost:hover {
    color: var(--cmschule-tour-text-title);
    background: #F8FAFC;
}

.cmschule-tour-btn-secondary {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}

.cmschule-tour-btn-secondary:hover {
    background: #E2E8F0;
    color: var(--cmschule-tour-text-title);
}

.cmschule-tour-btn-primary {
    background: var(--cmschule-tour-primary);
    color: #FFFFFF;
    border: 1px solid var(--cmschule-tour-primary-hover);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.cmschule-tour-btn-primary:hover {
    background: var(--cmschule-tour-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .cmschule-tour-popover {
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        bottom: 20px !important;
        top: auto !important;
        transform: none !important;
    }
}
