/* Performance Status Bar Styles */
.performance-status-bar {
    background: linear-gradient(135deg, #2b5797, #5074b8);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #4dabf7;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.status-normal { background: #28a745; }
.status-warning { background: #ffc107; }
.status-critical { background: #fd7e14; }
.status-emergency { background: #dc3545; animation: pulse 1s infinite; }

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

.metrics-display {
    display: flex;
    gap: 20px;
    align-items: center;
}

.metric {
    font-size: 0.9em;
    opacity: 0.9;
}

.metric span {
    font-weight: 700;
    color: #4dabf7;
}

.emergency-controls {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Category Section Styles */
.category-section {
    margin-bottom: 40px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.category-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.toggle-category {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toggle-category:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.toggle-category .icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.toggle-category[aria-expanded="true"] .icon {
    transform: rotate(90deg);
}

.animation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

.animation-grid.expanded {
    max-height: 2000px;
    opacity: 1;
}

.animation-grid.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(77, 171, 247, 0.3), transparent);
    animation: shimmer 2s infinite;
}

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

.loading-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
}

.skeleton-shimmer {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #e9ecef, #f8f9fa, #e9ecef);
    border-radius: 2px;
    animation: shimmer 1.5s infinite;
    margin-bottom: 10px;
}

.skeleton-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Emergency UI Styles */
.emergency-banner {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107;
    color: #212529;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 600px;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.banner-icon {
    font-size: 1.5rem;
}

.banner-text {
    flex: 1;
}

.banner-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.banner-close:hover {
    opacity: 1;
}

.emergency-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.emergency-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.emergency-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.emergency-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.emergency-metrics .metric {
    text-align: center;
}

.emergency-metrics .label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.emergency-metrics span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .performance-status-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .metrics-display {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .category-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .animation-grid {
        grid-template-columns: 1fr;
    }
    
    .emergency-banner {
        top: 120px;
        left: 20px;
        right: 20px;
        transform: none;
        max-width: none;
    }
    
    .overlay-content {
        margin: 20px;
        padding: 30px;
    }
    
    .emergency-actions {
        flex-direction: column;
    }
    
    .emergency-metrics {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Disabled State */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

/* Emergency Active State */
.emergency-active {
    overflow: hidden;
}

.emergency-active .performance-status-bar {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.emergency-active .status-dot {
    animation: pulse 0.5s infinite;
}