/* [2026-11-18] 화면에 없는 id 규칙 정리: #answer-status (지운 기능의 CSS는 같이 지움) */
/* [2026-11-17 #8 CSS 정리] 화면·스크립트·서버 어디에서도 쓰지 않는 클래스 14개의 규칙 삭제:
   cancel-btn, auth-form, room-actions, room-item, owner-badge, option-btn, answer-status-item, incorrect, results-container, final-results-container, participants-results, final-results-table, return-buttons, waiting-text
   (조합으로 만드는 이름 status-{{status}} 등은 확인 후 남김) */
/* ===== CSS 변수 (다크모드 준비) ===== */
/* ========================================================================
   [2026-11-17 #8 CSS 정리] 색 팔레트 — 여러 곳에서 쓰는 색에 이름을 붙임
   왜: 같은 색(예: #6c63ff 23곳)이 CSS 곳곳에 직접 적혀 있어서, 색을 바꾸려면 파일마다 찾아 고쳐야 했다.
     이제 CSS 파일들은 var(--purple-500)처럼 이 이름을 쓰고, 색 값은 여기 한 곳에만 있다.
   이름 규칙: --계열-밝기 (계열: gray·red·orange·yellow·green·teal·blue·indigo·purple·pink,
     밝기: 10(가장 밝음)~990(가장 어두움), 100에서 밝기(%)를 뺀 값×10). 같은 칸에 색이 둘 이상이면 -2, -3을 붙임.
   ⚠ 이 팔레트는 다크 모드에서 바뀌지 않는다 (예전 직접 적은 색과 같은 동작, 화면 그대로).
     다크 모드에 따라 바뀌어야 하는 색은 아래 :root / [data-theme="dark"]의 테마 변수(--bg-*, --text-*, --brand-*)를 쓸 것.
     UI를 바꿀 때 여기 값을 고치거나, 테마 변수로 옮기면 된다.
   상태 색(성공·오류·경고·안내)은 테마 변수 --color-success / --color-error / --color-warning / --color-info를 씀.
   한 번만 쓰인 색과 투명도가 있는 rgba 색은 각 파일에 그대로 둠.
   [2026-11-20 CSS 정리] 2026-11-18 전면 개편으로 화면들이 새 색 이름(ui.css --qb-*)을 쓰게 되면서 아무 데서도 안 쓰게 된
     팔레트 색 57개와 테마 변수 13개(--bg-primary·--bg-tertiary·--bg-overlay·--text-secondary·--text-muted·--brand-light·
     --brand-lighter·--brand-border·--brand-blue·--brand-blue-light·--color-info·--shadow-md·--shadow-lg, 다크 모드 쪽 포함) 삭제.
     옆의 "N곳"은 이날 다시 센 실제 쓰임 수. 새 화면을 만들 때는 이 팔레트 말고 ui.css의 --qb-* 를 쓸 것.
   ======================================================================== */
:root {
  --blue-20: #f8f9fa;          /* 2곳 */
  --gray-20: #f9f9f9;          /* 1곳 */
  --gray-40: #f5f5f5;          /* 3곳 */
  --gray-60: #f0f0f0;          /* 1곳 */
  --gray-120: #e0e0e0;         /* 3곳 */
  --gray-130: #dddddd;         /* 8곳 */
  --gray-400: #999999;         /* 1곳 */
  --gray-470: #888888;         /* 2곳 */
  --gray-540: #6c757d;         /* 1곳 */
  --gray-600: #666666;         /* 2곳 */
  --gray-670: #555555;         /* 1곳 */
  --gray-800: #333333;         /* 5곳 */
  --indigo-310: #6c63ff;       /* 2곳 */
  --purple-500: #6d28d9;       /* 1곳 */
  --white: #ffffff;            /* 4곳 */
}

:root {
  /* 배경 */
  --bg-secondary: #f8f9ff;
  --bg-card: #ffffff;

  /* 텍스트 */
  --text-primary: #333333;
  --text-light: #ffffff;

  /* 브랜드 (퍼플 계열 — 다크모드에서도 유지) */
  --brand-primary: #5e35b1;
  --brand-secondary: #7e57c2;
  --brand-lightest: #f5f0ff;

  /* 테두리 */
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;

  /* 상태 색상 (다크모드에서도 유지) */
  --color-success: #4caf50;
  --color-error: #f44336;
  --color-warning: #ff9800;

  /* 그림자 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  /* 배경 */
  --bg-secondary: #16213e;
  --bg-card: #1e1e30;

  /* 텍스트 */
  --text-primary: #e8e8f0;
  --text-light: #ffffff;

  /* 브랜드 — 다크모드에서도 퍼플 유지 */
  --brand-primary: #7e57c2;
  --brand-secondary: #9f7aea;
  --brand-lightest: #2a1f4e;

  /* 테두리 */
  --border-color: #2a2a4e;
  --border-light: #1e1e3a;

  /* 상태 색상 — 유지 */
  --color-success: #4caf50;
  --color-error: #f44336;
  --color-warning: #ff9800;

  /* 그림자 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* [2026-11-18 새 디자인] 다크모드 전환 버튼(#theme-toggle) 모양은 public/css/ui.css .qb-theme-toggle로 옮김 */

/* 기본 스타일 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 20px;
}

h1, h2, h3 {
  margin-bottom: 15px;
}

/* [2026-11-18 새 디자인] 옛 기본 버튼 모양이 새 부품(class에 "qb-"가 든 버튼)에는 걸리지 않게 함.
   왜: 이 규칙의 오른쪽 여백 5px과, 마우스를 올리면 배경을 바꾸는 button:hover가 새 버튼(.qb-btn 등)을 덮어썼다.
   :where(...)는 우선순위를 더하지 않아서 옛 화면에서는 예전과 똑같이 동작함 (button 0,0,1 / button:hover 0,1,1 그대로).
   옛 화면을 모두 새 디자인으로 바꾸면 이 두 규칙은 지울 것 */
button:where(:not([class*="qb-"])) {
  padding: 8px 15px;
  background-color: var(--brand-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 5px;
}

button:where(:not([class*="qb-"])):hover {
  background-color: var(--brand-secondary);
}

/* 로그인/회원가입 폼 */

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.form-actions {
  margin-top: 20px;
  text-align: right;
}

/* 방 목록 */

#room-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

/* 방 페이지 */
.room-content {
  display: flex;
  gap: 20px;
}

.sidebar {
  width: 30%;
  background-color: var(--bg-card);
  border-radius: 5px;
  box-shadow: var(--shadow-sm);
  padding: 15px;
}

.quiz-area {
  width: 70%;
  background-color: var(--bg-card);
  border-radius: 5px;
  box-shadow: var(--shadow-sm);
  padding: 15px;
  min-height: 500px;
}

.participant {
  padding: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* 퀴즈 관련 스타일 */
.question-container {
  text-align: center;
}

.question-content {
  margin: 20px 0;
}

.question-media {
  max-width: 100%;
  max-height: 300px;
  margin: 15px 0;
  border-radius: 5px;
}

.options-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

/* 답변 상태 */

.correct {
  color: var(--color-success);
}

/* 결과 화면 */

.winner {
  background-color: var(--brand-lightest);
  font-weight: bold;
} 
.answers-tag-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--gray-130);
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 42px;
  background: var(--white);
  cursor: text;
}
.answers-tag-box:focus-within { border-color: var(--indigo-310); box-shadow: 0 0 0 2px rgba(108,99,255,0.15); }
.answers-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.answer-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--indigo-310);
  color: var(--white);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 500;
}
.answer-tag .tag-remove {
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  opacity: 0.8;
}
.answer-tag .tag-remove:hover { opacity: 1; }
.answers-tag-input {
  border: none;
  outline: none;
  font-size: 14px;
  min-width: 120px;
  flex: 1;
  background: transparent;
}

/* ========================================================================
   [2026-11-17 #8 CSS 정리] 여러 페이지가 같이 쓰는 애니메이션
   예전에는 같은 내용이 페이지 CSS마다 복사돼 있었다:
     spin: admin.css, login.css, room.css
     float: index.css, join.css, quizzes.css
     fadeIn: index.css, lobby.css, user-question-manage.css
   모양이 다른 변형(예: lobby.css의 spin)은 그 페이지 파일에 남아 있고, 페이지 파일이 이 파일보다 나중에 불러와져서 변형이 적용된다.
   ======================================================================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* [2026-11-17 UI 준비] error-handler.js가 만드는 화면 위쪽 오류 안내 상자 (모든 페이지).
   예전에는 스크립트가 style.cssText로 직접 넣었음. 로그인 화면에도 id="error-message"인 자체 오류 칸이 있어서
   id가 아닌 이 상자만의 클래스(global-error-toast)로 지정함 (로그인 화면 칸 모양은 login.css 그대로) */
.error-message.global-error-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-error);
  color: white;
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  max-width: 80%;
  text-align: center;
  font-weight: bold;
}
