/* AI Agent page specific styles */

/* Page layout fix - solve fixed navbar overlay issue */
.ai-agent-page .main-content {
    padding-top: 120px; /* Reserve more space for fixed navbar to avoid title overlay */
}

/* Anomaly detection styles */
.anomaly-indicator {
    text-align: center;
    margin-bottom: 15px;
}

.anomaly-level {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 10px;
}

.anomaly-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.anomaly-unit {
    font-size: 1.2rem;
    color: #64ffda;
    margin-left: 5px;
}

.anomaly-status .status-badge {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

.anomaly-details {
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.detail-row .label {
    color: #64ffda;
    font-weight: 500;
}

.detail-row .value {
    color: #ffffff;
    font-weight: bold;
}

/* Confidence level meter styles */
.confidence-meter {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.confidence-circle {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #64ffda 0deg, #64ffda 320deg, #1a1a2e 320deg, #1a1a2e 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
}

.confidence-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #0f0f23;
    z-index: 1;
}

.confidence-text {
    position: relative;
    z-index: 2;
    text-align: center;
}

.confidence-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #64ffda;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

.confidence-percent {
    font-size: 0.9rem;
    color: #64ffda;
}

/* Confidence level breakdown styles */
.confidence-breakdown {
    text-align: left;
    margin-top: 10px;
}

.breakdown-item {
    margin-bottom: 15px;
    position: relative;
}

.breakdown-label {
    display: block;
    color: #64ffda;
    font-size: 0.8rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.breakdown-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.breakdown-fill {
    height: 100%;
    background: linear-gradient(90deg, #64ffda, #4fc3f7);
    border-radius: 3px;
    transition: width 0.8s ease;
    box-shadow: 0 0 8px rgba(100, 255, 218, 0.3);
}

.breakdown-value {
    position: absolute;
    right: 0;
    top: -2px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Chart content common styles */
.chart-content {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 280px;
}

/* Analysis item styles optimization */
.analysis-item {
    height: 100%;
}

.analysis-item .analysis-chart {
    height: 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 107, 107, 0.6);
    }
}

/* Basic styles */
.text-gradient {
    background: linear-gradient(45deg, #00d4ff, #0099cc, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(30deg); }
}

/* AI status card */
.ai-status-card {
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ai-status-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.ai-status-card .card-header {
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding: 1rem;
    color: #00d4ff;
    font-weight: 600;
}

.ai-status-card .card-body {
    padding: 1.5rem;
}

/* Status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.active .status-dot {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse 2s infinite;
}

.status-indicator.active .status-text {
    color: #00ff88;
}

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

/* Progress bar */
.progress-bar-container {
    margin-bottom: 1rem;
}

.progress-bar-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

/* Telescope grid */
.telescope-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.telescope-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.telescope-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

.telescope-name {
    color: #ffffff;
    font-weight: 500;
}

.telescope-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
}

.telescope-status.active {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.telescope-status.scanning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
    animation: blink 1.5s infinite;
}

.telescope-status.analyzing {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid #00d4ff;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Web crawling statistics */
.crawling-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data stream panel */
.data-stream-panel {
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    overflow: hidden;
}

.panel-header {
    background: rgba(0, 212, 255, 0.1);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h4 {
    margin: 0;
    color: #00d4ff;
    font-weight: 600;
}

.panel-body {
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Data stream */
.data-stream {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.stream-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.stream-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.stream-timestamp {
    color: #888;
    margin-right: 0.5rem;
}

.stream-source {
    color: #00d4ff;
    font-weight: 600;
    margin-right: 0.5rem;
}

.stream-action {
    color: #ffffff;
    margin-right: 0.5rem;
}

.stream-status {
    color: #00ff88;
    font-weight: 600;
}

/* Analysis panel */
.analysis-panel {
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    height: 100%;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 300px;
}

.analysis-item {
    text-align: center;
}

.analysis-item h6 {
    color: #00d4ff;
    margin-top: 1rem;
    font-weight: 600;
}

.analysis-chart {
    height: 200px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Animated chart */
.animated-chart {
    display: flex;
    align-items: end;
    gap: 4px;
    height: 100%;
    width: 100%;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #00d4ff, #00ff88);
    border-radius: 2px;
    animation: chartGrow 1s ease-out forwards;
    transform: scaleY(0);
    transform-origin: bottom;
}

@keyframes chartGrow {
    to { transform: scaleY(1); }
}

/* Threat assessment panel */
.threat-assessment-panel {
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    height: 100%;
}

.threat-level {
    text-align: center;
    padding: 2rem 0;
}

.threat-indicator {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.threat-indicator.low {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 2px solid #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.threat-indicator.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 2px solid #ffc107;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
    animation: mediumThreatPulse 2s infinite;
}

.threat-indicator.high {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 2px solid #dc3545;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
    animation: highThreatPulse 1s infinite;
}

@keyframes mediumThreatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes highThreatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.threat-details {
    padding: 0 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.detail-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.detail-value {
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Discovery panel */
.discoveries-panel {
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
}

.discoveries-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Particles background */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #00d4ff;
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
    opacity: 0.6;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        height: auto;
    }
    
    .analysis-chart {
        height: 150px;
    }
    
    .threat-indicator {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .panel-header {
        padding: 0.75rem 1rem;
    }
    
    .panel-body {
        padding: 1rem;
    }
}

/* Scrollbar styles */
.panel-body::-webkit-scrollbar,
.discoveries-list::-webkit-scrollbar {
    width: 6px;
}

.panel-body::-webkit-scrollbar-track,
.discoveries-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb,
.discoveries-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb:hover,
.discoveries-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}

/* Button styles */
.btn-outline-primary {
    border-color: #00d4ff;
    color: #00d4ff;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #00d4ff;
    border-color: #00d4ff;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00d4ff;
    animation: spin 1s ease-in-out infinite;
}

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