/**
 * Tutorial System Styles
 * Overlay sombre + bulles claires
 */

/* ===== Overlay ===== */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    backdrop-filter: blur(2px);
    animation: tutorialFadeIn 0.3s ease;
}

@keyframes tutorialFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Tooltip/Bulle ===== */
.tutorial-tooltip {
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 400px;
    min-width: 300px;
    animation: tutorialTooltipIn 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* Header */
.tutorial-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px 12px 0 0;
}

.tutorial-step-counter {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 20px;
}

.tutorial-close-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Content */
.tutorial-tooltip-content {
    padding: 16px;
}

.tutorial-tooltip-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.tutorial-tooltip-text {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

/* Footer */
.tutorial-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

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

/* Boutons */
.tutorial-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.tutorial-btn-skip {
    background: transparent;
    color: #64748b;
}

.tutorial-btn-skip:hover {
    background: #e2e8f0;
    color: #475569;
}

.tutorial-btn-prev,
.tutorial-btn-next {
    background: #f1f5f9;
    color: #475569;
}

.tutorial-btn-prev:hover,
.tutorial-btn-next:hover {
    background: #e2e8f0;
}

.tutorial-btn-finish {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.tutorial-btn-finish:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* ===== Highlight d'élément ===== */
.tutorial-highlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3) !important;
    border-radius: 4px;
    animation: tutorialPulse 2s infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.7), 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* ===== Bouton dans la navbar ===== */
.tutorial-nav-link {
    color: #fbbf24 !important;
    font-weight: 500;
}

.tutorial-nav-link:hover {
    background: rgba(251, 191, 36, 0.1) !important;
}

/* Style spécifique pour la navbar publique */
.navbar-menu .tutorial-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fbbf24 !important;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    padding: 8px 0;
}

.navbar-menu .tutorial-nav-link:hover {
    color: #f59e0b !important;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.navbar-menu .tutorial-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 0.3s;
}

.navbar-menu .tutorial-nav-link:hover::after {
    width: 100%;
}

/* ===== Liste des tutoriels (Modal) ===== */
.tutorial-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-list-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.tutorial-list-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: tutorialListIn 0.3s ease;
}

@keyframes tutorialListIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tutorial-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.tutorial-list-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tutorial-list-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.tutorial-list-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-list-body {
    padding: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.tutorial-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.tutorial-list-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.tutorial-list-item.completed {
    opacity: 0.7;
}

.tutorial-list-item.completed:hover {
    opacity: 1;
}

.tutorial-list-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.tutorial-list-info {
    flex: 1;
}

.tutorial-list-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.tutorial-list-info p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.tutorial-completed-badge {
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Scrollbar personnalisée pour la liste */
.tutorial-list-body::-webkit-scrollbar {
    width: 6px;
}

.tutorial-list-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.tutorial-list-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tutorial-list-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .tutorial-tooltip {
        max-width: 90vw;
        min-width: 280px;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    .tutorial-tooltip-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .tutorial-nav-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .tutorial-nav-buttons .tutorial-btn {
        flex: 1;
        justify-content: center;
    }
    
    .tutorial-btn-skip {
        width: 100%;
        justify-content: center;
    }
    
    .tutorial-list-content {
        width: 95%;
        margin: 20px;
    }
}
