/* Tutorial Styles - Fun, Visual, Game-like */

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 50000;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tutorial-overlay.visible {
    opacity: 1;
}

/* When we need to click through to highlighted elements */
.tutorial-overlay.click-through {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
    pointer-events: none;
}

.tutorial-overlay.click-through .tutorial-card {
    pointer-events: auto;
}

.tutorial-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 24px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.tutorial-card.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Progress dots */
.tutorial-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.tutorial-dot.completed {
    background: #22c55e;
}

/* Mascot emoji */
.tutorial-mascot {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Title */
.tutorial-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content */
.tutorial-content {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 20px;
}

.tutorial-content strong {
    color: #8b5cf6;
    font-weight: 700;
}

/* Milestones list */
.tutorial-milestones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.tutorial-milestone {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border-left: 4px solid #e2e8f0;
    text-align: left;
    transition: all 0.2s;
}

.tutorial-milestone.tutorial-clickable {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    cursor: pointer;
    animation: milestone-pulse 1s infinite;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.tutorial-milestone.tutorial-clickable:hover {
    transform: translateX(8px);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.5);
}

.tutorial-milestone.tutorial-clicked {
    border-left-color: #22c55e;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

@keyframes milestone-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.5);
    }
}

/* Word Levels Display */
.tutorial-levels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.tutorial-level {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.level-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.5);
}

.tutorial-spaced-learning {
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    font-size: 0.85rem;
    color: #92400e;
    text-align: left;
}

/* Visual Toadstool Milestones */
.tutorial-milestones-visual {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    margin-top: 20px;
    padding: 15px 5px;
    background: linear-gradient(to bottom, transparent 60%, rgba(139, 69, 19, 0.2) 100%);
    border-radius: 12px;
}

.tutorial-toadstool {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.toadstool-cap {
    width: 45px;
    height: 35px;
    border-radius: 50% 50% 45% 45%;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.toadstool-cap::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
}

.toadstool-cap::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 10px;
    width: 5px;
    height: 5px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
}

.toadstool-stem {
    width: 18px;
    height: 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 0 0 8px 8px;
    margin-top: -3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toadstool-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 6px;
    text-align: center;
    max-width: 60px;
    line-height: 1.2;
}

/* Clickable toadstool */
.tutorial-toadstool.tutorial-clickable {
    cursor: pointer;
    opacity: 1;
    animation: toadstool-bounce 0.8s infinite;
}

.tutorial-toadstool.tutorial-clickable .toadstool-cap {
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.4), 0 4px 8px rgba(0,0,0,0.2);
}

.tutorial-toadstool.tutorial-clickable .toadstool-label {
    color: #7c3aed;
    font-weight: 700;
}

.tutorial-toadstool.tutorial-clickable:hover {
    transform: scale(1.15);
}

.tutorial-toadstool.tutorial-clicked {
    opacity: 1;
}

.tutorial-toadstool.tutorial-clicked .toadstool-cap {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.6), 0 0 15px rgba(34, 197, 94, 0.4), 0 4px 8px rgba(0,0,0,0.2);
}

.tutorial-toadstool.tutorial-clicked .toadstool-label {
    color: #16a34a;
}

@keyframes toadstool-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Quiz demo styling */
.tutorial-quiz-demo {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    border: 2px solid #e9d5ff;
}

.tutorial-word-display {
    font-family: 'Fredoka', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: #7c3aed;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.tutorial-definition {
    font-style: italic;
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.tutorial-sentence {
    font-size: 1rem;
    color: #374151;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
}

.tutorial-instruction {
    font-size: 1rem;
    color: #7c3aed;
    font-weight: 600;
    margin: 16px 0;
    padding: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(251, 191, 36, 0.3); }
}

/* Input for spelling */
.tutorial-input-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0;
}

.tutorial-input {
    flex: 1;
    max-width: 200px;
    padding: 14px 18px;
    font-size: 1.2rem;
    font-family: 'Fredoka', monospace;
    font-weight: 600;
    text-align: center;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
    text-transform: lowercase;
}

.tutorial-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.tutorial-input.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Options for multiple choice */
.tutorial-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.tutorial-option {
    padding: 14px 18px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.tutorial-option:hover:not(:disabled) {
    border-color: #8b5cf6;
    background: #faf5ff;
    transform: translateX(4px);
}

.tutorial-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

.tutorial-option.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
    animation: shake 0.5s ease;
}

.tutorial-option:disabled {
    cursor: default;
    opacity: 0.7;
}

/* Question text */
.tutorial-question {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

/* Feedback messages */
.tutorial-feedback {
    font-weight: 700;
    font-size: 1rem;
    padding: 12px;
    border-radius: 10px;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.tutorial-feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

.tutorial-feedback.correct {
    background: #dcfce7;
    color: #166534;
}

.tutorial-feedback.incorrect {
    background: #fee2e2;
    color: #dc2626;
}

/* Quick feedback popup */
.tutorial-quick-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-size: 1.5rem;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 16px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10;
}

.tutorial-quick-feedback.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.tutorial-quick-feedback.success {
    background: #dcfce7;
    color: #166534;
}

.tutorial-quick-feedback.error {
    background: #fee2e2;
    color: #dc2626;
}

/* Buttons */
.tutorial-btn {
    padding: 14px 28px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.tutorial-btn-next,
.tutorial-btn-finish {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.tutorial-btn-next:hover,
.tutorial-btn-finish:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.tutorial-btn-check {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 14px 20px;
}

.tutorial-btn-check:hover {
    transform: translateY(-2px);
}

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

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

/* Skip link */
.tutorial-skip {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.tutorial-skip:hover {
    color: #64748b;
    text-decoration: underline;
}

/* Highlight effect for target elements */
.tutorial-highlight {
    position: relative;
    z-index: 50001 !important;
    animation: highlight-pulse 1s infinite;
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.8), 0 0 40px rgba(139, 92, 246, 0.6), 0 0 80px rgba(139, 92, 246, 0.3) !important;
    border-radius: 12px;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.tutorial-highlight::before {
    content: '👆';
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: bounce-arrow 0.6s infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes highlight-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.8), 0 0 40px rgba(139, 92, 246, 0.6), 0 0 80px rgba(139, 92, 246, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0.6), 0 0 60px rgba(139, 92, 246, 0.8), 0 0 100px rgba(139, 92, 246, 0.4);
        transform: scale(1.02);
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .tutorial-card {
        padding: 20px;
        max-height: 90vh;
    }
    
    .tutorial-mascot {
        font-size: 3rem;
    }
    
    .tutorial-title {
        font-size: 1.3rem;
    }
    
    .tutorial-content {
        font-size: 0.95rem;
    }
    
    .tutorial-word-display {
        font-size: 1.8rem;
    }
    
    .tutorial-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
}
