/**
 * Soundcheck Coach Marks Styles
 * First-time user onboarding overlay with spotlight effects
 */

/* Overlay container - covers entire screen */
.coach-marks-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.coach-marks-overlay.visible {
    display: block;
    opacity: 1;
}

/* Dark backdrop - now just a fallback, main darkening comes from spotlight shadow */
.coach-marks-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: auto;
}

/* Spotlight - uses massive box-shadow to darken everything except the spotlight area */
.coach-marks-spotlight {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    box-shadow:
        /* Massive shadow covers entire screen - 40px blur for soft edge */
        0 0 40px 9999px rgba(0, 0, 0, 0.8),
        /* Purple accent glow */
        0 0 0 4px rgba(139, 92, 246, 0.2),
        0 0 25px rgba(139, 92, 246, 0.15);
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.coach-marks-spotlight.visible {
    opacity: 1;
}

/* Subtle pulse animation for spotlight */
@keyframes spotlight-pulse {
    0%, 100% {
        box-shadow:
            0 0 40px 9999px rgba(0, 0, 0, 0.8),
            0 0 0 4px rgba(139, 92, 246, 0.2),
            0 0 25px rgba(139, 92, 246, 0.15);
    }
    50% {
        box-shadow:
            0 0 40px 9999px rgba(0, 0, 0, 0.8),
            0 0 0 6px rgba(139, 92, 246, 0.15),
            0 0 35px rgba(139, 92, 246, 0.2);
    }
}

.coach-marks-spotlight.visible {
    animation: spotlight-pulse 2.5s ease-in-out infinite;
}

/* Tooltip/card container */
.coach-marks-tooltip {
    position: absolute;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: calc(100vw - 48px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 1px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Tooltip arrow */
.coach-marks-tooltip::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

/* Arrow positions */
.coach-marks-tooltip.arrow-top::before {
    top: -7px;
    left: 50%;
    margin-left: -6px;
    transform: rotate(45deg);
}

.coach-marks-tooltip.arrow-bottom::before {
    bottom: -7px;
    left: 50%;
    margin-left: -6px;
    transform: rotate(-135deg);
}

.coach-marks-tooltip.arrow-left::before {
    left: -7px;
    top: 50%;
    margin-top: -6px;
    transform: rotate(-45deg);
}

.coach-marks-tooltip.arrow-right::before {
    right: -7px;
    top: 50%;
    margin-top: -6px;
    transform: rotate(135deg);
}

/* Arrow offset adjustments for specific positions */
.coach-marks-tooltip.arrow-top-left::before {
    top: -7px;
    left: 24px;
}

.coach-marks-tooltip.arrow-bottom-left::before {
    bottom: -7px;
    left: 24px;
}

/* Tooltip content */
.coach-marks-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.3;
}

.coach-marks-content {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.coach-marks-content p {
    margin: 0 0 8px;
}

.coach-marks-content p:last-child {
    margin-bottom: 0;
}

/* Icon row for rating explanation */
.coach-marks-icons {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.coach-marks-icon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.coach-marks-icon-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.coach-marks-icon-item.positive {
    color: rgba(74, 222, 128, 0.9);
}

.coach-marks-icon-item.negative {
    color: rgba(239, 68, 68, 0.9);
}

/* Footer with button and progress */
.coach-marks-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Progress dots */
.coach-marks-progress {
    display: flex;
    gap: 6px;
}

.coach-marks-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.coach-marks-dot.active {
    background: rgba(139, 92, 246, 0.8);
    width: 18px;
    border-radius: 3px;
}

.coach-marks-dot.completed {
    background: rgba(139, 92, 246, 0.5);
}

/* Next/Done button */
.coach-marks-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coach-marks-btn:hover {
    background: rgba(139, 92, 246, 1);
    transform: translateY(-1px);
}

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

.coach-marks-btn svg {
    width: 16px;
    height: 16px;
}

/* Skip link */
.coach-marks-skip {
    position: absolute;
    top: 16px;
    right: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.coach-marks-skip:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .coach-marks-tooltip {
        padding: 20px;
        max-width: calc(100vw - 32px);
    }

    .coach-marks-title {
        font-size: 17px;
    }

    .coach-marks-content {
        font-size: 14px;
    }

    .coach-marks-icons {
        flex-direction: column;
        gap: 8px;
    }

    .coach-marks-footer {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .coach-marks-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
    }

    .coach-marks-progress {
        justify-content: center;
    }
}

/* Ensure close button is clickable during tour (for exit step) */
.coach-marks-overlay.visible ~ #soundcheck-app .btn-close {
    z-index: 20001;
}
