/* WON-UP 화상회의 (0.34.0) — meeting.js 전용 스타일.
   회의 화면은 어두운 무대(영상 대비)로 고정, 채팅 쪽 카드·배너는 앱 테마 변수를 따른다. */

/* ---- 채팅 쪽: 진행중 배너 ---- */
.meeting-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 6px 12px 0; padding: 8px 12px; border-radius: var(--radius, 10px);
  background: var(--blue-050, #F4F7FC); border: 1px solid var(--blue-200, #BBD3FE);
  color: var(--ink-900, #17181A); font-size: 13px;
}
.meeting-banner.is-hidden { display: none; }
.meeting-banner-txt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.meeting-dot { width: 8px; height: 8px; border-radius: 50%; background: #2FB344; display: inline-block;
  box-shadow: 0 0 0 3px rgba(47, 179, 68, .2); animation: meet-pulse 1.6s infinite; }
.meeting-rec-chip { color: var(--red-700, #C63A1B); font-weight: 600; }
body.theme-dark .meeting-banner { background: #1d2635; border-color: #2f4466; color: #e8edf5; }
@keyframes meet-pulse { 50% { box-shadow: 0 0 0 6px rgba(47, 179, 68, 0); } }

/* ---- 회의 화면(전체) ---- */
.meet {
  position: fixed; inset: 0; z-index: 900; display: grid;
  grid-template-rows: auto 1fr auto; grid-template-columns: 1fr auto;
  grid-template-areas: "top top" "stage side" "bar bar";
  background: #0f1216; color: #eef1f5; font-size: 14px;
}
.meet-top { grid-area: top; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #151a20; border-bottom: 1px solid #232a33; }
.meet-top-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.meet-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.meet-clock, .meet-count { color: #aeb6c2; font-variant-numeric: tabular-nums; }
.meet-conn { color: #ffd43b; }
.meet-conn.is-hidden { display: none; }
.meet-rec { color: #ff8787; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.meet-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #fa5252; display: inline-block; animation: meet-blink 1s steps(2) infinite; }
@keyframes meet-blink { 50% { opacity: .25; } }
.meet-ctl-chip { color: #ff8787; font-weight: 700; }
.meet-ic { background: transparent; border: 1px solid #2d3540; color: #dfe4ea; border-radius: 8px;
  min-width: 34px; height: 32px; padding: 0 8px; cursor: pointer; font-size: 15px; }
.meet-ic:hover { background: #222a33; }

.meet-stage { grid-area: stage; position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 8px; min-height: 0; overflow: hidden; }
.meet-grid { flex: 1; min-height: 0; display: grid; gap: 8px; align-content: center;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-auto-rows: minmax(120px, 1fr); overflow: auto; }
.meet-grid[data-n="1"] { grid-template-columns: 1fr; }
.meet-grid[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.meet-grid[data-n="3"], .meet-grid[data-n="4"] { grid-template-columns: repeat(2, 1fr); }
.meet.has-spot .meet-grid { flex: 0 0 132px; grid-auto-flow: column; grid-template-columns: none;
  grid-auto-columns: 200px; grid-auto-rows: 1fr; overflow-x: auto; overflow-y: hidden; align-content: stretch; }

.meet-tile { position: relative; background: #1b2027; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 110px;
  border: 2px solid transparent; transition: border-color .15s; }
.meet-tile.is-speaking { border-color: #51cf66; }
.meet-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.meet-tile.has-video video { display: block; }
.meet-tile.has-video .meet-av { display: none; }
.meet-tile video.is-mirror { transform: scaleX(-1); }
.meet-av { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff; }
.meet-name { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px;
  border-radius: 6px; background: rgba(0, 0, 0, .55); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 발표(화면공유) 영역 */
.meet-spot { position: relative; flex: 1; min-height: 0; background: #000; border-radius: 12px; overflow: hidden; }
.meet-spot.is-hidden { display: none; }
.meet-spot-wrap { position: absolute; inset: 0; outline: none; }
.meet-spot-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.meet-spot-label { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 6px;
  background: rgba(0, 0, 0, .6); font-size: 12px; pointer-events: none; }
.meet-spot.is-pointer .meet-spot-wrap { cursor: crosshair; }
.meet-spot.is-control { box-shadow: inset 0 0 0 3px #fa5252; }
.meet-spot.is-control .meet-spot-wrap { cursor: default; }
.meet-ptr-layer { position: absolute; inset: 0; pointer-events: none; }
.meet-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.meet-spot.is-pen .meet-spot-wrap { cursor: crosshair; touch-action: none; }
.meet-ptr { position: absolute; transform: translate(-50%, -50%); transition: opacity .4s; }
.meet-ptr.is-idle { opacity: .25; }
.meet-ptr-dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--c, #fa5252);
  border: 2px solid #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .6); }
.meet-ptr-name { position: absolute; left: 14px; top: 12px; white-space: nowrap; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--c, #fa5252); padding: 1px 6px; border-radius: 4px; }
.meet-ptr-ring { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 3px solid var(--c, #fa5252); animation: meet-ring .9s ease-out forwards; }
@keyframes meet-ring { to { transform: scale(4); opacity: 0; } }
.meet-unlock { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; }

/* 하단 조작 막대 */
.meet-bar { grid-area: bar; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #151a20; border-top: 1px solid #232a33; }
.meet-bb { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px;
  padding: 6px 8px; border-radius: 10px; border: 1px solid #2d3540; background: #1d232b; color: #e9edf2;
  cursor: pointer; font-size: 11px; }
.meet-bb:hover:not(:disabled) { background: #26303b; }
.meet-bb:disabled { opacity: .45; cursor: not-allowed; }
.meet-bb.is-active { background: #2b3a52; border-color: #4f8ffd; }
.meet-bb-ic { font-size: 18px; line-height: 1; }
.meet-bb-t { white-space: nowrap; }
.meet-leave { background: #c92a2a; border-color: #c92a2a; color: #fff; font-size: 13px; font-weight: 700; justify-content: center; min-height: 44px; }
.meet-leave:hover { background: #a61e1e !important; }
.meet-end { background: transparent; border-color: #c92a2a; color: #ff8787; font-size: 12px; justify-content: center; min-height: 44px; }

/* 참여자 패널 */
.meet-side { grid-area: side; width: 280px; background: #151a20; border-left: 1px solid #232a33;
  display: flex; flex-direction: column; min-height: 0; }
.meet-side.is-hidden { display: none; }
.meet-side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #232a33; }
.meet-side-list { overflow: auto; padding: 6px 8px; }
.meet-prow { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid #1f262e; }
.meet-prow-av { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.meet-prow-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-prow-st { color: #aeb6c2; font-size: 12px; }
.meet .btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 6px; border: 1px solid #3a4452; background: #222a33; color: #e9edf2; cursor: pointer; }
.meet .btn-danger-ghost { border-color: #8f2d2d; color: #ff8787; }
.meet-audio { display: none; }

/* 작게 보기(대화 계속) */
.meet.is-mini { inset: auto 16px 16px auto; width: 300px; height: 200px; border-radius: 14px; overflow: hidden;
  grid-template-rows: 1fr auto; grid-template-areas: "stage stage" "bar bar"; box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }
.meet.is-mini .meet-top, .meet.is-mini .meet-bar, .meet.is-mini .meet-side { display: none; }
.meet.is-mini .meet-stage { padding: 0; }
.meet.is-mini .meet-grid { gap: 0; grid-template-columns: 1fr !important; grid-auto-rows: 100%; overflow: hidden; }
.meet.is-mini .meet-tile:not(.is-speaking) ~ .meet-tile:not(.is-speaking) { display: none; }
.meet.is-mini.has-spot .meet-grid { display: none; }
.meet-mini-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.meet-mini-t { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meet-mini-leave { border-color: #c92a2a; color: #ff8787; }
body.in-meeting { overflow: hidden; }

/* 참여 전 창 · 화면 선택창 */
.meet-modal-ov { position: fixed; inset: 0; z-index: 950; background: rgba(10, 12, 16, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.meet-modal { width: min(440px, 100%); background: var(--surface, #fff); color: var(--ink-900, #17181A);
  border-radius: var(--radius-lg, 14px); padding: 18px; box-shadow: var(--shadow-md, 0 8px 28px rgba(0,0,0,.2)); }
.meet-modal-title { margin: 0 0 4px; font-size: 17px; }
.meet-modal-sub { margin: 0 0 12px; color: var(--ink-500, #6E6F76); font-size: 13px; }
.meet-modal-note { margin: 12px 0 0; color: var(--ink-500, #6E6F76); font-size: 12px; }
.meet-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.meet-check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
/* 체크박스가 대화상자 공통 input 너비(100%)를 받아 글자와 멀리 떨어지던 문제(10/14 PC 앱 실기) */
.meet-check input[type=checkbox] { width: auto; flex: 0 0 auto; margin: 0; }
.meet-picker { width: min(760px, 100%); }
.meet-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.meet-pick { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border, #DCDCE1); background: var(--surface-1, #F7F7F8); color: inherit; text-align: left; }
.meet-pick:hover, .meet-pick:focus { border-color: var(--blue-600, #3563B4); outline: none; }
.meet-pick img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 6px; }
.meet-pick-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.theme-dark .meet-modal { background: #1d2127; color: #e9edf2; }
body.theme-dark .meet-pick { background: #262b33; border-color: #353c46; }

/* ---- 채팅 쪽: 녹화 카드 ---- */
.rec-card { margin-top: 6px; padding: 10px 12px; border-radius: var(--radius, 10px); max-width: 420px;
  border: 1px solid var(--border, #DCDCE1); background: var(--surface, #fff); }
.rec-card.is-deleted { color: var(--ink-500, #6E6F76); background: var(--surface-1, #F7F7F8); }
.rec-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rec-card-title { font-weight: 700; }
.rec-card-meta { color: var(--ink-500, #6E6F76); font-size: 12px; }
.rec-card-player { margin-bottom: 8px; }
.rec-video { width: 100%; max-height: 300px; border-radius: 8px; background: #000; }
.rec-card-acts { display: flex; gap: 6px; }
.rec-card .btn-xs { padding: 2px 8px; font-size: 12px; }
body.theme-dark .rec-card { background: #1d2127; border-color: #333a44; }

/* ---- 모바일 ---- */
@media (max-width: 720px) {
  .meet { grid-template-columns: 1fr; grid-template-areas: "top" "stage" "bar"; }
  .meet-side { position: absolute; inset: 48px 0 70px 0; width: auto; z-index: 5; }
  .meet-grid { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: minmax(120px, 34vh); }
  .meet-grid[data-n="1"] { grid-template-columns: 1fr !important; grid-auto-rows: 1fr; }
  .meet-bb { min-width: 52px; padding: 6px 4px; }
  .meet-bb-t { display: none; }
  .meet-title { max-width: 46vw; }
  .meet.is-mini { width: 190px; height: 130px; right: 10px; bottom: 76px; }
}

/* SVG 아이콘(툴바) */
.meet-svg { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.meet-svg svg { width: 20px; height: 20px; }
.meet-ic .meet-svg svg { width: 18px; height: 18px; }
.meet-prow-st .meet-svg svg { width: 15px; height: 15px; }
.meet-prow-st { display: inline-flex; gap: 4px; }

/* 일정(에이전다) 행의 [화상회의] 버튼 */
.cal-list-item .cal-li-meet { margin-left: auto; align-self: center; flex: none; }

/* 대화방 '내 화면 공유' 작은 막대 */
/* 공유 중: 글은 윗줄(한 줄), 버튼은 아랫줄 오른쪽 — 330px 작은 창에서 글이 한 글자씩 꺾이고 [나가기]가 잘리던 문제 */
.meet-mini-bar.is-sharing { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
.meet-mini-bar.is-sharing .meet-mini-t { flex: 1 0 100%; }
.meet-mini-bar.is-sharing .meet-mini-t { color: #ffb4b6; font-weight: 600; }
.meet-mini-stop { background: #e5484d; color: #fff; border-color: #e5484d; }
.meet-mini-stop:hover { background: #c93a3f; }

/* 화상회의·화면 공유 요청(받는 쪽) — 오른쪽 아래 카드 */
.meet-invite { position: fixed; right: 20px; bottom: 20px; z-index: 9500; width: min(360px, calc(100vw - 32px));
  background: var(--surface, #fff); color: var(--text, #111); border: 1px solid var(--border, #d7dce3); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 16px; animation: meetInviteIn .18s ease-out; }
@keyframes meetInviteIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.meet-invite-t { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.meet-invite-sub { font-size: 14px; line-height: 1.45; margin-bottom: 12px; word-break: keep-all; }
.meet-invite-act { display: flex; gap: 8px; justify-content: flex-end; }
.meet-invite-act .btn { min-width: 72px; }
/* 기록 메시지 아래 [예] */
.meet-msg-join { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.meet-msg-join-q { font-size: 13px; color: var(--text-muted, #667085); }

/* 화면 공유 선택 창(내 화면 공유 / 상대 화면 보기 요청) */
.meet-share-menu { display: flex; flex-direction: column; gap: 10px; }
.meet-share-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border, #d7dce3); border-radius: 12px; background: var(--surface, #fff);
  color: inherit; cursor: pointer; }
.meet-share-opt:hover:not([disabled]) { border-color: #4f8ffd; background: rgba(79, 143, 253, .06); }
.meet-share-opt-t { font-weight: 700; font-size: 15px; }
.meet-share-opt-d { font-size: 13px; color: var(--text-muted, #667085); line-height: 1.4; word-break: keep-all; }
.meet-share-opt.is-disabled { opacity: .55; cursor: not-allowed; }
