/**
 * TradeComply Demo UI Styles
 */

/* Fade-in animation */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

/* ===== Pipeline Mode - Parallel Phase Animations ===== */

/* Pipeline badge styling */
.pipeline-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(245, 158, 11, 0.5); }
}

/* Phase indicator base */
.phase-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.phase-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid;
    transition: all 0.3s ease;
}

/* Pending state */
.phase-pending .phase-circle {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
}

/* Active state with pulse animation */
.phase-active .phase-circle {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1d4ed8;
    animation: phase-pulse 1.5s ease-in-out infinite;
}

@keyframes phase-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

/* Parallel active state (both classification and extraction running) */
.phase-parallel .phase-circle {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #b45309;
    animation: parallel-pulse 1.2s ease-in-out infinite;
}

@keyframes parallel-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
}

/* Completed state */
.phase-complete .phase-circle {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    color: #047857;
}

/* Phase label */
.phase-label {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    text-align: center;
    max-width: 70px;
    line-height: 1.2;
}

.phase-pending .phase-label { color: #6b7280; }
.phase-active .phase-label { color: #1d4ed8; font-weight: 600; }
.phase-parallel .phase-label { color: #b45309; font-weight: 600; }
.phase-complete .phase-label { color: #047857; }

/* Connector line between phases */
.phase-connector {
    width: 20px;
    height: 2px;
    background: #d1d5db;
    margin-top: -16px;
    transition: background 0.3s ease;
}

.phase-connector.active {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    animation: connector-flow 1s linear infinite;
}

.phase-connector.parallel {
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    background-size: 200% 100%;
    animation: connector-parallel-flow 1s linear infinite;
}

.phase-connector.complete {
    background: #10b981;
}

@keyframes connector-flow {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes connector-parallel-flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Pipeline mode indicator */
.pipeline-mode-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 6px;
    margin-bottom: 8px;
}

.pipeline-icon {
    font-size: 16px;
    animation: rotate-icon 3s linear infinite;
}

@keyframes rotate-icon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pipeline-text {
    font-size: 12px;
    font-weight: 500;
    color: #92400e;
}

/* Loading dots for active phases */
.loading-dots {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: dot-bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Custom scrollbar for webhook events */
#webhookEvents::-webkit-scrollbar {
    width: 8px;
}

#webhookEvents::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#webhookEvents::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#webhookEvents::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Comment Section Styles ===== */

/* Textarea focus animation */
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Comment card hover effect */
[data-comment-id]:hover {
    background-color: #f9fafb;
}

/* Character counter warning */
.char-limit-warning {
    color: #dc2626;
    font-weight: 500;
}