/**
 * Tutorial/Guided Tour Styles
 * Lightweight onboarding for new users
 */

/* Overlay - darkens the rest of the page */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Highlight cutout - makes the target element visible through the overlay */
.tutorial-highlight {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    transition: all 0.3s ease;
    pointer-events: none;
}

.tutorial-highlight::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 3px solid #4CAF50;
    border-radius: 12px;
    animation: tutorial-pulse 2s infinite;
}

@keyframes tutorial-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* Tooltip box */
.tutorial-tooltip {
    position: fixed;
    max-width: 320px;
    min-width: 280px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tutorial-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip arrow */
.tutorial-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.tutorial-tooltip.arrow-top::before {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #1a1a2e;
}

.tutorial-tooltip.arrow-bottom::before {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #1a1a2e;
}

.tutorial-tooltip.arrow-left::before {
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #1a1a2e;
}

.tutorial-tooltip.arrow-right::before {
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #1a1a2e;
}

/* Tooltip content */
.tutorial-title {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-title .step-icon {
    font-size: 24px;
}

.tutorial-text {
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
    margin: 0 0 16px 0;
}

/* Progress indicator */
.tutorial-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: #4CAF50;
    transform: scale(1.2);
}

.tutorial-dot.completed {
    background: #81C784;
}

/* Buttons */
.tutorial-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tutorial-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-btn-skip {
    background: transparent;
    color: #999;
    padding: 10px 12px;
}

.tutorial-btn-skip:hover {
    color: #fff;
}

.tutorial-btn-next {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    flex: 1;
}

.tutorial-btn-next:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-1px);
}

.tutorial-btn-finish {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    flex: 1;
}

.tutorial-btn-finish:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-1px);
}

/* Welcome overlay (first step without target) */
.tutorial-welcome {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 400px;
    width: 90%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 16px;
    padding: 30px;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.tutorial-welcome .tutorial-title {
    font-size: 24px;
    justify-content: center;
    margin-bottom: 16px;
}

.tutorial-welcome .tutorial-text {
    font-size: 15px;
    margin-bottom: 24px;
}

/* Help button to restart tutorial */
.tutorial-help-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    z-index: 9000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
}

.tutorial-help-btn .tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #333;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tutorial-help-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .tutorial-tooltip {
        max-width: calc(100vw - 40px);
        min-width: unset;
        left: 20px !important;
        right: 20px !important;
        width: auto !important;
    }

    .tutorial-welcome {
        padding: 24px;
    }

    .tutorial-title {
        font-size: 16px;
    }

    .tutorial-text {
        font-size: 13px;
    }

    .tutorial-help-btn {
        bottom: 80px; /* Above mobile navigation if present */
    }
}
