/* WindWalker Developer Mode Monitoring Dashboard Styles */
/* Version: v2.0 */
/* Reference: 367번 문서 Phase 3.1, 368번 토큰 효율 테스트, 374번 우선순위 모니터링 */

/* 대시보드 컨테이너 */
.monitoring-dashboard {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 0;
}

/* 헤더 */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e9ecef;
}

.dashboard-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.dashboard-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon:hover {
  background: #f8f9fa;
  transform: scale(1.1);
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-refresh-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #495057;
  cursor: pointer;
}

.auto-refresh-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 메트릭 카드 그리드 */
.dashboard-metrics {
  display: grid;
  grid-template-columns: 1fr; /* 모니터링 사이드바는 1열로 표시 */
  gap: 12px;
  margin-bottom: 16px;
}

/* 메트릭 카드 */
.metric-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.metric-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* 상태별 색상 */
.metric-success {
  border-left-color: #10b981;
}

.metric-info {
  border-left-color: #3b82f6;
}

.metric-warning {
  border-left-color: #f59e0b;
}

.metric-error {
  border-left-color: #ef4444;
}

/* 메트릭 헤더 */
.metric-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.metric-icon {
  font-size: 24px;
}

.metric-title {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 메트릭 값 */
.metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.value-number {
  font-size: 28px;
  font-weight: 700;
  color: #212529;
  line-height: 1;
}

.value-unit {
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
}

/* 메트릭 상태 */
.metric-status {
  margin-bottom: 12px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}

/* 메트릭 설명 */
.metric-description {
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
}

/* 상세 로그 섹션 */
.dashboard-details {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-details summary {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-details summary::-webkit-details-marker {
  display: none;
}

.dashboard-details summary::before {
  content: '▶';
  font-size: 12px;
  transition: transform 0.2s;
}

.dashboard-details[open] summary::before {
  transform: rotate(90deg);
}

/* 로그 컨테이너 */
.monitoring-logs {
  margin-top: 16px;
  display: grid;
  gap: 20px;
}

/* 로그 섹션 */
.log-section {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #dee2e6;
}

.log-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #212529;
}

/* 로그 리스트 */
.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #e9ecef;
}

.log-time {
  flex-shrink: 0;
  font-weight: 500;
  color: #6c757d;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.log-message {
  color: #212529;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-card {
  animation: fadeIn 0.4s ease-out;
}

.metric-card:nth-child(1) { animation-delay: 0s; }
.metric-card:nth-child(2) { animation-delay: 0.1s; }
.metric-card:nth-child(3) { animation-delay: 0.2s; }
.metric-card:nth-child(4) { animation-delay: 0.3s; }

/* 반응형 디자인 */
@media (max-width: 768px) {
  .monitoring-dashboard {
    padding: 16px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .metric-value .value-number {
    font-size: 28px;
  }

  .log-item {
    flex-direction: column;
    gap: 4px;
  }

  .log-time {
    font-size: 12px;
  }
}

/* 다크 모드 (선택적) */
@media (prefers-color-scheme: dark) {
  .monitoring-dashboard {
    background: #1a1a1a;
  }

  .metric-card,
  .dashboard-details,
  .log-item {
    background: #2d2d2d;
    color: #e9ecef;
  }

  .dashboard-header {
    border-bottom-color: #495057;
  }

  .metric-title,
  .metric-description,
  .log-time {
    color: #adb5bd;
  }

  .value-number,
  .log-message {
    color: #f8f9fa;
  }

  .log-section {
    background: #212529;
    border-left-color: #495057;
  }

  .btn-icon {
    background: #2d2d2d;
    color: #f8f9fa;
  }

  .btn-icon:hover {
    background: #3d3d3d;
  }
}

/* 스크롤바 스타일 */
.monitoring-logs::-webkit-scrollbar {
  width: 8px;
}

.monitoring-logs::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 4px;
}

.monitoring-logs::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 4px;
}

.monitoring-logs::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* ===================================================
   우선순위 기반 모니터링 시스템 (v2.0)
   374번 문서: 16개 모니터링 항목 P0-100 우선순위 관리
   =================================================== */

/* 뷰 전환 탭 */
.view-tabs {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.view-tab {
  padding: 8px 16px;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  color: #495057;
}

.view-tab:hover {
  background: #f8f9fa;
  border-color: #3b82f6;
}

.view-tab.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* 뷰 컨텐츠 표시/숨김 */
.view-content {
  transition: opacity 0.3s ease;
}

.view-content.hidden {
  display: none;
}

.view-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* 우선순위 뷰 헤더 */
.priority-header {
  margin-bottom: 20px;
}

/* 우선순위 통계 */
.priority-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  border-left: 3px solid #dee2e6;
  transition: all 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-item.critical {
  border-left-color: #DC2626;
}

.stat-item.high {
  border-left-color: #F97316;
}

.stat-item.resolved {
  border-left-color: #10B981;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #212529;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

/* 우선순위 필터 버튼 */
.priority-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 12px;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  color: #495057;
}

.filter-btn:hover {
  background: #f8f9fa;
  transform: scale(1.05);
}

.filter-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* 우선순위 그리드 (반응형) */
.priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  transition: all 0.3s ease;
}

/* 반응형 브레이크포인트 */
@media (min-width: 640px) {
  .priority-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (min-width: 768px) {
  .priority-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (min-width: 1024px) {
  .priority-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

@media (min-width: 1280px) {
  .priority-grid {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  }
}

/* 우선순위 블럭 */
.priority-block {
  position: relative;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.priority-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 긴급 (Critical) - 빨강 */
.priority-critical {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  border: 2px solid #7F1D1D;
}

.priority-critical:hover {
  background: linear-gradient(135deg, #EF4444, #DC2626);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3), 0 0 20px rgba(220, 38, 38, 0.2);
  }
  50% {
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.5), 0 0 30px rgba(220, 38, 38, 0.4);
  }
}

.priority-critical {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* 높음 (High) - 주황 */
.priority-high {
  background: linear-gradient(135deg, #F97316, #C2410C);
  border: 2px solid #9A3412;
}

.priority-high:hover {
  background: linear-gradient(135deg, #FB923C, #F97316);
}

/* 보통 (Medium) - 노랑 */
.priority-medium {
  background: linear-gradient(135deg, #EAB308, #A16207);
  border: 2px solid #854D0E;
}

.priority-medium:hover {
  background: linear-gradient(135deg, #FCD34D, #EAB308);
}

/* 낮음 (Low) - 파랑 */
.priority-low {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  border: 2px solid #1E40AF;
}

.priority-low:hover {
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
}

/* 예정 (Planned) - 회색 */
.priority-planned {
  background: linear-gradient(135deg, #6B7280, #374151);
  border: 2px solid #1F2937;
}

.priority-planned:hover {
  background: linear-gradient(135deg, #9CA3AF, #6B7280);
}

/* 상태 배지 */
.status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
}

.status-error {
  background: rgba(239, 68, 68, 0.9);
}

.status-warning {
  background: rgba(245, 158, 11, 0.9);
}

.status-success {
  background: rgba(16, 185, 129, 0.9);
}

.status-info {
  background: rgba(59, 130, 246, 0.9);
}

/* 우선순위 제목 */
.priority-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 우선순위 설명 */
.priority-description {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

/* 메트릭 행 */
.priority-metrics {
  margin-bottom: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.metric-label {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.metric-value {
  color: white;
  font-weight: 700;
}

/* 진행률 바 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* 우선순위 푸터 */
.priority-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.priority-action {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.priority-due {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

/* 우선순위 점수 */
.priority-score {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  backdrop-filter: blur(4px);
}

/* 클라우드 대시보드 링크 섹션 (55, 57, 68번 문서) */
.cloud-dashboards {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cloud-dashboards h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #212529;
}

.dashboard-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-link {
  display: block;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #495057;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.dashboard-link:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.dashboard-note {
  margin: 0;
  padding: 8px;
  background: #fff3e0;
  border-radius: 4px;
  font-size: 12px;
  color: #856404;
  text-align: center;
}

/* 프린트 스타일 */
@media print {
  .dashboard-actions {
    display: none;
  }

  .metric-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #dee2e6;
  }

  .dashboard-details[open] summary::before {
    display: none;
  }

  .cloud-dashboards {
    display: none;
  }
}

/* === 템플릿 관리 뷰 스타일 (377번 문서 기반) === */

/* 템플릿 헤더 */
.templates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.templates-stats {
  display: flex;
  gap: 32px;
}

.templates-stats .stat-item {
  text-align: center;
}

.templates-stats .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 4px;
}

.templates-stats .stat-label {
  font-size: 13px;
  color: #6c757d;
  font-weight: 500;
}

.templates-stats .stat-item.success .stat-value {
  color: #10b981;
}

.templates-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  padding: 10px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
  padding: 10px 18px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* 템플릿 그리드 */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

/* 템플릿 카드 */
.template-card {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  border: 2px solid transparent;
}

.template-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
  border-color: #667eea;
}

/* 템플릿 상태 배지 */
.template-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  z-index: 10;
}

/* 템플릿 썸네일 */
.template-thumbnail {
  width: 100%;
  height: 180px;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #e9ecef;
}

.template-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.template-icon {
  font-size: 48px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.template-category {
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 템플릿 정보 */
.template-info {
  margin-bottom: 16px;
}

.template-name {
  font-size: 16px;
  font-weight: 700;
  color: #212529;
  margin: 0 0 8px 0;
}

.template-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 8px;
}

.template-version {
  font-weight: 600;
  color: #495057;
}

.template-score {
  font-weight: 600;
  color: #10b981;
}

/* 개선 사항 */
.template-improvements {
  margin-top: 12px;
  font-size: 12px;
}

.template-improvements summary {
  cursor: pointer;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 6px;
  user-select: none;
}

.template-improvements summary:hover {
  color: #764ba2;
}

.template-improvements ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.template-improvements li {
  margin-bottom: 4px;
  color: #495057;
  line-height: 1.4;
}

/* 템플릿 액션 버튼 */
.template-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.template-btn {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #495057;
}

.template-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #667eea;
  transform: scale(1.05);
}

.template-btn:active {
  transform: scale(0.98);
}

/* 템플릿 푸터 */
.template-footer {
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
  font-size: 12px;
  color: #6c757d;
  text-align: center;
}

/* 미리보기 모달 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #e9ecef;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

/* 템플릿 에러 메시지 */
.templates-error {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #856404;
}

.templates-error p {
  margin: 8px 0;
  font-size: 14px;
}

.templates-error p:first-child {
  font-weight: 700;
  font-size: 16px;
}
