/**
 * Gamofile Interactive Tour & Spotlight Engine - Gaming Pop Design
 * Strictly uses CSS Variables for theme adaptability.
 */

/* Overlay sombre avec découpe Spotlight */
.gamo-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 99990;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Cadre lumineux de surbrillance (Spotlight box) */
.gamo-tour-spotlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.72), 0 0 25px var(--accent);
    border: 2px solid var(--accent);
    z-index: 99995;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    animation: gamoTourPulse 2s infinite ease-in-out;
}

@keyframes gamoTourPulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.72), 0 0 15px var(--accent);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75), 0 0 30px var(--accent), 0 0 45px var(--color-indigo, #6366f1);
    }
}

/* Carte volante d'explication (Coach-mark popover) */
.gamo-tour-card {
    position: absolute;
    z-index: 100000;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    box-shadow: var(--shadow-pop, 0 14px 40px rgba(0, 0, 0, 0.22));
    padding: 1.3em;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
    opacity: 0;
    transform: translateY(10px);
}

.gamo-tour-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* En-tête de la carte volante */
.gamo-tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75em;
}

.gamo-tour-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.25em 0.75em;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-indigo, #6366f1);
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gamo-tour-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.gamo-tour-close-btn:hover {
    background: var(--bg-hover-light);
    color: var(--text-primary);
}

/* Contenu textuel */
.gamo-tour-title {
    margin: 0 0 0.4em 0;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.gamo-tour-body {
    margin: 0 0 1.1em 0;
    font-size: 0.88em;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Pied d'action et boutons */
.gamo-tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6em;
    padding-top: 0.75em;
    border-top: 1px solid var(--border-light);
}

.gamo-tour-btn-group {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.gamo-tour-btn {
    padding: 0.55em 1em;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    text-decoration: none;
}

.gamo-tour-btn:active {
    transform: scale(0.97);
}

.gamo-tour-btn-primary {
    background: var(--gradient-primary);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-sm);
}

.gamo-tour-btn-secondary {
    background: var(--bg-hover-light);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.gamo-tour-btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.55em 0.6em;
}

.gamo-tour-btn-ghost:hover {
    color: var(--text-primary);
}

/* Flèche d'ancrage dynamique */
.gamo-tour-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    transform: rotate(45deg);
    z-index: -1;
}

.gamo-tour-card[data-placement="bottom"] .gamo-tour-arrow {
    top: -7px;
    left: calc(50% - 6px);
    border-bottom: none;
    border-right: none;
}

.gamo-tour-card[data-placement="top"] .gamo-tour-arrow {
    bottom: -7px;
    left: calc(50% - 6px);
    border-top: none;
    border-left: none;
}

.gamo-tour-card[data-placement="right"] .gamo-tour-arrow {
    left: -7px;
    top: calc(50% - 6px);
    border-top: none;
    border-right: none;
}

.gamo-tour-card[data-placement="left"] .gamo-tour-arrow {
    right: -7px;
    top: calc(50% - 6px);
    border-bottom: none;
    border-left: none;
}

/* Adaptations Mobiles (< 768px) */
@media (max-width: 768px) {
    .gamo-tour-card {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        left: 12px !important;
        padding: 1.1em !important;
        border-radius: 14px !important;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3) !important;
    }

    .gamo-tour-arrow {
        display: none !important;
    }

    .gamo-tour-title {
        font-size: 1rem !important;
    }

    .gamo-tour-body {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
        margin-bottom: 0.8em !important;
    }

    .gamo-tour-btn {
        padding: 0.5em 0.85em !important;
        font-size: 0.82rem !important;
        min-height: 38px;
    }

    .gamo-tour-badge {
        font-size: 0.7rem !important;
        padding: 0.2em 0.6em !important;
    }
}
