/* === 실시간 모니터 뷰 === */

.monitor-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.monitor-title {
  color: var(--gold, #f4c542);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}

.monitor-subtitle {
  color: var(--text-muted, #8899aa);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.monitor-loading {
  text-align: center;
  color: var(--text-muted, #8899aa);
  padding: 4rem 1rem;
  font-size: 0.95rem;
}

/* === 검색 === */

.monitor-search-wrap {
  margin-bottom: 1rem;
}

.monitor-search {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(244, 197, 66, 0.15);
  background: rgba(11, 16, 38, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text, #e8e0d0);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.monitor-search:focus {
  border-color: var(--gold, #f4c542);
}

/* === 사용자 카드 목록 === */

.monitor-user-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.monitor-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(11, 16, 38, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(244, 197, 66, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
  color: var(--text, #e8e0d0);
  width: 100%;
  font: inherit;
}

.monitor-user-card:hover,
.monitor-user-card:focus-visible {
  background: rgba(11, 16, 38, 0.88);
  border-color: rgba(244, 197, 66, 0.3);
}

.monitor-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.monitor-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-user-activity {
  font-size: 0.8rem;
  color: var(--text-muted, #8899aa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-user-time {
  font-size: 0.75rem;
  color: var(--text-muted, #8899aa);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 온라인/오프라인 점 */

.monitor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}

.monitor-dot.online {
  background: var(--sage, #7ec8a0);
  box-shadow: 0 0 8px rgba(126, 200, 160, 0.6);
  animation: monitor-pulse 2s ease-in-out infinite;
}

.monitor-dot.offline {
  background: var(--text-muted, #556677);
}

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

/* === 빈 상태 === */

.monitor-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted, #8899aa);
}

.monitor-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.monitor-empty h3 {
  color: var(--text, #e8e0d0);
  margin: 0 0 0.5rem;
}

.monitor-empty-small {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted, #8899aa);
  font-size: 0.85rem;
}

/* === 현재 상태 카드 === */

.monitor-status-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 197, 66, 0.12);
  border-left: 3px solid var(--gold, #f4c542);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.monitor-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted, #8899aa);
}

.monitor-current-activity {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #e8e0d0);
}

/* === 스크린샷 섹션 === */

.monitor-screen-section {
  margin-bottom: 1rem;
}

.monitor-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.monitor-section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold, #f4c542);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monitor-refresh-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(244, 197, 66, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, #8899aa);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.monitor-refresh-btn:hover {
  background: rgba(244, 197, 66, 0.08);
  border-color: rgba(244, 197, 66, 0.35);
  color: var(--gold, #f4c542);
}

.monitor-screen-wrap {
  border-radius: 10px;
  overflow: auto;
  border: 1px solid rgba(244, 197, 66, 0.1);
  background: rgba(0, 0, 0, 0.3);
  min-height: 120px;
  max-height: 70vh;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 197, 66, 0.2) transparent;
}

.monitor-screen-wrap:hover {
  border-color: rgba(244, 197, 66, 0.3);
}

.monitor-screen-img {
  display: block;
  /* 모바일 세로 캡처도 읽을 수 있도록 최소 너비 보장 */
  min-width: 100%;
  width: max-content;
  max-width: none;
  height: auto;
}

.monitor-screen-placeholder {
  color: var(--text-muted, #8899aa);
  font-size: 0.85rem;
  padding: 2rem;
}

.monitor-screen-time {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted, #8899aa);
  margin-top: 0.3rem;
}

/* === 활동 타임라인 === */

.monitor-timeline-section {
  margin-top: 0.5rem;
}

.monitor-timeline {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 197, 66, 0.2) transparent;
  background: rgba(11, 16, 38, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(244, 197, 66, 0.15);
  border-radius: 12px;
  padding: 0.4rem 0;
}

.monitor-timeline-loading,
.monitor-timeline-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted, #8899aa);
  font-size: 0.85rem;
}

.monitor-tl-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
  font-size: 0.85rem;
}

.monitor-tl-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.monitor-tl-item.alert {
  background: rgba(231, 76, 111, 0.08);
  border-left: 2px solid var(--rose, #e74c6f);
}

.monitor-tl-time {
  color: var(--text-muted, #8899aa);
  font-size: 0.78rem;
  font-family: 'D2Coding', monospace;
  min-width: 3em;
  flex-shrink: 0;
  padding-top: 1px;
}

.monitor-tl-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
}

.monitor-tl-detail {
  color: var(--text, #e8e0d0);
  word-break: break-word;
  line-height: 1.4;
}

/* === 풀스크린 오버레이 === */

.monitor-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  overflow: auto;
  padding: 1rem;
  cursor: pointer;
  animation: monitor-fade-in 0.2s ease-out;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

@keyframes monitor-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.monitor-fullscreen-content {
  position: relative;
  margin: auto;
  padding: 1rem 0;
}

.monitor-fullscreen-content img {
  max-width: 95vw;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(244, 197, 66, 0.15);
}

.monitor-fullscreen-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(244, 197, 66, 0.3);
  background: rgba(11, 16, 38, 0.95);
  color: var(--gold, #f4c542);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === 뒤로가기 (admin-back 재사용) === */

.monitor-container .admin-back {
  background: none;
  border: none;
  color: var(--text-muted, #8899aa);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-bottom: 0.25rem;
  transition: color 0.15s;
}

.monitor-container .admin-back:hover {
  color: var(--gold, #f4c542);
}

/* === 반응형 === */

@media (max-width: 480px) {
  .monitor-container {
    padding: 0.75rem 0.75rem 3rem;
  }
  .monitor-title {
    font-size: 1.15rem;
  }
  .monitor-timeline {
    max-height: 300px;
  }
}
