/**
 * Attimo Guide Discovery Tour — Styles publics
 * Fichier : /attimo/public/modules/guide/css/guide-tour.css
 *
 * Inclus dans les galeries publiques quand le Guide est activé.
 * Utilise les variables CSS du thème de la galerie.
 */

/* ================================================================
   VARIABLES — Couleur thème avec fallback
   ================================================================ */
:root {
    --guide-color: var(--accent-color, #6B9ECE);
    --guide-color-light: color-mix(in srgb, var(--guide-color) 15%, transparent);
    --guide-color-dark: color-mix(in srgb, var(--guide-color) 80%, #000);
}

/* ================================================================
   FORCE HOVER — Affiche l'overlay photo pendant le guide
   ================================================================ */
.guide-force-visible .photo-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* ================================================================
   OVERLAY SOMBRE — Fond qui recouvre toute la page
   ================================================================ */
.guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-overlay.active {
    pointer-events: auto;
}

/* ================================================================
   SPOTLIGHT RING — Trou éclairé autour de l'élément cible
   ================================================================ */
.guide-spotlight-ring {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.guide-spotlight-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid var(--guide-color, #6B9ECE);
    animation: guide-pulse 2s ease-in-out infinite;
}

@keyframes guide-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* ================================================================
   TOOLTIP — Bulle d'information à côté de l'élément
   ================================================================ */
.guide-tooltip {
    position: absolute;
    z-index: 10001;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px 24px;
    max-width: 320px;
    min-width: 260px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: guide-tooltip-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

@keyframes guide-tooltip-in {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.guide-tooltip-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--guide-color-light, rgba(107, 158, 206, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.guide-tooltip-icon svg {
    width: 20px;
    height: 20px;
    color: var(--guide-color, #6B9ECE);
    stroke: var(--guide-color, #6B9ECE);
}

.guide-tooltip-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.guide-tooltip-text {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.guide-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ================================================================
   PROGRESS DOTS — Points de progression (1/5, 2/5...)
   ================================================================ */
.guide-tooltip-progress {
    display: flex;
    gap: 6px;
    align-items: center;
}

.guide-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E0E0E0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.guide-progress-dot.active {
    background: var(--guide-color, #6B9ECE);
    transform: scale(1.2);
}

.guide-progress-dot.completed {
    background: var(--guide-color, #6B9ECE);
    opacity: 0.5;
}

/* ================================================================
   BOUTONS TOOLTIP
   ================================================================ */
.guide-tooltip-next {
    background: var(--guide-color, #6B9ECE);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.guide-tooltip-next:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ================================================================
   BOUTON « NE PLUS AFFICHER »
   ================================================================ */
.guide-dismiss {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    background: rgba(255, 255, 255, 0.9);
    color: #999;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.guide-dismiss:hover {
    color: #666;
    background: rgba(255, 255, 255, 1);
}

/* ================================================================
   BULLE VIDÉO PHOTOGRAPHE (miniature pendant le tour)
   ================================================================ */
.guide-video-bubble {
    position: fixed;
    z-index: 10003;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFFFFF;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    animation: guide-bubble-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.guide-video-bubble.bottom-left {
    bottom: 24px;
    left: 24px;
}

.guide-video-bubble.bottom-right {
    bottom: 24px;
    right: 24px;
}

.guide-video-bubble video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-video-bubble::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--guide-color, #6B9ECE);
    animation: guide-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes guide-bubble-in {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ================================================================
   MODALE D'ACCUEIL (vidéo ou texte)
   ================================================================ */
.guide-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: guide-fade-in 0.4s ease-out;
}

@keyframes guide-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.guide-welcome-modal {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    animation: guide-tooltip-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-welcome-video-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: visible;
    margin: 0 auto 20px;
    border: 3px solid var(--guide-color, #6B9ECE);
    position: relative;
    flex-shrink: 0;
}

.guide-welcome-video-circle video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.guide-welcome-video-circle video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-welcome-unmute {
    position: absolute;
    top: 12px;
    right: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.guide-welcome-unmute:hover {
    background: rgba(0, 0, 0, 0.8);
}

.guide-welcome-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.guide-welcome-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #888;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.guide-welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-welcome-start {
    background: var(--guide-color, #6B9ECE);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guide-welcome-start:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.guide-welcome-later {
    background: transparent;
    color: #999;
    border: none;
    padding: 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.guide-welcome-later:hover {
    color: #666;
}

/* ================================================================
   TOAST DE FIN DE TOUR
   ================================================================ */
.guide-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10005;
    background: #FFFFFF;
    color: #333;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: guide-toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes guide-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ================================================================
   BOUTON RELANCER LE TOUR (discret, en bas de page)
   ================================================================ */
.guide-restart-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.guide-restart-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.guide-restart-btn svg {
    width: 18px;
    height: 18px;
    color: #666;
    stroke: #666;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet */
@media (max-width: 768px) {
    .guide-video-bubble {
        width: 100px;
        height: 100px;
    }

    .guide-tooltip {
        max-width: 280px;
        padding: 16px 20px;
    }

    .guide-tooltip-title {
        font-size: 16px;
    }

    .guide-welcome-modal {
        padding: 24px;
        max-width: 340px;
    }

    .guide-welcome-video-circle {
        width: 120px;
        height: 120px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .guide-video-bubble {
        width: 80px;
        height: 80px;
        bottom: 16px !important;
    }

    .guide-video-bubble.bottom-left { left: 16px; }
    .guide-video-bubble.bottom-right { right: 16px; }

    /* Bulle mobile : ancrée en haut ou en bas, jamais sur la cible */
    .guide-tooltip {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        max-width: 100%;
        width: 100%;
        padding: 14px 16px 16px;
    }

    /* Bulle compacte : l'icône passe en ligne avec le titre */
    .guide-tooltip .guide-tooltip-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .guide-tooltip .guide-tooltip-icon svg {
        width: 15px;
        height: 15px;
    }

    .guide-tooltip .guide-tooltip-title {
        font-size: 15px;
        margin: 0;
    }

    .guide-tooltip .guide-tooltip-text {
        font-size: 13px;
        line-height: 1.4;
        margin: 8px 0 12px 0;
    }

    /* Par défaut (cible en haut) → bulle en bas */
    .guide-tooltip,
    .guide-tooltip.guide-tooltip-mobile-bottom {
        bottom: 0 !important;
        top: auto !important;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    }

    /* Cible en bas → bulle en haut */
    .guide-tooltip.guide-tooltip-mobile-top {
        top: 0 !important;
        bottom: auto !important;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    .guide-dismiss {
        top: 16px;
        font-size: 11px;
    }

    .guide-welcome-modal {
        width: 95%;
        padding: 20px;
        border-radius: 16px;
    }

    .guide-welcome-video-circle {
        width: 100px;
        height: 100px;
    }

    .guide-welcome-title {
        font-size: 18px;
    }
	
	/* Libérer le haut de l'écran pendant le tour (logo tenant masqué) */
    body.guide-running .header-logo {
        display: none;
    }

    body.guide-running .public-header {
        padding: 10px 12px;
    }
}
