/* Live Monitoring Dashboard Styles */

.live-monitor {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #1e1e1e;
    color: #d4d4d4;
}

/* Header */
.live-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #252526;
    border-bottom: 1px solid #3e3e42;
}

.live-monitor-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #dc3545;
    color: white;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

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

.student-count {
    color: #858585;
    font-size: 0.875rem;
}

/* Alert Panel */
.alert-panel {
    padding: 1rem 1.5rem;
    background-color: #252526;
    border-bottom: 1px solid #3e3e42;
    max-height: 150px;
    overflow-y: auto;
}

.alert-panel h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #fff;
}

.alert-item {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid;
    background-color: #2d2d30;
    font-size: 0.875rem;
}

.alert-item.severity-low {
    border-left-color: #4ec9b0;
    background-color: rgba(78, 201, 176, 0.1);
}

.alert-item.severity-medium {
    border-left-color: #ce9178;
    background-color: rgba(206, 145, 120, 0.1);
}

.alert-item.severity-high {
    border-left-color: #f48771;
    background-color: rgba(244, 135, 113, 0.1);
}

.alert-item.severity-critical {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Student Grid */
.student-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    align-content: start;
}

/* Student Cell */
.student-cell {
    background-color: #252526;
    border: 2px solid #3e3e42;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 280px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.student-cell:hover {
    border-color: #569cd6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.student-cell.alert-low {
    border-color: #4ec9b0;
    background-color: rgba(78, 201, 176, 0.05);
}

.student-cell.alert-medium {
    border-color: #ce9178;
    background-color: rgba(206, 145, 120, 0.05);
}

.student-cell.alert-high {
    border-color: #f48771;
    background-color: rgba(244, 135, 113, 0.05);
    animation: alertPulse 1.5s infinite;
}

.student-cell.alert-critical {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
    animation: alertPulse 1s infinite;
}

/* Status-based cell styling */
.student-cell.status-ended {
    border-color: #f94144;
    opacity: 0.7;
    background-color: rgba(244, 65, 68, 0.03);
}

.student-cell.status-ended .mini-editor {
    opacity: 0.5;
}

.student-cell.status-active {
    border-color: #4ec9b0;
}

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; }
    50% { box-shadow: 0 0 0 4px transparent; }
}

.student-cell.alert-pulse {
    animation: alertPulseBorder 0.5s 6;
}

@keyframes alertPulseBorder {
    0%, 100% {
        border-color: inherit;
        transform: scale(1);
    }
    50% {
        border-color: #dc3545;
        transform: scale(1.02);
    }
}

/* Student Header */
.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
}

.student-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-badge {
    font-size: 1.25rem;
    animation: bounce 1s infinite;
}

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

/* Mini Editor */
.mini-editor {
    flex: 1;
    min-height: 150px;
    height: 150px;
    background-color: #1e1e1e;
    overflow: hidden;
}

/* Current line highlight */
.current-line-highlight {
    background-color: rgba(86, 156, 214, 0.15);
}

.current-line-glyph {
    background-color: #569cd6;
    width: 3px !important;
    margin-left: 3px;
}

/* Student Stats */
.student-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #2d2d30;
    border-top: 1px solid #3e3e42;
    font-size: 0.75rem;
}

.stat-item {
    color: #858585;
}

.student-status {
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.status-active {
    background-color: rgba(78, 201, 176, 0.2);
    color: #4ec9b0;
}

.status-idle {
    background-color: rgba(206, 145, 120, 0.2);
    color: #ce9178;
}

.status-submitted {
    background-color: rgba(86, 156, 214, 0.2);
    color: #569cd6;
}

.status-ended {
    background-color: rgba(244, 65, 68, 0.2);
    color: #f94144;
}

/* Controls */
.monitor-controls {
    padding: 1rem 1.5rem;
    background-color: #252526;
    border-top: 1px solid #3e3e42;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background-color: #3e3e42;
    color: #d4d4d4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.filter-btn:hover {
    background-color: #4e4e52;
}

.filter-btn.active {
    background-color: #569cd6;
    color: white;
}

/* Scrollbar Styling */
.alert-panel::-webkit-scrollbar,
.student-grid::-webkit-scrollbar {
    width: 8px;
}

.alert-panel::-webkit-scrollbar-track,
.student-grid::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.alert-panel::-webkit-scrollbar-thumb,
.student-grid::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
}

.alert-panel::-webkit-scrollbar-thumb:hover,
.student-grid::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .student-cell {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .student-cell {
        height: 200px;
    }

    .live-monitor-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 30, 30, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    border: 4px solid #3e3e42;
    border-top: 4px solid #569cd6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus View */
.focus-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1e1e1e;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.focus-view-header {
    padding: 1rem 1.5rem;
    background-color: #252526;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.focus-view-editor {
    flex: 1;
    min-height: 0;
}

.close-focus-btn {
    padding: 0.5rem 1rem;
    background-color: #569cd6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.close-focus-btn:hover {
    background-color: #4a8bbf;
}
