/**
 * Dashboard Tutorial Styles
 * Spotlight overlay, tooltips, sample selector, and progress animations
 */

/* ============== Spotlight Overlay ============== */
.dt-spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1998;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.dt-spotlight-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.dt-spotlight-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.dt-spotlight-cutout {
    position: absolute;
    border-radius: var(--radius-md);
    box-shadow:
        0 0 0 4px var(--primary),
        0 0 0 9999px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.dt-spotlight-cutout.clickable {
    pointer-events: none; /* Let clicks pass through to target */
}

.dt-spotlight-cutout.pulse {
    /* Pulse animation disabled - was distracting */
    animation: none;
}

@keyframes spotlight-pulse {
    /* Disabled - pulse effect removed */
    0%, 100% {
        box-shadow:
            0 0 0 4px var(--primary),
            0 0 0 9999px rgba(0, 0, 0, 0.3);
    }
}

/* ============== Tutorial Tooltip ============== */
.dt-tooltip {
    position: fixed;
    z-index: 2000;
    max-width: 380px;
    min-width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: all;
}

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

/* Tooltip Arrow */
.dt-tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.dt-tooltip-arrow.top {
    top: -7px;
    border-bottom: none;
    border-right: none;
}

.dt-tooltip-arrow.bottom {
    bottom: -7px;
    border-top: none;
    border-left: none;
}

.dt-tooltip-arrow.left {
    left: -7px;
    border-top: none;
    border-right: none;
}

.dt-tooltip-arrow.right {
    right: -7px;
    border-bottom: none;
    border-left: none;
}

/* Tooltip Content */
.dt-tooltip-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.dt-tooltip-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.dt-tooltip-content p {
    margin: 0 0 12px 0;
}

.dt-tooltip-content p:last-child {
    margin-bottom: 0;
}

.dt-tooltip-content strong {
    color: var(--emphasis);
    font-weight: 600;
}

.dt-tooltip-content em {
    color: var(--text-secondary);
    font-style: italic;
}

.dt-tooltip-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.dt-tooltip-content li {
    margin-bottom: 4px;
}

/* Tooltip Actions */
.dt-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.dt-tooltip-skip {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.dt-tooltip-skip:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.dt-tooltip-next {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.dt-tooltip-next:hover {
    background: var(--primary-dark, color-mix(in srgb, var(--primary) 85%, black));
    transform: translateY(-1px);
}

/* ============== Sample Selector ============== */
.sample-selector {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    opacity: 0.7;
    transition: all 0.2s;
}

.sample-selector:hover,
.sample-selector.tutorial-highlight {
    opacity: 1;
    border-color: var(--primary);
    border-style: solid;
}

.sample-selector.hidden {
    display: none;
}

.sample-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sample-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.sample-btn:active {
    transform: scale(1.05);
}

/* ============== Annotation Progress Animation ============== */
.dt-annotation-progress {
    text-align: center;
    padding: 20px 0;
}

.dt-annotation-progress h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.dt-annotation-progress p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.dt-progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dt-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.dt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 3px;
    animation: progress-fill 3s ease-out forwards;
}

@keyframes progress-fill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ============== Disclaimer Badge ============== */
.dt-disclaimer {
    display: inline-block;
    padding: 4px 10px;
    background: var(--warning);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ============== Completion Message ============== */
.dt-completion-message {
    text-align: center;
    padding: 20px 0;
}

.dt-completion-message h2 {
    color: var(--success);
    margin: 0 0 16px 0;
    font-size: 24px;
}

.dt-completion-message p {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.dt-completion-message ul {
    text-align: left;
    padding-left: 24px;
    margin: 16px auto;
    max-width: 280px;
}

.dt-completion-message li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ============== Tutorial Highlight State ============== */
.tutorial-highlight {
    position: relative;
}

.tutorial-highlight::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--primary);
    border-radius: inherit;
    animation: highlight-pulse 0.4s ease-out forwards;
    pointer-events: none;
}

@keyframes highlight-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* ============== Mobile Adjustments ============== */
@media (max-width: 768px) {
    .dt-tooltip {
        max-width: calc(100vw - 32px);
        min-width: auto;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }

    .dt-tooltip-arrow {
        display: none;
    }

    .sample-selector {
        bottom: auto;
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
    }

    .dt-tooltip-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .dt-tooltip-next {
        width: 100%;
    }

    .dt-tooltip-skip {
        width: 100%;
        text-align: center;
    }
}

/* ============== Dark Mode Adjustments ============== */
[data-theme="dark"] .dt-spotlight-cutout {
    box-shadow:
        0 0 0 4px var(--primary),
        0 0 0 9999px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .dt-spotlight-cutout.pulse {
    /* Pulse animation disabled - was distracting */
    animation: none;
}

@keyframes spotlight-pulse-dark {
    /* Disabled - pulse effect removed */
    0%, 100% {
        box-shadow:
            0 0 0 4px var(--primary),
            0 0 0 9999px rgba(0, 0, 0, 0.4);
    }
}

[data-theme="dark"] .dt-tooltip {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dt-tooltip-arrow {
    background: var(--bg-secondary);
}

[data-theme="dark"] .sample-selector {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .dt-disclaimer {
    background: var(--warning);
    color: #000;
}
