/* Tutorial Overlay System */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-overlay.active {
    display: block;
}

/* Tutorial Tooltip */
.tutorial-tooltip {
    position: fixed;
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    animation: slideIn 0.4s ease;
}

.tutorial-tooltip.active {
    display: block;
}

/* Dark mode support */
.dark-mode .tutorial-tooltip {
    background: #2d3748;
    color: #e2e8f0;
}

.tutorial-tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.tutorial-tooltip-icon {
    font-size: 2em;
}

.tutorial-tooltip-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

.dark-mode .tutorial-tooltip-title {
    color: var(--primary-light);
}

.tutorial-tooltip-content {
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.dark-mode .tutorial-tooltip-content {
    color: #e2e8f0;
}

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

.tutorial-progress {
    font-size: 0.9em;
    color: #666;
}

.dark-mode .tutorial-progress {
    color: #a0aec0;
}

.tutorial-buttons {
    display: flex;
    gap: 10px;
}

.tutorial-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tutorial-btn-skip {
    background: #e2e8f0;
    color: #4a5568;
}

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

.dark-mode .tutorial-btn-skip {
    background: #4a5568;
    color: #e2e8f0;
}

.dark-mode .tutorial-btn-skip:hover {
    background: #5a6678;
}

.tutorial-btn-next {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.tutorial-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Highlight element */
.tutorial-highlight {
    position: relative;
    z-index: 9997;
    box-shadow: 0 0 0 4px var(--primary-color), 0 0 0 9999px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    animation: pulse 2s infinite;
}

/* Welcome Screen */
.tutorial-welcome {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    text-align: center;
    animation: zoomIn 0.5s ease;
}

.tutorial-welcome.active {
    display: block;
}

.dark-mode .tutorial-welcome {
    background: #2d3748;
    color: #e2e8f0;
}

.tutorial-welcome-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.tutorial-welcome h2 {
    font-size: 2em;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-welcome p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.dark-mode .tutorial-welcome p {
    color: #cbd5e0;
}

.tutorial-welcome-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.tutorial-welcome-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tutorial-welcome-btn-start {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.tutorial-welcome-btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.tutorial-welcome-btn-skip {
    background: transparent;
    color: #666;
    border: 2px solid #e2e8f0;
}

.tutorial-welcome-btn-skip:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.dark-mode .tutorial-welcome-btn-skip {
    color: #a0aec0;
    border-color: #4a5568;
}

.dark-mode .tutorial-welcome-btn-skip:hover {
    background: #374151;
    border-color: #5a6678;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px var(--primary-color), 0 0 0 9999px rgba(0, 0, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 0 8px var(--primary-color), 0 0 0 9999px rgba(0, 0, 0, 0.8);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 320px;
        padding: 20px;
    }

    .tutorial-welcome {
        padding: 30px 20px;
    }

    .tutorial-welcome h2 {
        font-size: 1.5em;
    }

    .tutorial-welcome-buttons {
        flex-direction: column;
    }

    .tutorial-tooltip-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tutorial-buttons {
        width: 100%;
    }

    .tutorial-btn {
        flex: 1;
    }
}

/* Arrow pointer for tooltip */
.tutorial-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tutorial-tooltip.arrow-top::before {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent white transparent;
}

.dark-mode .tutorial-tooltip.arrow-top::before {
    border-color: transparent transparent #2d3748 transparent;
}

.tutorial-tooltip.arrow-bottom::before {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-color: white transparent transparent transparent;
}

.dark-mode .tutorial-tooltip.arrow-bottom::before {
    border-color: #2d3748 transparent transparent transparent;
}

.tutorial-tooltip.arrow-left::before {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.dark-mode .tutorial-tooltip.arrow-left::before {
    border-color: transparent #2d3748 transparent transparent;
}

.tutorial-tooltip.arrow-right::before {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.dark-mode .tutorial-tooltip.arrow-right::before {
    border-color: transparent transparent transparent #2d3748;
}
