/* styles/custom_tutorial.css */

/* Ne pas bloquer le scroll de la page */
body.tutorial-active {
    overflow: visible;
}

/* Voile sombre pour mettre en évidence la zone ciblée */
#custom-tutorial-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9997;
    pointer-events: none;
}

/* Halo d'accentuation basé sur la position de l'élément ciblé */
#custom-tutorial-highlight {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.65),
                0 0 0 2px #4CAF50,
                0 0 12px 4px rgba(76, 175, 80, 0.35);
    border-radius: 5px;
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

/* Style appliqué à l'élément ciblé pour le placer au-dessus du voile */
.tutorial-highlight {
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

/* Conteneur principal de la bulle d'aide (popover) */
#custom-tutorial-popover {
    position: fixed;
    background: linear-gradient(145deg, #0e1014 0%, #12151b 60%, #0e1014 100%);
    color: #f7f9fb;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    min-width: 280px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    z-index: 10000;
    transition: top 0.2s ease, left 0.2s ease;
    pointer-events: auto; /* Permet les clics sur la popover */
}

/* Flèche de la popover */
#custom-tutorial-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

#custom-tutorial-arrow.arrow-top {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent #0e1014 transparent;
}

#custom-tutorial-arrow.arrow-bottom {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-color: #0e1014 transparent transparent transparent;
}

#custom-tutorial-arrow.arrow-left {
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-color: transparent #0e1014 transparent transparent;
}

#custom-tutorial-arrow.arrow-right {
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #0e1014;
}

#tutorial-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

#tutorial-step-counter {
    margin: 0;
    color: #9bd7b0;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#tutorial-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #f7f9fb;
}

#tutorial-subtitle {
    margin: 0;
    color: #d6e3ff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

#tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

/* Texte d'explication */
#custom-tutorial-popover #tutorial-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
}

#tutorial-helper {
    margin: 0;
    color: #a9b4c7;
    font-size: 0.95rem;
    line-height: 1.45;
}

/* Conteneur de navigation */
#custom-tutorial-popover #tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* Style des boutons */
#custom-tutorial-popover .tutorial-button {
    background-color: #1f2937;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
    flex: 1;
}

#custom-tutorial-popover .tutorial-button:hover {
    background-color: #111827;
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

#custom-tutorial-popover #tutorial-next {
    background: linear-gradient(135deg, #1dce7a 0%, #16a85f 100%);
    color: #0b120f;
    border: 1px solid #1db56a;
    box-shadow: 0 10px 25px rgba(29, 206, 122, 0.24);
    flex: 1.2;
}

#custom-tutorial-popover #tutorial-next:hover {
    border-color: #2fe38b;
    box-shadow: 0 12px 28px rgba(29, 206, 122, 0.3);
}

#custom-tutorial-popover #tutorial-prev {
    color: #d6e3ff;
}

/* Bouton fermer */
#custom-tutorial-popover .tutorial-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    cursor: pointer;
}

.tutorial-help-button {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: linear-gradient(135deg, rgba(43, 216, 121, 0.28) 0%, rgba(20, 133, 86, 0.35) 100%);
    color: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(43, 216, 121, 0.7);
    border-radius: 9999px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(20, 133, 86, 0.28);
    z-index: 2;
    pointer-events: auto;
}

.tutorial-help-button:hover,
.tutorial-help-button:focus-visible {
    background-color: rgba(43, 216, 121, 0.2);
    border-color: rgba(43, 216, 121, 0.55);
    transform: translateY(-1px);
    gap: 8px;
    padding: 10px 12px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(20, 133, 86, 0.24);
}

.tutorial-help-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 12px;
    line-height: 1;
}

.tutorial-help-label {
    letter-spacing: 0.02em;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    margin-left: 0;
    transition: opacity 0.2s ease, max-width 0.2s ease, margin-left 0.2s ease;
}

.tutorial-help-button:hover .tutorial-help-label,
.tutorial-help-button:focus-visible .tutorial-help-label {
    max-width: 120px;
    opacity: 1;
    margin-left: 8px;
}
