/* 관리자 대시보드 전체 레이아웃 */
.admin-monitoring-dashboard {
    padding: 20px;
    background: #f5f6fa;
    height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
}

/* 대시보드 헤더 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    gap: 24px;
}

.dashboard-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
}

.status-indicators {
    display: flex;
    gap: 16px;
}

.indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.indicator.success { background: #d4edda; color: #155724; }
.indicator.info { background: #d1ecf1; color: #0c5460; }
.indicator.error { background: #f8d7da; color: #721c24; }

/* 이벤트 로그 섹션 */
.event-log-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #34495e;
    color: white;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
}

.log-controls {
    display: flex;
    gap: 12px;
}

.btn-clear, .btn-pause {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-clear:hover, .btn-pause:hover {
    background: #2980b9;
}

.btn-clear {
    background: #e74c3c;
}

.btn-clear:hover {
    background: #c0392b;
}

/* 이벤트 로그 컨테이너 */
.event-log-container {
    background: #fafbfc;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.event-log-stack {
    padding: 0;
    border: none;
    flex: 1;
    overflow-y: auto;
}

.no-events {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.no-events .text-muted {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.7;
}

/* 이벤트 로그 아이템 - 스택 형태 */
.event-log-item {
    padding: 16px 24px;
    border-bottom: 1px solid #ecf0f1;
    transition: all 0.2s ease;
    position: relative;
}

/* 이벤트 로그 아이템 - 1줄 표시 */
.event-log-item-oneline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    border-bottom: 1px solid #ecf0f1;
    transition: all 0.2s ease;
    position: relative;
    font-size: 14px;
    min-height: 40px;
}

.event-log-item:hover, .event-log-item-oneline:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.event-log-item:first-child, .event-log-item-oneline:first-child {
    border-top: 3px solid #3498db; /* 최신 이벤트 강조 */
}

/* 이벤트 상태별 배경색 */
.event-log-item.event-success, .event-log-item-oneline.event-success {
    background: linear-gradient(90deg, #d4edda 0%, #ffffff 100%);
    border-left: 4px solid #28a745;
}

.event-log-item.event-error, .event-log-item-oneline.event-error {
    background: linear-gradient(90deg, #ffebee 0%, #ffffff 100%); /* 빨간 파스텔 */
    border-left: 4px solid #e74c3c;
    animation: pulse-error 2s infinite;
}

.event-log-item.event-warning, .event-log-item-oneline.event-warning {
    background: linear-gradient(90deg, #fff3cd 0%, #ffffff 100%);
    border-left: 4px solid #ffc107;
}

.event-log-item.event-info, .event-log-item-oneline.event-info {
    background: linear-gradient(90deg, #e3f2fd 0%, #ffffff 100%);
    border-left: 4px solid #17a2b8;
}

/* 오류 이벤트 깜빡임 효과 */
@keyframes pulse-error {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* 이벤트 헤더 */
.event-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* 1줄 표시용 개별 요소 스타일 */
.event-log-item-oneline .timestamp {
    font-weight: 600;
    color: #6c757d;
    min-width: 90px;
    flex-shrink: 0;
}

/* 공장 정보 컨테이너 */
.event-log-item-oneline .factory-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.event-log-item-oneline .factory-name {
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
    font-weight: 600;
}

.event-log-item-oneline .cctv-number {
    background: #d1ecf1;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    color: #0c5460;
    font-weight: 500;
}

.event-log-item-oneline .status-badge {
    font-size: 16px;
    flex-shrink: 0;
}

.event-log-item-oneline .event-message {
    flex: 1;
    color: #2c3e50;
    font-weight: 500;
}

.event-log-item-oneline .file-info {
    color: #6c757d;
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.timestamp {
    font-family: 'Consolas', monospace;
    font-weight: bold;
    color: #2c3e50;
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.factory-badge {
    background: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge {
    font-size: 16px;
}

/* 이벤트 메시지 */
.event-message {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* 이벤트 상세 정보 */
.event-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #7f8c8d;
}

.file-name {
    font-family: 'Consolas', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.file-size {
    color: #95a5a6;
    font-style: italic;
}

.progress {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .status-indicators {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .event-header {
        flex-wrap: wrap;
    }
    
    .admin-monitoring-dashboard {
        padding: 10px;
    }
}

/* 다크 모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    .admin-monitoring-dashboard {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .dashboard-header, .event-log-section {
        background: #2d3748;
        color: #ffffff;
    }
    
    .event-log-container {
        background: #1a202c;
    }
    
    .event-log-item {
        border-bottom-color: #4a5568;
    }
    
    .event-log-item:hover {
        background: #2d3748;
    }
}

/* 시스템 로그 전용 스타일 */
.factory-name.system-log {
    color: #6c757d !important;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #dee2e6;
    text-transform: uppercase;
}

/* 다크 모드에서 시스템 로그 스타일 */
@media (prefers-color-scheme: dark) {
    .factory-name.system-log {
        color: #adb5bd !important;
        background: #495057;
        border-color: #6c757d;
    }
}