/* Memory Monitor Panel Styles */
.memory-monitor-panel {
    background: var(--panel-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.memory-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.memory-monitor-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.memory-monitor-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.memory-toggle-btn, .memory-report-btn, .memory-clear-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.memory-toggle-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.memory-toggle-btn.active {
    background: linear-gradient(135deg, #28a745, #20a332);
    animation: pulse 2s infinite;
}

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

.memory-report-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.memory-clear-btn {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.memory-toggle-btn:hover, .memory-report-btn:hover, .memory-clear-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.memory-section {
    margin-bottom: 15px;
}

.memory-section:last-child {
    margin-bottom: 0;
}

.memory-section h4 {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.memory-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 11px;
}

.memory-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.memory-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-numbers);
}

.memory-unit {
    color: var(--text-tertiary);
    font-size: 10px;
    margin-left: 2px;
}

.growth-rate {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px !important;
    font-weight: 600 !important;
}

.growth-rate.positive {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.growth-rate.negative {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.growth-rate.neutral {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.memory-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 6px 0;
    overflow: hidden;
}

.memory-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997, #ffc107, #fd7e14, #dc3545);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.memory-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
}

.status-indicator {
    font-size: 8px;
    animation: blink 1.5s infinite;
}

.status-indicator.monitoring {
    color: #28a745;
}

.status-indicator.stopped {
    color: #dc3545;
    animation: none;
}

.status-indicator.warning {
    color: #ffc107;
    animation: blink 0.8s infinite;
}

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

.memory-last-update {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* Resource value color coding */
.memory-value.high {
    color: #dc3545;
}

.memory-value.medium {
    color: #ffc107;
}

.memory-value.normal {
    color: #28a745;
}

/* Dark theme compatibility */
[data-theme="dark"] .memory-monitor-panel {
    --panel-background: #1a1a1a;
    --border-color: #333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #888888;
}

/* Theme-specific adjustments */
[data-theme="cyberpunk"] .memory-monitor-panel {
    border: 1px solid #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

[data-theme="cyberpunk"] .memory-monitor-header h3 {
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

[data-theme="neon-dark"] .memory-monitor-panel {
    border: 1px solid #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.1);
}

[data-theme="ocean-waves"] .memory-progress-fill {
    background: linear-gradient(90deg, #0077be, #00a8cc, #00d4aa, #7fb069, #d4e09b);
}

[data-theme="midnight-glow"] .memory-toggle-btn.active {
    background: linear-gradient(135deg, #4a90e2, #7b68ee);
}

/* Compact mode for smaller screens */
@media (max-width: 1200px) {
    .memory-monitor-panel {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .memory-section h4 {
        font-size: 11px;
    }
    
    .memory-stat {
        font-size: 10px;
    }
    
    .memory-monitor-controls {
        gap: 4px;
    }
    
    .memory-toggle-btn, .memory-report-btn, .memory-clear-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .memory-monitor-panel {
        display: none; /* Hide on mobile to save space */
    }
}

/* Tooltip integration */
.memory-monitor-controls [data-tooltip] {
    position: relative;
}

/* Animation for value updates */
.memory-value.updated {
    animation: valueUpdate 0.3s ease;
}

@keyframes valueUpdate {
    0% { background: rgba(0, 123, 255, 0.3); }
    100% { background: transparent; }
}

/* Status text colors */
#memoryStatusText.monitoring {
    color: #28a745;
}

#memoryStatusText.stopped {
    color: #dc3545;
}

#memoryStatusText.initializing {
    color: #ffc107;
}

#memoryStatusText.error {
    color: #dc3545;
    font-weight: 600;
}
