/* ==========================================================================
   Mon Studio Vidéo - Tutoriel Interactif
   Styles pour le guide utilisateur animé
   ========================================================================== */

/* --------------------------------------------------------------------------
   Overlay du tutoriel
   -------------------------------------------------------------------------- */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
}

/* S'assurer que le tutoriel ne bloque pas quand inactif */
.tutorial-spotlight:not(.active),
.tutorial-tooltip:not(.active) {
    pointer-events: none !important;
}

.tutorial-skip {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
}

.btn-skip {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-skip:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
   Spotlight (zone mise en évidence)
   -------------------------------------------------------------------------- */
.tutorial-spotlight {
    position: fixed;
    z-index: 9999;
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.75),
        0 0 30px rgba(99, 102, 241, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease;
}

.tutorial-spotlight.active {
    opacity: 1;
}

/* Animation de pulsation sur le spotlight */
.tutorial-spotlight::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 3px solid var(--color-primary);
    border-radius: calc(var(--radius-lg) + 4px);
    animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.7;
    }
}

/* --------------------------------------------------------------------------
   Tooltip (bulle d'information)
   -------------------------------------------------------------------------- */
.tutorial-tooltip {
    position: fixed;
    z-index: 10000;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    max-width: 350px;
    min-width: 280px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 2px var(--color-primary),
        0 0 30px rgba(99, 102, 241, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.tutorial-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tutorial-tooltip.centered {
    transform: translate(-50%, -50%);
}

.tutorial-tooltip.centered.active {
    transform: translate(-50%, -50%);
}

.tutorial-tooltip.animate {
    animation: tooltipBounce 0.5s ease;
}

@keyframes tooltipBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tutorial-tooltip.centered.animate {
    animation: tooltipBounceCentered 0.5s ease;
}

@keyframes tooltipBounceCentered {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Icône du tooltip */
.tooltip-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Contenu */
.tooltip-content {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.tooltip-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.tooltip-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Actions */
.tooltip-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.tooltip-actions .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-prev {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-prev:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-next {
    background: var(--color-primary);
    border: none;
    color: white;
    flex: 1;
    max-width: 150px;
}

.btn-next:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Progression */
.tooltip-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--color-primary);
    transform: scale(1.3);
}

.progress-dot.done {
    background: var(--color-success);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .tutorial-tooltip {
        max-width: calc(100vw - 40px);
        min-width: auto;
        margin: 0 20px;
    }

    .tooltip-icon {
        font-size: 2.5rem;
    }

    .tooltip-title {
        font-size: 1.1rem;
    }

    .tooltip-message {
        font-size: 0.9rem;
    }

    .tooltip-actions {
        flex-wrap: wrap;
    }

    .btn-prev, .btn-next {
        flex: 1;
        min-width: 100px;
    }

    .tooltip-progress {
        width: 100%;
        order: -1;
        margin-bottom: var(--spacing-sm);
    }
}

/* Mode portrait */
@media (orientation: portrait) {
    .tutorial-tooltip {
        max-width: 90vw;
    }
}

/* --------------------------------------------------------------------------
   Animation de la main pointant (optionnel)
   -------------------------------------------------------------------------- */
.tutorial-pointer {
    position: fixed;
    z-index: 10001;
    font-size: 2rem;
    pointer-events: none;
    animation: pointerBounce 1s ease-in-out infinite;
}

@keyframes pointerBounce {
    0%, 100% {
        transform: translateY(0) rotate(-20deg);
    }
    50% {
        transform: translateY(-10px) rotate(-20deg);
    }
}
