/* =========================================================
   BlopperBold Labs - Interactive Tutorial Stylesheet
========================================================= */

/* Backdrop overlay */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(8, 5, 16, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.tutorial-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Tutorial card popup */
.tutorial-card {
    position: fixed;
    z-index: 100000;
    width: min(440px, calc(100vw - 32px));
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, rgba(20, 16, 38, 0.95), rgba(8, 5, 16, 0.95));
    box-shadow: 
        0 24px 70px rgba(0, 0, 0, 0.6),
        0 0 35px rgba(124, 58, 237, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    pointer-events: none;
    transition: 
        opacity 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), 
        transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
        left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tutorial-card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Card Header */
.tutorial-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.tutorial-card-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--accent, #fbc531);
    background: linear-gradient(135deg, var(--accent, #fbc531), var(--accent-2, #38bdf8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tutorial-card-progress {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--muted, rgba(255, 255, 255, 0.6));
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

/* Card Content text */
.tutorial-card-text {
    margin: 0 0 20px;
    font-size: 0.94rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

/* Card Button area */
.tutorial-card-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tutorial-btn-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons basic */
.tutorial-card button {
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.tutorial-card button:active {
    transform: scale(0.96);
}

/* Action button (Next/Finish) */
.tutorial-btn-next {
    padding: 10px 18px;
    border-radius: 12px;
    color: #07111f;
    background: linear-gradient(135deg, var(--accent, #fbc531), var(--accent-2, #38bdf8));
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}

.tutorial-btn-next:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.35);
}

/* Secondary button (Back) */
.tutorial-btn-back {
    padding: 10px 14px;
    border-radius: 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.tutorial-btn-back:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* Skip link button */
.tutorial-btn-skip {
    padding: 10px 0;
    color: var(--muted, rgba(255, 255, 255, 0.6));
    background: transparent !important;
    font-weight: 700 !important;
    opacity: 0.78;
}

.tutorial-btn-skip:hover {
    color: #ffffff;
    opacity: 1;
    text-decoration: underline;
}

/* Close icon */
.tutorial-card-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--muted, rgba(255, 255, 255, 0.5));
    font-size: 1.3rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 10;
    transition: color 0.15s ease;
}

.tutorial-card-close:hover {
    color: #ffffff;
}

/* Target Spotlight */
.tutorial-highlighted {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
    outline: 3px solid var(--accent, #fbc531) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 28px rgba(251, 197, 49, 0.6) !important;
    transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

/* Floating Help FAB button */
.tutorial-help-trigger {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.85), rgba(15, 23, 42, 0.85));
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--accent, #fbc531);
    font-size: 1.3rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.24s cubic-bezier(0.18, 0.9, 0.24, 1), box-shadow 0.24s ease, filter 0.2s ease;
    padding: 0;
    line-height: 1;
}

.tutorial-help-trigger:hover {
    transform: translateY(-3px) scale(1.08);
    filter: brightness(1.08);
    box-shadow: 
        0 14px 30px rgba(0, 0, 0, 0.45),
        0 0 20px rgba(124, 58, 237, 0.22);
}

.tutorial-help-trigger:active {
    transform: translateY(0) scale(0.95);
}

/* Mobile responsive layout */
@media (max-width: 600px) {
    .tutorial-card {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        top: auto !important;
        transform: translateY(20px) scale(0.98);
        border-radius: 20px;
        padding: 20px;
    }
    
    .tutorial-card.show {
        transform: translateY(0) scale(1);
    }
    
    .tutorial-help-trigger {
        width: 44px;
        height: 44px;
        bottom: 12px;
        left: 12px;
        font-size: 1.15rem;
    }
}

/* =========================================================
   Victory State & Confetti Animations
   ========================================================= */

.tutorial-card.tutorial-success-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid rgba(251, 197, 49, 0.4);
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.7),
        0 0 45px rgba(251, 197, 49, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: tutorial-success-pulse 2.5s infinite alternate;
}

@keyframes tutorial-success-pulse {
    0% {
        border-color: rgba(251, 197, 49, 0.3);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(251, 197, 49, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
    100% {
        border-color: rgba(56, 189, 248, 0.5);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 50px rgba(56, 189, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

.tutorial-success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: tutorial-fade-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tutorial-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tutorial-success-icon {
    font-size: 3.8rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(251, 197, 49, 0.45));
    animation: tutorial-bounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
}

@keyframes tutorial-bounce {
    0% {
        transform: translateY(0) scale(0.95);
    }
    100% {
        transform: translateY(-8px) scale(1.05);
    }
}

.tutorial-success-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--accent, #fbc531), var(--accent-2, #38bdf8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tutorial-success-text {
    margin: 0 0 22px;
    font-size: 0.94rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.tutorial-success-btn {
    padding: 12px 28px;
    border-radius: 14px;
    font-size: 0.92rem !important;
    font-weight: 800;
    color: #07111f;
    background: linear-gradient(135deg, var(--accent, #fbc531), var(--accent-2, #38bdf8));
    box-shadow: 0 8px 24px rgba(251, 197, 49, 0.35);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.tutorial-success-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 28px rgba(251, 197, 49, 0.45);
}

.tutorial-success-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Confetti particles */
.tutorial-confetti {
    position: fixed;
    z-index: 100001;
    pointer-events: none;
    left: 50%;
    top: 50%;
    animation: tutorial-confetti-burst 1.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes tutorial-confetti-burst {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--rot));
        opacity: 0;
    }
}

