/* ──────────────────────────────────────────────────────────────────────────
   tourStyles.css — Visite guidée (module tourManager.js)

   Styles extraits de helpStyles.css lors de la refonte de la visite (chantier
   « refonte visite guidée »). Positionnement en coordonnées viewport
   (position: fixed) : tourManager.js calcule des coordonnées clampées dans le
   viewport, sans dépendre du défilement.

   z-index : la pile de boutons fixes (Aide / Prévisualiser / Contact) est à
   ~1001-1002. La visite passe au-dessus (overlay 1500 → infobulle 1601) pour ne
   jamais être masquée par ces boutons.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Notification « première visite » ─────────────────────────────────────── */
.tour-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

.tour-notification.notification-hidden {
    transform: translateY(20px);
    opacity: 0;
}

.notification-content {
    position: relative;
    padding-right: 20px;
}

.notification-content p {
    margin: 0 0 10px;
}

.close-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

/* ── Surcouche et surbrillance ────────────────────────────────────────────── */
.tour-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.15); /* léger voile pour focaliser l'attention */
    z-index: 1500;
    pointer-events: none;
}

.tour-target-highlight {
    position: fixed;
    box-shadow: 0 0 0 3px #2da288, 0 0 0 7px rgba(45, 162, 136, 0.35); /* turquoise CNED */
    border-radius: 6px;
    pointer-events: none;
    z-index: 1600;
    /* Pas de transition géométrique : l'encadré se cale EXACTEMENT sur la cible à
       chaque frame (étape suivante, défilement, redimensionnement) — une
       transition le ferait « traîner » et paraître imprécis. */
    background-color: transparent;
}

/* ── Infobulle ────────────────────────────────────────────────────────────── */
.tour-tooltip {
    position: fixed;
    background-color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    max-width: 340px;
    width: max-content;
    z-index: 1601;
    pointer-events: auto;
    border-top: 4px solid #2da288; /* accent charte CNED */
}

/* Petite flèche orientée selon le côté retenu (data-position). */
.tour-tooltip::before {
    content: '';
    position: absolute;
    border-width: 9px;
    border-style: solid;
}

.tour-tooltip[data-position="bottom"]::before {
    border-color: transparent transparent white transparent;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
}

.tour-tooltip[data-position="top"]::before {
    border-color: white transparent transparent transparent;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
}

.tour-tooltip[data-position="left"]::before {
    border-color: transparent transparent transparent white;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
}

.tour-tooltip[data-position="right"]::before {
    border-color: transparent white transparent transparent;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
}

.tour-tooltip h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #ae2585; /* rose CNED */
    font-size: 1.05em;
}

.tour-tooltip p {
    margin: 0 0 12px;
    line-height: 1.45;
}

/* ── Barre de navigation de l'infobulle ───────────────────────────────────── */
.tour-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 12px;
    gap: 8px;
}

.tour-nav-buttons {
    display: flex;
    gap: 6px;
}

.tour-nav button {
    background-color: #2da288; /* turquoise CNED */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tour-nav button:hover {
    background-color: #00bcb4;
    transform: translateY(-1px);
}

.tour-nav button.tour-prev {
    background-color: #6c757d;
}

.tour-nav button.tour-prev:hover {
    background-color: #5a6268;
}

.tour-nav button.tour-finish-early {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ccc;
}

.tour-nav button.tour-finish-early:hover {
    background-color: #eef0f2;
}

.tour-nav > span {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

/* ── Message de fin de visite ─────────────────────────────────────────────── */
.tour-complete {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.tour-complete-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tour-complete-content h3 {
    color: #ae2585; /* rose CNED */
    margin-top: 0;
}

.close-tour-btn {
    margin-top: 15px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: 90vw;
    }

    .tour-notification {
        left: 20px;
        right: 20px;
        max-width: calc(100% - 40px);
    }
}
