
/* ==========================================================
   Group Training Module CSS - 그룹 훈련 전용 스타일
   기존 style.css와 일관성을 유지하면서 그룹 훈련 기능만을 위한 스타일
   
   섹션 구성:
   [1] 훈련 방식 선택 화면
   [2] 역할 선택 (관리자/참가자)
   [3] 그룹 훈련 방 관리
   [4] 대기실 화면
   [5] 모니터링 오버레이
   [6] 채팅 시스템
   [7] 마이크 및 코칭 기능
   [8] 반응형 및 애니메이션
   [9] 상태 표시 및 피드백
   [10] 성능 최적화
========================================================== */

/* ========== [1] 훈련 방식 선택 화면 ========== */

.training-mode-selection {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.training-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.training-mode-card {
  background: linear-gradient(135deg, #2e74e8 0%, #2562c8 100%);
  border-radius: 16px;
  padding: 28px;
  color: white;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.training-mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.training-mode-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(46, 116, 232, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.training-mode-card:hover::before {
  opacity: 1;
}

.training-mode-card.group-training {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.training-mode-card.group-training:hover {
  box-shadow: 0 16px 32px rgba(40, 167, 69, 0.3);
}

/* 그룹 훈련 카드 비활성화 상태 (훈련방 없을 때) */
.training-mode-card.group-training.disabled {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  opacity: 0.7;
  filter: grayscale(0.6);
  cursor: not-allowed;
  position: relative;
}

.training-mode-card.group-training.disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  pointer-events: none;
}

.training-mode-card.group-training.disabled:hover {
  transform: none;
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
  border-color: transparent;
}

.training-mode-card.group-training.disabled .mode-icon,
.training-mode-card.group-training.disabled h4,
.training-mode-card.group-training.disabled p,
.training-mode-card.group-training.disabled .mode-features li {
  opacity: 0.6;
  color: rgba(255, 255, 255, 0.7);
}

.training-mode-card.group-training.disabled button {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 그룹 훈련 카드 활성화 상태 (훈련방 있을 때) */
.training-mode-card.group-training.active {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  animation: pulseGlow 2s ease-in-out infinite;
  box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
  }
  50% {
    box-shadow: 0 12px 32px rgba(40, 167, 69, 0.6);
  }
}

.mode-icon {
  font-size: 52px;
  margin-bottom: 16px;
  display: block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.training-mode-card h4 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: white;
}

.training-mode-card > p {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 20px;
  line-height: 1.5;
}

.mode-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 28px 0;
  text-align: left;
  flex-grow: 1;
}

.mode-features li {
  font-size: 14px;
  padding: 6px 0;
  opacity: 0.85;
  position: relative;
  padding-left: 20px;
  line-height: 1.4;
}

.mode-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  font-size: 16px;
}

.mode-select-btn {
  width: 100%;
  margin-top: auto;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-radius: 8px;
  cursor: pointer;
}

.mode-select-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========== [2] 역할 선택 (관리자/참가자) ========== */

.role-selection {
  margin-bottom: 30px;
}

.role-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.role-btn {
  padding: 24px 20px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.role-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(46, 116, 232, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.role-btn:hover {
  border-color: #2e74e8;
  box-shadow: 0 8px 24px rgba(46, 116, 232, 0.15);
  transform: translateY(-2px);
}

.role-btn:hover::before {
  opacity: 1;
}

.role-btn.active {
  border-color: #2e74e8;
  background: linear-gradient(135deg, #2e74e8 0%, #2562c8 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(46, 116, 232, 0.3);
}

.role-btn.admin.active {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border-color: #dc3545;
  box-shadow: 0 8px 24px rgba(220, 53, 69, 0.3);
}

.role-btn span {
  font-size: 18px;
  font-weight: 600;
  margin: 4px 0;
}

.role-btn small {
  font-size: 14px;
  opacity: 0.8;
  color: #6c757d;
}

.role-btn.active small {
  color: rgba(255, 255, 255, 0.9);
}

/* ========== [3] 그룹 훈련 방 관리 ========== */

.available-rooms {
  margin-top: 30px;
}

.rooms-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  background: #f8f9fa;
}

.room-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(46, 116, 232, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.room-card:hover {
  border-color: #2e74e8;
  box-shadow: 0 8px 20px rgba(46, 116, 232, 0.15);
  transform: translateY(-2px);
}

.room-card:hover::before {
  opacity: 1;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.room-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.room-code {
  background: #2e74e8;
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.room-details {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #6c757d;
}

.room-workout,
.room-participants {
  display: flex;
  align-items: center;
  gap: 4px;
}

.room-admin {
  font-size: 13px;
  color: #6c757d;
  font-style: italic;
}

.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: #6c757d;
  font-size: 14px;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e9ecef;
  z-index: 1;
}

.divider span {
  background: white;
  padding: 0 15px;
  position: relative;
  z-index: 2;
}

/* ========== [4] 대기실 화면 ========== */

/* 훈련방 화면 스크롤바 깜빡임 방지 */
#groupWaitingScreen {
  overflow-y: hidden;
}

.room-info {
  margin-bottom: 20px;
}

.room-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.room-code {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.room-code strong {
  background: #2e74e8;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  font-size: 18px;
}

.btn-copy {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-copy:hover {
  background: #e9ecef;
  border-color: #6c757d;
}

.room-workout {
  font-size: 14px;
  color: #6c757d;
}

.participants-list {
  margin-bottom: 20px;
}

.participants-list.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
}

.participants-list.card #participantsList {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.participants-list.card #participantsList .participant-table-wrapper {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .participants-list.card {
    max-height: none;
  }
}

.participants-list h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.participant-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  position: relative;
}

.participant-card.current-user {
  border: 2px solid #007bff;
  background: linear-gradient(135deg, #e7f3ff 0%, white 100%);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.participant-card.admin {
  border-left: 4px solid #dc3545;
  background: linear-gradient(135deg, #fff5f5 0%, white 100%);
}

.participant-card.participant {
  border-left: 4px solid #28a745;
  background: linear-gradient(135deg, #f0fff4 0%, white 100%);
}

.participant-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.participant-name {
  font-weight: 600;
  font-size: 16px;
  color: #2c3e50;
}

.participant-role {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: #f8f9fa;
  color: #6c757d;
  font-weight: 500;
}

.participant-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.ready-status {
  font-weight: 500;
}

.ready-status.ready {
  color: #28a745;
}

.ready-status.not-ready {
  color: #ffc107;
}

.join-time {
  font-size: 12px;
  color: #6c757d;
}

/* 블루투스 기기 연결 상태 */
.participant-bluetooth-status {
  margin: 12px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* ===== 참가자 목록 (표 형식) ===== */
.participant-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.participant-table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(180deg, #11131a 0%, #090a0f 100%);
  color: #f4f6fb;
  font-size: 0.85rem;
  min-width: 960px;
}

.participant-table thead {
  background: linear-gradient(90deg, rgba(63,89,144,0.95) 0%, rgba(33,45,70,0.95) 100%);
}

.participant-table th {
  padding: 11px 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #e8efff;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}

.participant-table td {
  padding: 9px 8px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.participant-table tbody tr {
  transition: background 0.2s ease;
}

.participant-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

.participant-table tbody tr.current-user {
  background: rgba(76,201,240,0.12);
  border-left: 3px solid #4cc9f0;
}

.participant-table tbody tr.segment-active {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow:
    0 0 8px rgba(16, 185, 129, 0.35),
    0 0 14px rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.08);
}
.participant-table tbody tr.segment-active::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 10px;
  border: 2px solid rgba(16, 185, 129, 0.45);
  box-shadow:
    0 0 10px rgba(16, 185, 129, 0.35),
    0 0 20px rgba(16, 185, 129, 0.25);
  pointer-events: none;
}

.participant-name-cell {
  text-align: left;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.participant-name-cell .participant-name-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ble-icons {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.ble-icons .device-badge {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(5,5,5,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.ble-icons .device-badge img {
  width: 16px;
  height: 16px;
  display: block;
}

.ble-icons .device-badge:hover {
  transform: scale(1.08);
}

.ready-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ready-chip.ready {
  background: rgba(76,201,240,0.2);
  color: #4cc9f0;
  border: 1px solid rgba(76,201,240,0.5);
}

.ready-chip.not-ready {
  background: rgba(255,193,7,0.15);
  color: #ffd166;
  border: 1px solid rgba(255,193,7,0.4);
}

.ready-toggle-inline {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #f1f5f9;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ready-toggle-inline.ready {
  background: rgba(76,201,240,0.2);
  border-color: rgba(76,201,240,0.4);
  color: #4cc9f0;
}

.ready-toggle-inline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ready-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  display: block;
}

.empty-state {
  text-align: center;
  padding: 40px 10px;
  color: rgba(255,255,255,0.65);
  font-style: italic;
}

/* 워크아웃 세그먼트 테이블 */
.workout-table-card {
  background: rgba(12, 16, 28, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  margin-top: 16px;
  backdrop-filter: blur(6px);
}

.workout-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.workout-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-training-clock {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #4cc9f0;
  background: rgba(76, 201, 240, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(76, 201, 240, 0.3);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(76, 201, 240, 0.5);
  min-width: 90px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  /* 깜빡임 방지 */
  will-change: contents;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

.group-training-clock.clock-sync-alert {
  color: #fff;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.clock-digits {
  display: flex;
  align-items: center;
  gap: 2px;
}

.clock-digit {
  position: relative;
  width: 18px;
  height: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.digit-container {
  position: relative;
  width: 100%;
  height: 20px;
  overflow: hidden;
}

.digit-value {
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 20px;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  /* 깜빡임 방지 */
  opacity: 1 !important;
  will-change: transform;
  backface-visibility: hidden;
}

.digit-value.digit-old {
  top: 0;
  opacity: 1 !important;
}

.digit-value.digit-new {
  top: 100%;
  opacity: 1 !important;
}

.clock-separator {
  margin: 0 1px;
  opacity: 0.8;
}

.workout-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workout-title .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 230, 109, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.workout-title h3 {
  margin: 0;
  font-size: 16px;
  color: #f8f9ff;
}

.workout-title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.workout-status-pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workout-status-pill.is-live {
  background: rgba(76, 201, 240, 0.2);
  color: #4cc9f0;
}

.workout-status-pill.is-countdown {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

.workout-timers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 18px 0 24px;
}

.workout-timer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
  position: relative;
  overflow: hidden;
}

.workout-timer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.workout-timer.elapsed {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.15), rgba(15, 23, 42, 0.9));
}

.workout-timer.segment {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(15, 23, 42, 0.9));
}

.timer-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.08);
}

.workout-timer.elapsed .timer-icon {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.18);
}

.workout-timer.segment .timer-icon {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.2);
}

.timer-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer-subtext {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.75);
  letter-spacing: 0.02em;
}

.timer-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(229, 231, 235, 0.8);
  text-transform: uppercase;
}

.timer-value {
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 700;
  line-height: 1;
}

.timer-value.is-countdown {
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.7);
  font-size: clamp(40px, 5vw, 64px);
}

.workout-timer.elapsed .timer-value {
  color: #2dd4bf;
  text-shadow: 0 0 18px rgba(45, 212, 191, 0.5);
}

.workout-timer.segment .timer-value {
  color: #fb923c;
  text-shadow: 0 0 18px rgba(251, 146, 60, 0.55);
}

@media (max-width: 640px) {
  .workout-timers {
    grid-template-columns: 1fr;
  }
}

.workout-table-wrapper {
  max-height: 200px;
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 10px;
  position: relative;
  /* 스크롤바 깜빡임 방지: 스크롤바 공간을 항상 예약 */
  scrollbar-gutter: stable;
}

.workout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #f5f7ff;
  position: relative;
  z-index: 1;
}

.workout-table thead {
  background: rgba(255,255,255,0.03);
}

.workout-table th {
  padding: 10px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  position: sticky;
  top: 0;
  background: rgba(12, 16, 28, 0.95);
  backdrop-filter: blur(6px);
  z-index: 1;
}

.workout-table td {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.workout-table th.col-ftp,
.workout-table th.col-duration {
  text-align: center;
}

.segment-active-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border: 2px solid rgba(45, 212, 191, 0.95);
  border-radius: 14px;
  background: rgba(45, 212, 191, 0.15);
  box-shadow:
    0 0 15px rgba(45, 212, 191, 0.65),
    0 0 35px rgba(45, 212, 191, 0.45),
    0 0 55px rgba(45, 212, 191, 0.25),
    inset 0 0 18px rgba(45, 212, 191, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition:
    transform 0.25s ease,
    height 0.2s ease,
    opacity 0.15s ease;
  z-index: 0;
  animation: activeSegmentGlow 2s ease-in-out infinite alternate;
}

@keyframes activeSegmentGlow {
  0% {
    box-shadow:
      0 0 15px rgba(45, 212, 191, 0.65),
      0 0 35px rgba(45, 212, 191, 0.45),
      0 0 55px rgba(45, 212, 191, 0.25),
      inset 0 0 18px rgba(45, 212, 191, 0.18);
    border-color: rgba(45, 212, 191, 0.95);
  }
  100% {
    box-shadow:
      0 0 25px rgba(45, 212, 191, 0.85),
      0 0 45px rgba(45, 212, 191, 0.6),
      0 0 65px rgba(45, 212, 191, 0.4),
      inset 0 0 26px rgba(45, 212, 191, 0.2);
    border-color: rgba(45, 212, 191, 1);
  }
}

.segment-active-overlay {
  animation: activeSegmentGlow 2s ease-in-out infinite alternate;
}

.workout-table tbody tr.current-segment {
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid #ef4444;
}

.workout-table .seg-index-text {
  display: inline-flex;
  min-width: 32px;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.workout-table .seg-label {
  font-weight: 600;
  color: #ffffff;
}

.workout-table .seg-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.workout-table .seg-type {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.workout-table .seg-col-ftp {
  text-align: center;
  font-weight: 600;
  color: #ffd166;
}

.workout-table .seg-col-duration {
  text-align: center;
  color: #9be564;
  font-weight: 600;
}

.workout-table .unit {
  font-size: 10px;
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-segment {
  text-align: center;
  padding: 16px;
  color: rgba(255,255,255,0.6);
}

.bluetooth-devices {
  display: flex;
  gap: 12px;
  align-items: center;
}

.device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: white;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.device-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.device-status-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.device-status-img.active {
  opacity: 1;
  filter: brightness(1);
}

.device-status-img.inactive {
  opacity: 0.5;
  filter: grayscale(100%);
}

.ready-toggle-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #ffc107;
  background: #fff3cd;
  color: #856404;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.ready-toggle-btn:hover {
  background: #ffe69c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ready-toggle-btn.ready {
  border-color: #28a745;
  background: #d4edda;
  color: #155724;
}

.ready-toggle-btn.ready:hover {
  background: #c3e6cb;
}

/* 관리자 및 참가자 컨트롤 */
.admin-controls,
.participant-controls {
  margin-bottom: 20px;
}

.group-training-control-bar {
  margin: 24px auto 0;
  padding: 24px 20px 28px;
  max-width: 420px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.group-training-control-buttons {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.group-training-control-labels {
  display: flex;
  justify-content: center;
  gap: 28px;
  width: 100%;
  font-size: 13px;
  color: #cbd5f5;
  letter-spacing: 0.2px;
}

.group-training-control-labels span {
  width: 80px;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(203, 213, 255, 0.85);
}

.admin-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ready-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid #ffc107;
  background: #fff3cd;
  color: #856404;
}

.ready-btn.ready {
  border-color: #28a745;
  background: #d4edda;
  color: #155724;
}

.ready-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== [5] 모니터링 오버레이 ========== */

.group-monitoring-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10000;
  overflow-y: auto;
  padding: 20px;
}

.group-monitoring-overlay.hidden {
  display: none;
}

.monitoring-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 20px 30px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.monitoring-header h2 {
  color: white;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.monitoring-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mic-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mic-btn.active {
  background: #28a745;
  animation: micPulse 2s infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
}

.participants-monitoring {
  max-width: 1400px;
  margin: 0 auto;
}

.monitoring-participants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.monitoring-participant-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.monitoring-participant-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.participant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.participant-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.participant-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.participant-status.active {
  background: #d4edda;
  color: #155724;
}

.participant-status.inactive {
  background: #f8d7da;
  color: #721c24;
}

.participant-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  text-align: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
  font-weight: 500;
}

.metric-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

.participant-progress {
  margin-bottom: 16px;
  position: relative; /* 진행바 컨테이너 기준점 설정 */
}

.participant-progress .progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative; /* 진행바 기준점 설정 */
}

.participant-progress .progress-fill {
  height: 100%;
  width: 0%; /* 기본값 0%, 인라인 스타일로 덮어쓰기됨 */
  background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative; /* 부모 요소 내에서만 위치 지정 */
  display: block; /* 블록 요소로 명시 */
  max-width: 100%; /* 최대 너비 제한 */
}

.participant-progress .progress-text {
  font-size: 14px;
  color: #6c757d;
  text-align: center;
  display: block;
}

.participant-actions {
  display: flex;
  gap: 8px;
}

.coaching-quick-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  background: white;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.coaching-quick-btn:hover {
  background: #f8f9fa;
  border-color: #2e74e8;
  color: #2e74e8;
}

/* ========== [6] 마이크 및 코칭 기능 ========== */

.coaching-section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.coaching-section.hidden {
  display: none;
}

.mic-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.mic-indicator {
  font-size: 24px;
  animation: micBounce 1s infinite;
}

@keyframes micBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mic-status span {
  color: white;
  font-weight: 500;
}

.coaching-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.coaching-btn {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.coaching-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.custom-message {
  display: flex;
  gap: 8px;
}

.custom-message input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(5px);
}

.custom-message input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.custom-message button {
  padding: 12px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.custom-message button:hover {
  background: #218838;
}

/* ========== [8] 반응형 및 애니메이션 ========== */

@media (max-width: 768px) {
  .training-modes {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .role-buttons {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .room-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .participant-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .monitoring-participants {
    grid-template-columns: 1fr;
  }
  
  .participant-metrics {
    grid-template-columns: 1fr;
  }
  
  .coaching-controls {
    grid-template-columns: 1fr;
  }
  
  .admin-buttons {
    flex-direction: column;
  }
  
  .monitoring-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .group-monitoring-overlay {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .training-mode-card {
    padding: 20px;
    min-height: 280px;
  }
  
  .mode-icon {
    font-size: 40px;
  }
  
  .training-mode-card h4 {
    font-size: 18px;
  }
  
  .room-details {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .room-code strong {
    font-size: 16px;
    padding: 6px 12px;
  }
}

/* ========== [9] 상태 표시 및 피드백 ========== */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online {
  background: #28a745;
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: #6c757d;
}

.status-dot.away {
  background: #ffc107;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.connection-status {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.connection-status.connected {
  background: rgba(40, 167, 69, 0.9);
}

.connection-status.disconnected {
  background: rgba(220, 53, 69, 0.9);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 로딩 및 빈 상태 스타일 개선 */
.loading-spinner .spinner {
  border-color: #e9ecef;
  border-top-color: #2e74e8;
}

.empty-state-icon {
  filter: grayscale(50%);
}

.error-state {
  border-color: #f5c6cb;
  background: #f8d7da;
}

/* ========== [10] 방 모니터링 모달 ========== */

.monitoring-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.monitoring-modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.monitoring-modal-header {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-header-info h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
}

.room-info-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  opacity: 0.9;
}

.room-name {
  font-weight: 600;
}

.room-code {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-family: monospace;
}

.monitoring-modal-header .close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.monitoring-modal-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.monitoring-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.room-status-section {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-label {
  font-weight: 600;
  color: #6b7280;
}

.status-value {
  font-weight: 600;
  font-size: 16px;
  padding: 6px 12px;
  border-radius: 8px;
  background: white;
}

.status-value.waiting {
  color: #f59e0b;
  background: #fef3c7;
}

.status-value.starting {
  color: #3b82f6;
  background: #dbeafe;
}

.status-value.training {
  color: #10b981;
  background: #d1fae5;
}

.status-value.finished {
  color: #6366f1;
  background: #e0e7ff;
}

.status-value.closed {
  color: #ef4444;
  background: #fee2e2;
}

.participants-monitoring-section {
  margin-bottom: 24px;
}

.participants-monitoring-section h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: #1f2937;
}

.monitoring-participants-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding: 8px;
}

.monitoring-participant-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.monitoring-participant-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.monitoring-participant-item .participant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.participant-name-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participant-name {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
}

.participant-role-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #6b7280;
}

.participant-role-badge.admin {
  background: #dbeafe;
  color: #1e40af;
}

.participant-status-indicator {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 500;
}

.participant-status-indicator.ready {
  background: #d1fae5;
  color: #065f46;
}

.participant-status-indicator.not-ready {
  background: #fee2e2;
  color: #991b1b;
}

.participant-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.metric-item {
  text-align: center;
  padding: 8px;
  background: #f9fafb;
  border-radius: 8px;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.metric-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.participant-progress {
  margin-top: 12px;
  position: relative; /* 진행바 컨테이너 기준점 설정 */
}

.monitoring-participants-list .progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
  position: relative; /* 진행바 기준점 설정 */
}

.monitoring-participants-list .progress-fill {
  height: 100%;
  width: 0%; /* 기본값 0%, 인라인 스타일로 덮어쓰기됨 */
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: width 0.3s ease;
  border-radius: 4px;
  position: relative; /* 부모 요소 내에서만 위치 지정 */
  display: block; /* 블록 요소로 명시 */
  max-width: 100%; /* 최대 너비 제한 */
}

.monitoring-participants-list .progress-text {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  display: block;
}

.empty-participants {
  text-align: center;
  padding: 40px;
  color: #9ca3af;
  font-size: 16px;
}

.participant-status-message {
  margin-top: 12px;
  padding: 16px;
  background: #f3f4f6;
  border-radius: 8px;
  text-align: center;
}

.participant-status-message .status-info {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.monitoring-controls-section {
  margin-top: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.monitoring-controls-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #1f2937;
}

.coaching-controls {
  display: flex;
  gap: 12px;
}

.coaching-controls .btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.coaching-controls .btn-primary {
  background: #2196F3;
  color: white;
}

.coaching-controls .btn-primary:hover {
  background: #1976D2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.coaching-controls .btn-secondary {
  background: #6b7280;
  color: white;
}

.coaching-controls .btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== [11] 성능 최적화 ========== */

/* GPU 가속을 위한 will-change 속성 */
.training-mode-card,
.participant-card,
.monitoring-participant-card,
.mic-indicator {
  will-change: transform;
}

/* 스크롤 성능 최적화 */
.rooms-list,
.monitoring-participants {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.rooms-list::-webkit-scrollbar {
  width: 6px;
}

.rooms-list::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 3px;
}

.rooms-list::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.rooms-list::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  .training-mode-card,
  .role-btn,
  .room-card,
  .participant-card {
    border-width: 3px;
  }
  
  .status-dot {
    border: 2px solid #000;
  }
}

/* 다크모드 기본 지원 */
@media (prefers-color-scheme: dark) {
  .room-card,
  .participant-card,
  .monitoring-participant-card {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  .room-header h4,
  .participant-name {
    color: #e2e8f0;
  }
  
  .metric {
    background: #4a5568;
    color: #e2e8f0;
  }
  
  .metric-label {
    color: #a0adb8;
  }
  
  .metric-value {
    color: #e2e8f0;
  }
}

/* 인쇄 스타일 */
@media print {
  .group-monitoring-overlay,
  .coaching-section {
    display: none !important;
  }
  
  .monitoring-participants {
    grid-template-columns: repeat(2, 1fr);
  }
}



/* 훈련방 관리자 전용 스타일 */
/* 훈련방 관리자 전용 스타일 */
.role-btn.manager {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border-color: #8b5cf6;
  color: white;
  transition: all 0.3s ease;
}

.role-btn.manager:hover {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.role-btn.manager.active {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.role-btn.manager.hidden {
  display: none !important;
}

/* 활성 훈련방 목록 */
.active-rooms-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.active-room-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.active-room-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.active-room-card.training {
  border-left: 4px solid #ef4444;
  background: linear-gradient(90deg, #fef2f2, #fff);
}

.active-room-card.waiting {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(90deg, #fffbeb, #fff);
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.room-name {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
}

.room-status {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.room-status.waiting {
  background: #fef3c7;
  color: #92400e;
}

.room-status.training {
  background: #fee2e2;
  color: #991b1b;
}

.room-status.closed {
  background: #f3f4f6;
  color: #6b7280;
}

.room-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #6b7280;
}

.room-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.participant-tag {
  background: #f3f4f6;
  color: #374151;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.participant-tag.admin {
  background: #dbeafe;
  color: #1e40af;
}

.participant-tag.ready {
  background: #ecfdf3;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.3);
}

.participant-tag.waiting {
  background: #fff7ed;
  color: #b45309;
  border-color: rgba(251, 146, 60, 0.4);
}

.empty-participants {
  color: #9ca3af;
  font-size: 12px;
}

.room-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.room-action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-action-btn.monitor {
  background: #3b82f6;
  color: white;
}

.room-action-btn.monitor:hover {
  background: #2563eb;
}

.room-action-btn.stop {
  background: #ef4444;
  color: white;
}

.room-action-btn.stop:hover {
  background: #dc2626;
}

/* 통계 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* 관리 작업 버튼들 */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h4 {
  margin: 0;
  color: #374151;
}

.divider {
  height: 1px;
  background: #e5e7eb;
  margin: 24px 0;
}

/* 반응형 */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .action-buttons {
    grid-template-columns: 1fr;
  }
  
  .room-details {
    grid-template-columns: 1fr;
  }
}



/* ========== 관리자 기능 섹션 스타일 ========== */

/* 관리자 기능 섹션 */
.admin-functions-section {
  background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 30px;
  color: white;
  box-shadow: 0 8px 24px rgba(111, 66, 193, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-functions-section h3 {
  color: white;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-functions-section .muted {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* 관리자 액션 그리드 */
.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* 관리자 액션 버튼 */
.admin-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  min-height: 80px;
}

.admin-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.admin-action-btn .btn-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.admin-action-btn .btn-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-action-btn .btn-text strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.admin-action-btn .btn-text small {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.3;
}

/* 그룹 훈련 카드 내 관리자 버튼 */
.admin-group-buttons {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-quick-btn {
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.admin-quick-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.admin-quick-btn .btn-icon {
  font-size: 14px;
  margin-right: 6px;
}

/* 관리자 배지 */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ff6b6b, #feca57);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  margin-left: 8px;
}

.admin-badge::before {
  content: '👑';
  font-size: 10px;
}

/* 애니메이션 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 반응형 */
@media (max-width: 768px) {
  .admin-actions-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .admin-action-btn {
    padding: 14px 16px;
    min-height: 70px;
  }
  
  .admin-functions-section {
    padding: 20px;
    margin-bottom: 24px;
  }
}




/* ========== 관리자 화면 전용 스타일 ========== */

/* 활성 훈련방 카드 스타일 */
.active-room-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.active-room-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.room-title strong {
  font-size: 16px;
  color: #1f2937;
}

.room-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.room-status.waiting { background: #fef3c7; color: #92400e; }
.room-status.starting { background: #dbeafe; color: #1e40af; }
.room-status.training { background: #d1fae5; color: #065f46; }
.room-status.finished { background: #f3f4f6; color: #6b7280; }

.room-code {
  font-family: 'Courier New', monospace;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #4b5563;
}

.room-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.room-actions .btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* 통계 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  transition: transform 0.2s ease;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 12px;
  opacity: 0.9;
  text-transform: uppercase;
}

/* 로딩 스타일 */
.loading-spinner {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

/* 역할 버튼 활성화 */
.role-btn.active {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  color: white;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.role-btn.manager.active {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border-color: #7c3aed;
  box-shadow: 0 4px 8px rgba(124, 58, 237, 0.3);
}

/* 반응형 */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .room-actions {
    justify-content: center;
  }
}




/* 훈련실 관리자 섹션 스타일_1105추가 */
.manager-controls {
  margin-bottom: 20px;
}

.active-rooms-list {
  margin-bottom: 20px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.room-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.room-card:hover {
  border-color: #2e74e8;
  box-shadow: 0 4px 12px rgba(46, 116, 232, 0.1);
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.room-name {
  font-weight: 600;
  font-size: 16px;
  color: #111827;
}

.room-status {
  background: #10b981;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.room-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.room-detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #374151;
}

.room-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.room-action-btn {
  background: none;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.room-action-btn:hover {
  background: #f3f4f6;
}

.room-action-btn.primary {
  background: #2e74e8;
  color: white;
  border-color: #2e74e8;
}

.room-action-btn.primary:hover {
  background: #1d4ed8;
}

.room-action-btn.danger {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.room-action-btn.danger:hover {
  background: #b91c1c;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.stat-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
}

.manager-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* 관리자 전용 제어 블록 */
.admin-training-controls-block {
  margin-top: 24px;
  padding: 20px;
  background: rgba(12, 16, 28, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}

.admin-controls-header {
  margin-bottom: 16px;
  text-align: center;
}

.admin-controls-header h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #f8f9ff;
  font-weight: 600;
}

.controls-hint {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  font-style: italic;
}

.admin-training-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* 관리자 제어 버튼은 enhanced-control-btn 클래스 사용 (개인 훈련 화면과 동일) */
.admin-training-controls .enhanced-control-btn {
  width: 64px;
  height: 64px;
}

.admin-training-controls .enhanced-control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-training-controls .enhanced-control-btn.hidden {
  display: none;
}

