/**
 * popup-queue.css - Popup Queue overlay, navigation header, and transitions
 */

/* Shared overlay */
.popup-queue-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: popupQueueFadeIn 0.3s ease-out;
}

.popup-queue-overlay.popup-queue-closing {
    animation: popupQueueFadeOut 0.25s ease-out forwards;
}

/* Centered wrapper — holds header + content as a visual unit */
.popup-queue-wrapper {
    max-width: 720px;
    width: 90%;
}

/* Navigation header — visible when 2+ popups queued */
.popup-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid #eee;
}

/* Dot indicators */
.popup-queue-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.popup-queue-dot {
    cursor: pointer;
    font-size: 12px;
    color: #ccc;
    transition: color 0.2s ease;
    padding: 4px;
    user-select: none;
    line-height: 1;
}

.popup-queue-dot:hover {
    color: var(--primary-purple, #8B7EC8);
}

.popup-queue-dot.active {
    color: var(--primary-purple, #8B7EC8);
}

/* Right-side actions */
.popup-queue-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.popup-queue-dismiss-all {
    background: none;
    border: none;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.popup-queue-dismiss-all:hover {
    color: var(--primary-purple, #8B7EC8);
}

.popup-queue-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.popup-queue-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Content container */
.popup-queue-content {
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
    transition: opacity 0.2s ease-out;
}

/* Single item — no header, full border-radius on content */
.popup-queue-single .popup-queue-header {
    display: none !important;
}

.popup-queue-single .popup-queue-content {
    border-radius: 20px;
}

/* Fade transitions */
.popup-queue-content.popup-queue-fade-out {
    opacity: 0;
}

.popup-queue-content.popup-queue-fade-in {
    animation: popupQueueContentFadeIn 0.2s ease-out forwards;
}

/* Override child popup styles when rendered inside the queue */
.popup-queue-content .welcome-modal {
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    width: 100%;
    animation: none;
}

.popup-queue-content .profile-complete-celebration {
    position: static;
    transform: none;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    width: 100%;
    animation: none;
}

/* When single item, let child popups inherit the container's radius */
.popup-queue-single .popup-queue-content .welcome-modal {
    border-radius: 20px;
}

.popup-queue-single .popup-queue-content .profile-complete-celebration {
    border-radius: 20px;
}

/* Keyframes */
@keyframes popupQueueFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupQueueFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes popupQueueContentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
    .popup-queue-wrapper {
        width: 95%;
    }

    .popup-queue-header {
        padding: 8px 16px;
    }

    .popup-queue-dismiss-all {
        font-size: 0.8rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .popup-queue-overlay,
    .popup-queue-overlay.popup-queue-closing,
    .popup-queue-content,
    .popup-queue-content.popup-queue-fade-in {
        animation: none;
        transition: none;
    }
}
