/* loading-animation.css - "Guitar Hero" style loading animation styles */

/* Container - overlays the image display area */
.loading-animation-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

.loading-overlay.active .loading-animation-wrapper,
.loading-overlay.fade-out .loading-animation-wrapper {
    opacity: 1;
}

.loading-overlay:not(.active) .loading-animation-wrapper {
    opacity: 0;
    pointer-events: none;
}

.loading-overlay.fade-out .loading-animation-wrapper {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ===== Timeline Container ===== */
.timeline-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    height: 80px;
}

/* Timeline Lines */
.timeline-line {
    flex: 1;
    height: 4px;
    position: relative;
}

.timeline-line.past {
    background: linear-gradient(90deg,
            transparent 0%,
            #6b7280 20%,
            #9ca3af 100%);
}

.timeline-line.future {
    background: transparent;
    border-bottom: 3px dashed rgba(156, 163, 175, 0.5);
    height: 0;
    margin-bottom: 2px;
}

/* Now Indicator */
.now-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    z-index: 10;
}

.now-line {
    width: 4px;
    height: 60px;
    background: linear-gradient(180deg,
            transparent 0%,
            var(--accent-primary, #8b5cf6) 20%,
            var(--accent-primary, #8b5cf6) 80%,
            transparent 100%);
    border-radius: 2px;
    box-shadow: 0 0 15px var(--accent-glow, rgba(139, 92, 246, 0.5));
    animation: nowPulse 2s ease-in-out infinite;
}

@keyframes nowPulse {

    0%,
    100% {
        box-shadow: 0 0 10px var(--accent-glow, rgba(139, 92, 246, 0.5));
    }

    50% {
        box-shadow: 0 0 25px var(--accent-glow, rgba(139, 92, 246, 0.8));
    }
}

.now-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary, #8b5cf6);
    opacity: 0.8;
}

/* ===== Dots Container ===== */
.dots-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Individual Poll Dots */
.poll-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6b7280;
    /* Grey default */
    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.15s ease;
    will-change: left, transform;
}

/* Status Colors with 0.3s lerp (transition above) */
.poll-dot.status-pending {
    background: #6b7280;
    /* Grey */
}

.poll-dot.status-waiting {
    background: #f59e0b;
    /* Yellow/Amber - waiting/generating */
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.poll-dot.status-error {
    background: #ef4444;
    /* Red */
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.poll-dot.status-success {
    background: #22c55e;
    /* Green */
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Glow effect when crossing NOW (same as workflow blocks) */
.poll-dot.glowing {
    animation: dotGlow 2s ease-in-out infinite;
}

@keyframes dotGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.4),
            0 0 10px rgba(245, 158, 11, 0.2);
        transform: translateY(-50%) scale(1);
    }

    50% {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.8),
            0 0 30px rgba(245, 158, 11, 0.4);
        transform: translateY(-50%) scale(1.15);
    }
}

/* Override glow when status is finalized */
.poll-dot.status-success.glowing {
    animation: dotGlowSuccess 2s ease-in-out infinite;
}

@keyframes dotGlowSuccess {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.4),
            0 0 10px rgba(34, 197, 94, 0.2);
        transform: translateY(-50%) scale(1);
    }

    50% {
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.8),
            0 0 30px rgba(34, 197, 94, 0.4);
        transform: translateY(-50%) scale(1.15);
    }
}

.poll-dot.status-error.glowing {
    animation: dotGlowError 2s ease-in-out infinite;
}

@keyframes dotGlowError {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.4),
            0 0 10px rgba(239, 68, 68, 0.2);
        transform: translateY(-50%) scale(1);
    }

    50% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.8),
            0 0 30px rgba(239, 68, 68, 0.4);
        transform: translateY(-50%) scale(1.15);
    }
}

/* ===== Timer Display ===== */
.timer-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* ===== Log Container ===== */
.log-container {
    width: 100%;
    max-width: 400px;
    max-height: 120px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.log-content {
    padding: 0.75rem;
    max-height: 120px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.7rem;
    line-height: 1.5;
}

.log-entry {
    padding: 0.2rem 0;
    opacity: 0;
    animation: logSlideIn 0.3s ease forwards;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-time {
    color: var(--text-tertiary, #9ca3af);
    margin-right: 0.5rem;
}

.log-msg {
    color: var(--text-secondary, #d1d5db);
}

.log-entry.log-error .log-msg {
    color: #f87171;
}

.log-entry.log-success .log-msg {
    color: #4ade80;
}

.log-entry.log-warning .log-msg {
    color: #fbbf24;
}

/* Scrollbar styling for log */
.log-content::-webkit-scrollbar {
    width: 6px;
}

.log-content::-webkit-scrollbar-track {
    background: transparent;
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}