/* AI Animation Styles - Comprehensive Fix */

/* Base paragraph styles */
.essay-content .paragraph {
    position: relative;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 8px;
    transition: all 0.5s ease;
    border: 2px solid transparent;
}

/* Scanning state */
.essay-content .paragraph.scanning {
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.05) 0%,
        rgba(99, 102, 241, 0.15) 50%,
        rgba(99, 102, 241, 0.05) 100%
    );
    border-color: rgba(99, 102, 241, 0.3);
    animation: scanPulse 1s ease infinite;
    transform: translateX(2px);
}

@keyframes scanPulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 20px 5px rgba(99, 102, 241, 0.1);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2);
    }
}

/* Highlighted state after scanning */
.essay-content .paragraph.highlighted {
    animation: highlightIn 0.5s ease forwards;
}

@keyframes highlightIn {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Different highlights for different content types */
.essay-content .paragraph.original.highlighted {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.essay-content .paragraph.ai-generated.highlighted {
    border-left: 4px solid #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.essay-content .paragraph.plagiarized.highlighted {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.essay-content .paragraph.mixed.highlighted {
    border-left: 4px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

/* Indicators animation */
.ai-indicator,
.source-indicator,
.mixed-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.paragraph.highlighted .ai-indicator {
    background: rgba(99, 102, 241, 0.2);
    color: #4f46e5;
    animation: indicatorBounce 0.5s ease;
}

.paragraph.highlighted .source-indicator {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
    animation: indicatorBounce 0.5s ease;
}

.paragraph.highlighted .mixed-indicator {
    background: rgba(139, 92, 246, 0.2);
    color: #7c3aed;
    animation: indicatorBounce 0.5s ease;
}

@keyframes indicatorBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Status dot animation */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    margin-right: 8px;
    animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Score circle styles */
.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-progress {
    stroke: #6366f1;
    stroke-width: 8;
    fill: none;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.5s ease;
}

.score-bg {
    stroke: #f3f4f6;
    stroke-width: 8;
    fill: none;
}

/* Detection bars animation */
.detection-bar {
    position: relative;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.detection-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.detection-bar .bar-fill.ai {
    background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%);
}

.detection-bar .bar-fill.plagiarized {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.detection-bar .bar-fill.mixed {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Refresh button */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #f9fafb;
    border-color: #6366f1;
}

.refresh-btn:hover .refresh-icon {
    animation: spin 0.5s ease;
}

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

/* Ensure visibility */
.essay-content {
    position: relative;
    z-index: 1;
}

.analysis-panel {
    position: relative;
    z-index: 1;
}