/* css/tutorial.css */

#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000; /* Above most things, below alerts if needed */
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Allow clicking through background */
}

#tutorial-overlay.visible {
    display: flex;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Dim background */
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease-out;
}

.tutorial-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.tutorial-card.minimized {
    transform: scale(0.1) translate(-200%, 200%); /* Approximate target, JS will handle exact */
    opacity: 0;
    pointer-events: none;
}

.tutorial-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 36px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

.tutorial-close-btn:hover {
    color: #333;
}

.tutorial-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ddd;
    transition: background-color 0.3s;
}

.step-dot.active {
    background-color: #2196F3;
    transform: scale(1.2);
}

.step-dot.completed {
    background-color: #2196F3;
}

.tutorial-content {
    margin-bottom: 25px;
    text-align: left;
    min-height: 100px; /* Prevent jumpiness */
}

.tutorial-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.tutorial-text {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
}

.tutorial-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

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

.tutorial-btn-secondary {
    background-color: #f0f0f0;
    color: #555;
}

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

.tutorial-btn-primary {
    background-color: #2196F3;
    color: white;
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
}

.tutorial-btn-primary:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(33, 150, 243, 0.4);
}

.tutorial-btn-signup {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.tutorial-btn-signup:hover {
    background-color: #388E3C;
}

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

/* Bubble Mode Styles */
.tutorial-bubble {
    position: fixed;
    bottom: 80px; /* Above the bottom nav */
    right: 20px;
    width: 60px;
    height: 60px;
    background: #f32136;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2100;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid white;
}

.tutorial-bubble.visible {
    display: flex;
    animation: bubbleIn 0.5s forwards, bounce 2s infinite 1s;
}

.tutorial-bubble:hover {
    transform: scale(1.1);
}

.tutorial-bubble img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

.bubble-step-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF5252;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
}

@keyframes bubbleIn {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes minimizeToBubble {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--bubble-x), var(--bubble-y)) scale(0.1);
        opacity: 0;
    }
}

.tutorial-card.animating-to-bubble {
    animation: minimizeToBubble 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1);
}


/* Menu item style for the tutorial button when added to main menu */
#main-menu-tutorial-button {
    /* Same as other menu buttons */
}
