/**
 * Tactizen Tutorial System Styles
 *
 * Dark theme with green (#22c55e) and blue (#3b82f6) accents
 * Matches the Tactizen visual design language
 */

/* ==========================================
   Overlay - Dark Semi-transparent Backdrop
   ========================================== */

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99990;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* ==========================================
   Spotlight Container & Effect
   ========================================== */

.tutorial-spotlight-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99991;
}

.tutorial-spotlight {
    position: absolute;
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.75),
        0 0 30px rgba(34, 197, 94, 0.4),
        inset 0 0 20px rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: spotlight-pulse 2s ease-in-out infinite;
}

@keyframes spotlight-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 9999px rgba(0, 0, 0, 0.75),
            0 0 30px rgba(34, 197, 94, 0.4),
            inset 0 0 20px rgba(34, 197, 94, 0.1);
        border-color: rgba(34, 197, 94, 0.6);
    }
    50% {
        box-shadow:
            0 0 0 9999px rgba(0, 0, 0, 0.75),
            0 0 50px rgba(34, 197, 94, 0.6),
            inset 0 0 30px rgba(34, 197, 94, 0.2);
        border-color: rgba(34, 197, 94, 0.9);
    }
}

/* ==========================================
   Highlighted Element Styles
   ========================================== */

.tutorial-highlight {
    position: relative;
    z-index: 99992 !important;
    pointer-events: auto !important;
}

/* Don't change position of modals - they need to stay fixed */
.modal.tutorial-highlight {
    position: fixed !important;
}

.tutorial-pulse {
    animation: element-pulse 1.5s ease-in-out infinite;
}

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

/* ==========================================
   Tooltip Styles
   ========================================== */

.tutorial-tooltip {
    position: absolute;
    z-index: 99995;
    max-width: 400px;
    min-width: 280px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(26, 31, 46, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(34, 197, 94, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.tutorial-tooltip-centered {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    max-width: 500px;
}

.tutorial-tooltip-centered.active {
    transform: translate(-50%, -50%) scale(1);
}

/* Tooltip Arrow */
.tutorial-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(34, 197, 94, 0.4);
    transform: rotate(45deg);
}

.tutorial-tooltip-top .tutorial-tooltip-arrow {
    bottom: -9px;
    left: 50%;
    margin-left: -8px;
    border-top: none;
    border-left: none;
}

.tutorial-tooltip-bottom .tutorial-tooltip-arrow {
    top: -9px;
    left: 50%;
    margin-left: -8px;
    border-bottom: none;
    border-right: none;
}

.tutorial-tooltip-left .tutorial-tooltip-arrow {
    right: -9px;
    top: 50%;
    margin-top: -8px;
    border-top: none;
    border-left: none;
}

.tutorial-tooltip-right .tutorial-tooltip-arrow {
    left: -9px;
    top: 50%;
    margin-top: -8px;
    border-bottom: none;
    border-right: none;
}

.tutorial-tooltip-centered .tutorial-tooltip-arrow {
    display: none;
}

/* Tooltip Content */
.tutorial-tooltip-content {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(34, 197, 94, 0.15);
}

.tutorial-tooltip-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    font-family: 'Orbitron', 'Poppins', sans-serif;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.tutorial-tooltip-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.tutorial-tooltip-hint {
    color: rgba(59, 130, 246, 0.9);
    font-size: 0.875rem;
    margin: 1rem 0 0 0;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-tooltip-hint i {
    color: #fbbf24;
    font-size: 1rem;
}

/* ==========================================
   Tutorial Controls (Buttons)
   ========================================== */

.tutorial-controls {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

.tutorial-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.tutorial-btn:hover {
    transform: translateY(-2px);
}

.tutorial-btn:active {
    transform: translateY(0);
}

.tutorial-btn-next,
.tutorial-btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.tutorial-btn-next:hover,
.tutorial-btn-primary:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.tutorial-btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tutorial-btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.tutorial-btn-skip {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid transparent;
}

.tutorial-btn-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* ==========================================
   Progress Indicator (Step Dots)
   ========================================== */

.tutorial-progress {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99996;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.tutorial-progress-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    padding-right: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-progress-dots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tutorial-progress-dot.completed {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.tutorial-progress-dot.current {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
    animation: current-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes current-dot-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

.tutorial-progress-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-family: 'Roboto Mono', monospace;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   Reward Popup
   ========================================== */

.tutorial-reward-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 99999;
    min-width: 350px;
    max-width: 450px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(26, 31, 46, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(34, 197, 94, 0.5);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(34, 197, 94, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-reward-popup.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.tutorial-reward-title {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    font-family: 'Orbitron', 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tutorial-reward-title i {
    color: #fbbf24;
    font-size: 2rem;
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5));
    animation: trophy-bounce 0.6s ease-out;
}

@keyframes trophy-bounce {
    0% {
        transform: scale(0) rotate(-20deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.tutorial-completion-name {
    color: #22c55e;
    font-size: 1.1rem;
    font-weight: 600;
    margin: -0.5rem 0 1.5rem 0;
    text-align: center;
    font-family: 'Orbitron', 'Poppins', sans-serif;
}

.tutorial-completion-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.tutorial-reward-item.level-up {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

.tutorial-reward-item.level-up .tutorial-reward-icon {
    color: #fbbf24;
}

.tutorial-reward-item.level-up .tutorial-reward-value {
    color: #fbbf24;
}

.tutorial-reward-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tutorial-reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    animation: reward-slide-in 0.5s ease-out backwards;
}

.tutorial-reward-item:nth-child(1) {
    animation-delay: 0.2s;
}

.tutorial-reward-item:nth-child(2) {
    animation-delay: 0.4s;
}

.tutorial-reward-item:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes reward-slide-in {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-reward-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.2);
    font-size: 1.5rem;
    color: #22c55e;
}

.tutorial-reward-icon.gold {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.tutorial-reward-icon.gems {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.tutorial-reward-value {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Orbitron', 'Roboto Mono', monospace;
}

/* ==========================================
   Error Message
   ========================================== */

.tutorial-error {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 99999;
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.8);
    border-radius: 12px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3);
    animation: error-slide-in 0.3s ease-out;
}

@keyframes error-slide-in {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-error i {
    font-size: 1.25rem;
}

.tutorial-error button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    transition: color 0.2s ease;
}

.tutorial-error button:hover {
    color: #ffffff;
}

/* ==========================================
   Mobile Responsive Styles
   ========================================== */

@media (max-width: 768px) {
    .tutorial-tooltip {
        position: fixed !important;
        max-width: calc(100vw - 2rem);
        min-width: auto;
        width: auto !important;
        right: auto !important;
    }

    .tutorial-tooltip-centered {
        top: auto !important;
        bottom: 6rem !important;
        left: 1rem !important;
        right: 1rem !important;
        transform: translateY(0) scale(0.95);
        max-width: none;
    }

    .tutorial-tooltip-centered.active {
        transform: translateY(0) scale(1);
    }

    .tutorial-tooltip-content {
        padding: 1.25rem;
    }

    .tutorial-tooltip-title {
        font-size: 1.1rem;
    }

    .tutorial-tooltip-text {
        font-size: 0.9rem;
    }

    .tutorial-controls {
        padding: 0.875rem 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tutorial-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .tutorial-progress {
        bottom: 1rem;
        padding: 0.5rem 1rem;
        gap: 0.75rem;
        max-width: calc(100vw - 2rem);
    }

    .tutorial-progress-label {
        display: none;
    }

    .tutorial-progress-dot {
        width: 8px;
        height: 8px;
    }

    .tutorial-reward-popup {
        min-width: auto;
        max-width: calc(100vw - 2rem);
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .tutorial-reward-title {
        font-size: 1.4rem;
    }

    .tutorial-reward-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .tutorial-reward-value {
        font-size: 1.1rem;
    }

    .tutorial-error {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
}

@media (max-width: 480px) {
    .tutorial-tooltip-content {
        padding: 1rem;
    }

    .tutorial-tooltip-title {
        font-size: 1rem;
    }

    .tutorial-tooltip-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .tutorial-tooltip-hint {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .tutorial-controls {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .tutorial-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }

    .tutorial-btn i {
        display: none;
    }

    .tutorial-progress {
        padding: 0.5rem 0.875rem;
        gap: 0.5rem;
        border-radius: 30px;
    }

    .tutorial-progress-dots {
        gap: 0.35rem;
    }

    .tutorial-progress-dot {
        width: 6px;
        height: 6px;
    }

    .tutorial-progress-count {
        font-size: 0.75rem;
        padding-left: 0.5rem;
    }

    .tutorial-reward-popup {
        padding: 1.25rem;
    }

    .tutorial-reward-title {
        font-size: 1.2rem;
        gap: 0.5rem;
    }

    .tutorial-reward-title i {
        font-size: 1.5rem;
    }

    .tutorial-reward-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .tutorial-reward-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .tutorial-reward-value {
        font-size: 1rem;
    }
}

/* Extra small screens (very narrow mobile) */
@media (max-width: 400px) {
    .tutorial-tooltip {
        left: 0.5rem !important;
        right: 0.5rem !important;
        max-width: calc(100vw - 1rem);
    }

    .tutorial-tooltip-centered {
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 4.5rem;
    }

    .tutorial-tooltip-content {
        padding: 0.875rem;
    }

    .tutorial-tooltip-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .tutorial-tooltip-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .tutorial-tooltip-hint {
        font-size: 0.85rem;
        padding: 0.625rem;
        margin-top: 0.75rem;
    }

    .tutorial-controls {
        padding: 0.75rem 0.875rem;
        gap: 0.375rem;
        flex-wrap: wrap;
    }

    .tutorial-btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch-friendly minimum */
        flex: 1 1 auto;
        justify-content: center;
    }

    .tutorial-btn-skip {
        flex: 0 0 auto;
        order: -1;
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .tutorial-btn-back,
    .tutorial-btn-next {
        flex: 1;
    }

    .tutorial-progress {
        bottom: 0.5rem;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .tutorial-progress-dots {
        gap: 0.25rem;
    }

    .tutorial-progress-dot {
        width: 8px;
        height: 8px;
    }

    .tutorial-progress-count {
        font-size: 0.8rem;
        padding-left: 0.5rem;
    }

    .tutorial-reward-popup {
        padding: 1rem;
        margin: 0 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .tutorial-reward-title {
        font-size: 1.1rem;
    }

    .tutorial-reward-item {
        padding: 0.625rem;
    }

    .tutorial-reward-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .tutorial-reward-value {
        font-size: 0.95rem;
    }

    .tutorial-error {
        left: 0.5rem;
        right: 0.5rem;
        top: 0.5rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================
   Additional Animations
   ========================================== */

/* Smooth transition for steps */
.tutorial-tooltip,
.tutorial-spotlight {
    will-change: transform, opacity;
}

/* Glow effect for highlighted interactive elements */
.tutorial-highlight::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: transparent;
    border: 2px solid transparent;
    pointer-events: none;
    animation: highlight-ring 2s ease-in-out infinite;
}

@keyframes highlight-ring {
    0%, 100% {
        border-color: rgba(34, 197, 94, 0.3);
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
    }
    50% {
        border-color: rgba(34, 197, 94, 0.6);
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    }
}

/* Scan line effect on tooltip header (matching Tactizen style) */
.tutorial-tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.8), transparent);
    animation: tooltip-scan 3s linear infinite;
}

@keyframes tooltip-scan {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Fade out animation for closing elements */
.tutorial-overlay.closing,
.tutorial-tooltip.closing,
.tutorial-reward-popup.closing {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* Accessibility - reduce motion */
@media (prefers-reduced-motion: reduce) {
    .tutorial-spotlight,
    .tutorial-progress-dot.current,
    .tutorial-pulse,
    .tutorial-tooltip::before,
    .tutorial-highlight::after {
        animation: none;
    }

    .tutorial-tooltip,
    .tutorial-overlay,
    .tutorial-reward-popup {
        transition-duration: 0.1s;
    }
}

/* Mobile performance - reduce animations to prevent flickering */
@media (max-width: 768px) {
    /* Disable intensive animations on mobile */
    .tutorial-spotlight {
        animation: none;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
        border: 2px solid rgba(34, 197, 94, 0.8);
    }

    .tutorial-pulse {
        animation: none;
    }

    .tutorial-progress-dot.current {
        animation: none;
        transform: scale(1.1);
    }

    .tutorial-tooltip::before {
        animation: none;
        display: none;
    }

    .tutorial-highlight::after {
        animation: none;
        border-color: rgba(34, 197, 94, 0.6);
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    }

    /* Reduce backdrop-filter intensity on mobile (GPU intensive) */
    .tutorial-tooltip,
    .tutorial-progress,
    .tutorial-reward-popup {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* Simplify transitions */
    .tutorial-tooltip,
    .tutorial-overlay,
    .tutorial-spotlight {
        transition-duration: 0.2s;
    }

    /* Use will-change sparingly on mobile */
    .tutorial-tooltip,
    .tutorial-spotlight {
        will-change: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tutorial-tooltip {
        border-width: 2px;
        border-color: #22c55e;
    }

    .tutorial-spotlight {
        border-width: 3px;
    }

    .tutorial-btn-next {
        border: 2px solid #ffffff;
    }

    .tutorial-progress-dot {
        border-width: 2px;
    }
}

/* ==========================================
   Bootstrap Modal Integration
   When tutorial highlights elements inside modals,
   raise the modal z-index above the tutorial overlay
   ========================================== */

/* When a modal contains a tutorial-highlighted element, raise its z-index */
.modal.show:has(.tutorial-highlight),
.modal-backdrop.show:has(~ .modal.show .tutorial-highlight) {
    z-index: 99993 !important;
}

.modal.show:has(.tutorial-highlight) .modal-dialog {
    z-index: 99994 !important;
}

/* Fallback for browsers that don't support :has() */
.tutorial-active-modal {
    z-index: 99993 !important;
}

.tutorial-active-modal .modal-dialog {
    z-index: 99994 !important;
}

.tutorial-active-modal-backdrop {
    z-index: 99992 !important;
}

/* When the modal itself is highlighted (target is the modal, not element inside it) */
.modal.tutorial-highlight {
    z-index: 99993 !important;
}

.modal.tutorial-highlight .modal-dialog {
    z-index: 99994 !important;
}

/* Also handle when modal has both classes */
.modal.show.tutorial-highlight,
.modal.show.tutorial-active-modal {
    z-index: 99993 !important;
}

/* When showing tooltip alongside a modal - position closer to modal */
.tutorial-tooltip-modal-mode {
    position: fixed !important;
    top: 50% !important;
    bottom: auto !important;
    left: calc(50% + 420px) !important; /* Position just right of centered modal */
    right: auto !important;
    transform: translateY(-50%) !important;
    max-width: 320px;
    z-index: 2147483647 !important; /* Maximum z-index value */
    opacity: 1 !important;
}

.tutorial-tooltip-modal-mode.active {
    transform: translateY(-50%) !important;
    opacity: 1 !important;
}

/* Override centered positioning when in modal mode */
.tutorial-tooltip-centered.tutorial-tooltip-modal-mode {
    top: 50% !important;
    left: calc(50% + 420px) !important;
    right: auto !important;
    transform: translateY(-50%) !important;
}

/* On smaller screens where there's no room on the right, position below */
@media (max-width: 1400px) {
    .tutorial-tooltip-modal-mode,
    .tutorial-tooltip-centered.tutorial-tooltip-modal-mode {
        top: auto !important;
        bottom: 100px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .tutorial-tooltip-modal-mode.active {
        transform: translateX(-50%) !important;
    }
}

/* Progress indicator should also be above modal */
.tutorial-progress {
    z-index: 999998 !important;
}
