/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99998;
    display: none;
    pointer-events: none;
}

.tutorial-overlay.active {
    display: block;
}

.tutorial-overlay.active .tutorial-container {
    pointer-events: all;
}

.tutorial-container {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
}

.tutorial-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.tutorial-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tutorial-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.tutorial-content {
    padding: 24px;
}

.tutorial-step {
    display: none;
}

.tutorial-step.active {
    display: block;
}

.tutorial-step h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.tutorial-step p {
    font-size: 16px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.tutorial-step-image {
    width: 100%;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #e5e7eb;
}

.tutorial-highlight {
    position: absolute;
    border: 3px solid #ef4444;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 99996;
    transition: all 0.3s ease;
}

.tutorial-arrow {
    position: absolute;
    z-index: 99997;
    color: white;
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.tutorial-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tutorial-progress {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.tutorial-buttons {
    display: flex;
    gap: 8px;
}

.tutorial-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.tutorial-btn-primary {
    background: #ef4444;
    color: white;
}

.tutorial-btn-primary:hover {
    background: #dc2626;
}

.tutorial-btn-secondary {
    background: #f3f4f6;
    color: #1f2937;
}

.tutorial-btn-secondary:hover {
    background: #e5e7eb;
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tutorial-skip {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    text-decoration: underline;
}

.tutorial-skip:hover {
    color: #1f2937;
}

/* Pulsante per riaprire tutorial */
.tutorial-reopen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tutorial-reopen-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.tutorial-reopen-btn.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    .tutorial-container {
        width: 95%;
        max-width: 95%;
        max-height: 45vh;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
    }
    
    .tutorial-header h2 {
        font-size: 20px;
    }
    
    .tutorial-step h3 {
        font-size: 18px;
    }
    
    .tutorial-step p {
        font-size: 14px;
    }
    
    .tutorial-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tutorial-buttons {
        width: 100%;
    }
    
    .tutorial-btn {
        flex: 1;
    }
}
