/**
 * Enhanced Processing Monitor UI
 * User-friendly graphics and improved visual feedback
 */

/* Monitor Container - Better sizing and positioning */
.matrix-monitor {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    border: 2px solid rgba(0, 255, 150, 0.4);
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(0, 255, 150, 0.3),
        inset 0 0 60px rgba(0, 200, 255, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.matrix-monitor:hover {
    border-color: rgba(0, 255, 150, 0.6);
    box-shadow: 
        0 0 40px rgba(0, 255, 150, 0.5),
        inset 0 0 80px rgba(0, 200, 255, 0.15),
        0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Monitor Header - Enhanced styling */
.matrix-monitor-header {
    background: linear-gradient(180deg, rgba(0, 255, 150, 0.15) 0%, rgba(0, 200, 255, 0.1) 100%);
    border-bottom: 2px solid rgba(0, 255, 150, 0.3);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.matrix-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00ff96;
    text-shadow: 
        0 0 10px rgba(0, 255, 150, 0.8),
        0 0 20px rgba(0, 200, 255, 0.4);
    letter-spacing: 1px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { 
        text-shadow: 
            0 0 10px rgba(0, 255, 150, 0.8),
            0 0 20px rgba(0, 200, 255, 0.4);
    }
    100% { 
        text-shadow: 
            0 0 15px rgba(0, 255, 150, 1),
            0 0 30px rgba(0, 200, 255, 0.6),
            0 0 40px rgba(0, 255, 200, 0.3);
    }
}

/* Status Indicator - Animated and clear */
.matrix-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.matrix-blink {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #00ff96;
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(0, 255, 150, 0.8),
        0 0 20px rgba(0, 255, 150, 0.4);
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 
            0 0 10px rgba(0, 255, 150, 0.8),
            0 0 20px rgba(0, 255, 150, 0.4);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.2);
        box-shadow: 
            0 0 15px rgba(0, 255, 150, 1),
            0 0 30px rgba(0, 255, 150, 0.6);
    }
}

/* Monitor Container - Better scroll and content display */
.matrix-monitor-container {
    padding: 16px;
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(0, 0, 0, 0.3);
}

/* Custom scrollbar */
.matrix-monitor-container::-webkit-scrollbar {
    width: 8px;
}

.matrix-monitor-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.matrix-monitor-container::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 150, 0.4);
    border-radius: 4px;
    transition: background 0.3s;
}

.matrix-monitor-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 150, 0.6);
}

/* Monitor Text - Better readability */
.monitor-text {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #00ff96;
    text-shadow: 0 0 5px rgba(0, 255, 150, 0.5);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Progress Indicators - Visual progress bars */
.monitor-progress-container {
    margin: 12px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 150, 0.2);
}

.monitor-progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 255, 150, 0.3);
    margin-top: 8px;
}

.monitor-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 255, 150, 0.8) 0%,
        rgba(0, 200, 255, 0.8) 50%,
        rgba(0, 255, 150, 0.8) 100%);
    background-size: 200% 100%;
    animation: progressFlow 2s linear infinite;
    transition: width 0.3s ease;
    box-shadow: 
        0 0 10px rgba(0, 255, 150, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes progressFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.monitor-progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    z-index: 1;
}

/* Phase Indicators - Clear phase display */
.monitor-phase-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 255, 150, 0.15);
    border: 1px solid rgba(0, 255, 150, 0.4);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #00ff96;
    margin: 4px;
}

.monitor-phase-indicator.active {
    background: rgba(0, 255, 150, 0.3);
    border-color: rgba(0, 255, 150, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 150, 0.4);
}

/* Stats Display - Better organized */
.monitor-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.monitor-stat-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 150, 0.2);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.monitor-stat-card:hover {
    background: rgba(0, 255, 150, 0.1);
    border-color: rgba(0, 255, 150, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 150, 0.2);
}

.monitor-stat-label {
    font-size: 0.75rem;
    color: rgba(0, 255, 150, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.monitor-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00ff96;
    text-shadow: 0 0 8px rgba(0, 255, 150, 0.6);
}

/* Process Caption - Enhanced styling */
.monitor-process-caption {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 20, 40, 0.8) 100%);
    border: 2px solid rgba(0, 255, 150, 0.4);
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 255, 150, 0.2),
        inset 0 0 30px rgba(0, 200, 255, 0.1);
}

.caption-title {
    font-size: 1rem;
    font-weight: 700;
    color: #00c8ff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
}

.caption-phase {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(0, 255, 150, 0.15);
    border: 1px solid rgba(0, 255, 150, 0.4);
    border-radius: 6px;
    margin: 4px;
    font-size: 0.85rem;
    color: #00ff96;
    transition: all 0.3s ease;
}

.caption-phase.active {
    background: rgba(0, 255, 150, 0.3);
    border-color: rgba(0, 255, 150, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 150, 0.4);
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .matrix-monitor {
        max-width: 95%;
        margin: 0 auto;
    }
    
    .monitor-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .matrix-monitor-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Loading Animation */
.monitor-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 255, 150, 0.3);
    border-top-color: #00ff96;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success/Error States */
.monitor-status.success .matrix-blink {
    background: #00ff96;
    box-shadow: 
        0 0 15px rgba(0, 255, 150, 1),
        0 0 30px rgba(0, 255, 150, 0.6);
}

.monitor-status.error .matrix-blink {
    background: #ff4444;
    box-shadow: 
        0 0 15px rgba(255, 68, 68, 1),
        0 0 30px rgba(255, 68, 68, 0.6);
}

.monitor-status.warning .matrix-blink {
    background: #ffaa00;
    box-shadow: 
        0 0 15px rgba(255, 170, 0, 1),
        0 0 30px rgba(255, 170, 0, 0.6);
}

