/* ================================================
   TUTORIAL TOUR - Stili lista tutorial + tour guidato
   ================================================ */

/* --- Sezione Tutorial nella pagina Profilo --- */

.tutorial-intro {
    margin-bottom: 1.5rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.tutorial-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tutorial-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gradient-card, linear-gradient(145deg, #ffffff 0%, #fafbfc 100%));
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tutorial-item:hover {
    border-color: var(--accent-blue, #667eea);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.tutorial-item:active {
    transform: translateY(0);
}

.tutorial-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: var(--gradient-purple, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.tutorial-info {
    flex: 1;
    min-width: 0;
}

.tutorial-info h4 {
    margin: 0 0 0.15rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.tutorial-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tutorial-action {
    color: var(--accent-blue, #667eea);
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

/* --- Overlay Tour --- */

.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    pointer-events: auto;
}

.tour-overlay svg {
    width: 100%;
    height: 100%;
}

/* --- Elemento evidenziato --- */

.tour-highlight {
    position: relative;
    z-index: 99999 !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.5), 0 0 20px rgba(102, 126, 234, 0.3) !important;
    border-radius: 8px;
}

/* --- Popover Tour --- */

.tour-popover {
    position: fixed;
    z-index: 100000;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: tourPopoverIn 0.3s ease;
}

@keyframes tourPopoverIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-popover-header {
    background: var(--gradient-purple, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tour-popover-header i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.tour-popover-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.tour-popover-body {
    padding: 1.25rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.6;
}

.tour-popover-footer {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.tour-step-counter {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.tour-popover-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Pulsanti navigazione tour */
.tour-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tour-btn-prev {
    background: #f1f5f9;
    color: #475569;
}

.tour-btn-prev:hover {
    background: #e2e8f0;
}

.tour-btn-next {
    background: var(--accent-blue, #667eea);
    color: #fff;
}

.tour-btn-next:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.tour-btn-finish {
    background: var(--accent-green, #10b981);
    color: #fff;
}

.tour-btn-finish:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Freccia popover */
.tour-popover-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.tour-popover-arrow.arrow-top {
    top: -8px;
    left: calc(50% - 8px);
    background: var(--gradient-purple-start, #667eea);
}

.tour-popover-arrow.arrow-bottom {
    bottom: -8px;
    left: calc(50% - 8px);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- Popover centrato (quando l'elemento non esiste) --- */

.tour-popover.tour-popover-centered {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .tour-popover {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
    }

    .tutorial-item {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }

    .tutorial-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .tutorial-info h4 {
        font-size: 0.9rem;
    }

    .tutorial-info p {
        font-size: 0.75rem;
    }

    .tour-popover-header {
        padding: 0.85rem 1rem;
    }

    .tour-popover-body {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .tour-popover-footer {
        padding: 0.65rem 1rem;
    }

    .tour-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }
}
