/* Tutorial System Styles */

/* Overlay - dims the rest of the screen */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tutorial-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Spotlight - highlights target element */
.tutorial-spotlight {
    position: fixed;
    background: transparent;
    border: 3px solid var(--accent-color, #00d4ff);
    border-radius: 8px;
    box-shadow: 
        0 0 0 4px rgba(0, 212, 255, 0.2),
        0 0 0 9999px rgba(0, 0, 0, 0.75),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    pointer-events: none;
    z-index: 10001;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tutorial-spotlight.active {
    opacity: 1;
    transform: scale(1);
    animation: spotlight-pulse 2s ease-in-out infinite;
}

@keyframes spotlight-pulse {
    0%, 100% {
        border-color: var(--accent-color, #00d4ff);
        box-shadow: 
            0 0 0 4px rgba(0, 212, 255, 0.2),
            0 0 0 9999px rgba(0, 0, 0, 0.75),
            inset 0 0 20px rgba(0, 212, 255, 0.1);
    }
    50% {
        border-color: rgba(0, 212, 255, 0.8);
        box-shadow: 
            0 0 0 8px rgba(0, 212, 255, 0.3),
            0 0 0 9999px rgba(0, 0, 0, 0.75),
            inset 0 0 30px rgba(0, 212, 255, 0.2);
    }
}

/* Tooltip Container */
.tutorial-tooltip-container {
    position: fixed;
    z-index: 10003;
    pointer-events: none;
}

/* Tooltip */
.tutorial-tooltip {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--accent-color, #00d4ff);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: all;
    animation: tooltip-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Tutorial Header */
.tutorial-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-progress {
    font-size: 0.85rem;
    color: var(--accent-color, #00d4ff);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color, #00d4ff), #00ff88);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Tutorial Title */
.tutorial-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Tutorial Description */
.tutorial-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 20px 0;
}

/* Info List */
.tutorial-info-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.tutorial-info-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}

.tutorial-info-list li:before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent-color, #00d4ff);
    font-size: 1.2rem;
}

/* Action Progress */
.tutorial-action-progress {
    margin: 16px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.action-progress-text {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-color, #00d4ff);
    margin-bottom: 8px;
    font-weight: 600;
}

.action-progress-text span {
    color: #fff;
}

.action-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.action-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

/* Tutorial Buttons */
.tutorial-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.tutorial-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    position: relative;
    overflow: hidden;
}

.tutorial-btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.tutorial-btn:hover:before {
    width: 300px;
    height: 300px;
}

.tutorial-btn:active {
    transform: scale(0.98);
}

/* Next Button */
.tutorial-btn-next {
    background: linear-gradient(135deg, var(--accent-color, #00d4ff), #00ff88);
    color: #0a0a1a;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

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

/* Skip Button */
.tutorial-btn-skip {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tutorial-btn-skip:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Action Button */
.tutorial-btn-action {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color, #00d4ff);
    border: 1px solid var(--accent-color, #00d4ff);
}

.tutorial-btn-action:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

/* Completion Tooltip */
.tutorial-completion {
    max-width: 500px;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--accent-color, #00d4ff);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 212, 255, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
    animation: completion-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes completion-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tutorial-completion-content {
    animation: confetti 0.6s ease-out;
}

@keyframes confetti {
    0% {
        transform: scale(0.8) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 0.8s ease-in-out infinite;
}

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

.tutorial-completion h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color, #00d4ff);
    margin: 0 0 12px 0;
    text-shadow: 0 2px 8px rgba(0, 212, 255, 0.5);
}

.tutorial-completion p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 8px 0;
}

.completion-hint {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 20px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Highlight Pulse (for combo system) */
.tutorial-highlight-pulse {
    animation: highlight-pulse 1.5s ease-in-out infinite;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(0, 212, 255, 0.8);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 90%;
        padding: 20px;
        margin: 10px;
    }
    
    .tutorial-title {
        font-size: 1.3rem;
    }
    
    .tutorial-description {
        font-size: 0.95rem;
    }
    
    .tutorial-buttons {
        flex-direction: column;
    }
    
    .tutorial-btn {
        width: 100%;
    }
    
    .tutorial-completion {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    .tutorial-completion h2 {
        font-size: 1.5rem;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tutorial-spotlight,
    .tutorial-tooltip,
    .tutorial-progress-fill,
    .action-progress-fill {
        animation: none;
        transition: none;
    }
    
    .tutorial-btn:before {
        display: none;
    }
    
    .completion-icon {
        animation: none;
    }
    
    @keyframes spotlight-pulse {
        0%, 100% {
            border-color: var(--accent-color, #00d4ff);
        }
    }
}

/* Dark theme adjustments (already dark by default) */
.tutorial-overlay {
    --accent-color: #00d4ff;
}

/* Make sure tutorial is above everything */
#tutorial-overlay {
    z-index: 10000 !important;
}

#tutorial-spotlight {
    z-index: 10001 !important;
}

#tutorial-tooltip-container {
    z-index: 10003 !important;
}