/* ============================================================
   wwwroot/css/tutorial.css
   Animations and styles for Pet-Guided Onboarding
   ============================================================ */

/* 1. Spotlight Overlay */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10000;
    pointer-events: none; /* Allows clicking through to the highlight */
    transition: all 0.5s ease;
}

/* Spotlight element with neon border glow */
.tutorial-spotlight {
    position: absolute;
    border-radius: var(--radius);
    box-shadow: 0 0 0 9999px rgba(11, 15, 25, 0.75), 0 0 20px rgba(99, 102, 241, 0.4);
    border: 2px solid var(--primary-light);
    z-index: 10000;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Active guided element */
.tutorial-highlight {
    position: relative !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
    box-shadow: 0 0 25px var(--primary-light) !important;
}

/* 2. Pet Container */
#tutorial-pet-container {
    position: fixed;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.25));
}

#tutorial-pet-img {
    width: 120px;
    height: auto;
    animation: pet-float 3s ease-in-out infinite;
}

@keyframes pet-float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}

/* 3. Speech Bubble - Premium Glassmorphic */
.pet-speech-bubble {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: 280px;
    margin-bottom: 20px;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
}

body.dark .pet-speech-bubble {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.pet-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(255, 255, 255, 0.9);
}

body.dark .pet-speech-bubble::after {
    border-top-color: rgba(17, 24, 39, 0.9);
}

/* Bubble is positioned under the Pet */
.pet-speech-bubble.bubble-bottom::after {
    bottom: auto;
    top: -10px;
    border-top: none;
    border-bottom: 10px solid rgba(255, 255, 255, 0.9);
}

body.dark .pet-speech-bubble.bubble-bottom::after {
    border-bottom-color: rgba(17, 24, 39, 0.9);
}

.pet-speech-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.tutorial-btns {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    gap: 8px;
}

.tutorial-btns button {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    border: none;
    transition: var(--transition);
}

.btn-skip {
    background: transparent;
    color: var(--text-muted);
}
.btn-skip:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.btn-next {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}
.btn-next:hover {
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.3);
}

.btn-back {
    background: var(--border-color);
    color: var(--text-color);
}
.btn-back:hover {
    background: var(--text-muted);
    color: white;
}

/* 4. Pet Toast Notification (Toast container & bubbles) */
.pet-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10005;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateX(120%); /* Hidden by default */
}

.pet-toast-container.show {
    transform: translateX(0);
}

.pet-toast-bubble {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    position: relative;
    transition: var(--transition);
}

.pet-toast-bubble::after {
    display: none; /* Removed triangle pointer for modern minimalist design */
}

.pet-toast-img {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
    margin-top: -8px;
    align-self: flex-end;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

/* 5. Global Loading Transition */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#global-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-pet {
    width: 100px;
    height: auto;
    animation: loader-spin 2s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes loader-spin {
    0% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.1) rotate(4deg); }
    100% { transform: scale(1) rotate(0); }
}

.loader-bar {
    width: 200px;
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-progress {
    width: 50%;
    height: 100%;
    background: var(--primary-gradient);
    position: absolute;
    border-radius: 10px;
    animation: loader-progress-move 1.5s infinite ease-in-out;
}

@keyframes loader-progress-move {
    0% { left: -50%; }
    100% { left: 100%; }
}

/* Responsive Rules */
@media (max-width: 768px) {
    #tutorial-pet-img { width: 80px; }
    .pet-speech-bubble { max-width: 220px; font-size: 13px; }
    .loader-pet { width: 80px; }
}

