/* ================= Google Meet replica — base + room styles ================= */
:root {
  --gm-blue: #1a73e8;
  --gm-blue-hover: #1b66c9;
  --gm-blue-soft: #e8f0fe;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --bg: #ffffff;
  --soft: #f1f3f4;
  --danger: #ea4335;
  --danger-dark: #d93025;
  --room-bg: #202124;
  --room-tile: #3c4043;
  --lobby-green: #00796b;
  font-family: 'Google Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: inherit; }
a { color: var(--gm-blue); }
svg.i { width: 22px; height: 22px; fill: currentColor; flex: none; }
.muted { color: var(--muted); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 28px 0 18px; }

/* ---------- Buttons & inputs (Material style) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 4px; padding: 10px 22px;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s;
}
.btn-primary { background: var(--gm-blue); color: #fff; }
.btn-primary:hover { background: var(--gm-blue-hover); box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.btn-ghost { background: #fff; color: var(--gm-blue); border-color: var(--line); }
.btn-ghost:hover { background: var(--gm-blue-soft); border-color: #d2e3fc; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 4px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: #fff; outline: none;
}
.input:focus { border-color: var(--gm-blue); box-shadow: inset 0 0 0 1px var(--gm-blue); }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 14px 0 4px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.err { color: var(--danger-dark); font-size: 13px; margin-top: 10px; min-height: 18px; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 50%; color: inherit; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(60,64,67,.1); }

/* Google snackbar */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(16px);
  background: #323232; color: #fff; padding: 12px 18px; border-radius: 4px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 100; box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Modal (Material dialog) ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(32,33,36,.55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 28px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; padding: 24px; animation: gmPop .16s ease-out; }
.modal h2 { margin: 0 0 6px; font-size: 22px; font-weight: 400; color: var(--ink); }
.modal .sub { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
@keyframes gmPop { from { transform: scale(.96); opacity: 0; } }

/* ---------- Invitation card ---------- */
.invite-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.invite-head { background: var(--gm-blue-soft); color: #174ea6; padding: 18px 22px; }
.invite-head small { opacity: .85; font-size: 12px; letter-spacing: .3px; text-transform: uppercase; }
.invite-head h3 { margin: 4px 0 0; font-size: 20px; font-weight: 400; }
.invite-body { padding: 14px 22px 20px; }
.meta { display: flex; gap: 14px; align-items: flex-start; padding: 9px 0; font-size: 14px; color: var(--ink); }
.meta svg { color: var(--muted); margin-top: 1px; }
.meta .muted { color: var(--muted); font-size: 13px; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 8px; padding: 8px 8px 8px 14px; margin-top: 8px; }
.link-box code { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.share-grid .btn { border-radius: 999px; font-size: 13px; padding: 9px 14px; }
.pin-big { font-size: 20px; font-weight: 500; letter-spacing: .06em; color: var(--ink); margin-top: 2px; }

/* Invitation page */
.invite-page { max-width: 560px; margin: 24px auto 60px; padding: 0 16px; }
.countdown { text-align: center; padding: 12px; background: var(--gm-blue-soft); color: #174ea6; border-radius: 8px; font-weight: 500; margin-top: 14px; }

/* ================= Meeting room (Google Meet look) ================= */
body.room { background: var(--room-bg); color: #e8eaed; overflow: hidden; }

/* ----- Lobby: Google Meet green room ----- */
.lobby {
  min-height: 100%;
  background: radial-gradient(120% 120% at 50% 0%, #009384 0%, var(--lobby-green) 52%, #00564e 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 24px 24px 130px;
}
.lobby-inner { display: flex; gap: 48px; align-items: center; max-width: 1080px; width: 100%; justify-content: center; flex-wrap: wrap; }
.preview { position: relative; width: min(620px, 100%); aspect-ratio: 16/9; background: rgba(0,0,0,.25); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 34px rgba(0,0,0,.28); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .avatar-big { position: absolute; inset: 0; display: none; place-items: center; }
.preview.cam-off .avatar-big { display: grid; }
.lobby-side { max-width: 380px; min-width: 280px; flex: 0 1 380px; }
.lobby h1 { font-size: 28px; font-weight: 400; color: #fff; margin: 0 0 6px; }
.lobby .muted { color: rgba(255,255,255,.85); font-size: 14px; margin-bottom: 20px; min-height: 18px; }
.lobby .input { background: #fff; border: 0; border-radius: 4px; padding: 13px 14px; }
.lobby-actions { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gm-join-now { border-radius: 24px !important; height: 48px; padding: 0 34px !important; font-size: 15px !important; }
.gm-lobby-link { color: #fff; font-size: 14px; text-decoration: none; opacity: .9; display: inline-block; margin-top: 14px; }
.gm-lobby-link:hover { text-decoration: underline; }
.lobby-pin { margin-top: 18px; font-size: 13px; }
.lobby-pin b { color: #fff; font-size: 18px; font-weight: 500; letter-spacing: .08em; margin-left: 8px; }
.lobby .err { color: #ffc9c5; }
.preview-ctrls { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; gap: 18px; z-index: 5; }
.preview-ctrls .ctrl { width: 56px; height: 56px; background: rgba(255,255,255,.14); }
.preview-ctrls .ctrl:hover { background: rgba(255,255,255,.28); }
.preview-ctrls .ctrl.off { background: #fff; color: var(--danger); }
.preview-ctrls .ctrl svg { width: 26px; height: 26px; }

/* ----- Meeting room ----- */
.room-ui { display: none; height: 100%; flex-direction: column; }
.room-ui.active { display: flex; }
.stage { flex: 1; display: flex; min-height: 0; padding: 16px 12px 0; gap: 12px; }
.grid { flex: 1; display: grid; gap: 8px; align-content: center; min-width: 0; }
.tile { position: relative; background: var(--room-tile); border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; max-height: 100%; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s; }
.tile.speaking { outline-color: #fff; }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #202124; }
.tile.local video.mirror { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: var(--room-tile); }
.tile.cam-off .avatar { display: grid; }
.avatar-circle { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; font-weight: 500; color: #fff; }
.tile .name { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 4px; font-size: 12.5px; color: #fff; }
.tile .name svg { width: 14px; height: 14px; }
.tile .badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.badge { background: rgba(0,0,0,.55); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-size: 16px; }
.badge.muted-mic { color: #ff8a8e; }
.badge svg { width: 16px; height: 16px; }
.float-emoji { position: absolute; bottom: 20px; font-size: 42px; animation: floatUp 2.4s ease-out forwards; pointer-events: none; }
@keyframes floatUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-220px); opacity: 0; } }

/* ----- Side panel (people / chat / meeting details) ----- */
.side { width: 360px; background: #fff; color: var(--ink); border-radius: 12px 0 0 12px; display: none; flex-direction: column; overflow: hidden; }
.side.open { display: flex; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 8px 10px 20px; font-size: 16px; font-weight: 500; }
.side-body { flex: 1; overflow: auto; padding: 0 20px 16px; }
.person { display: flex; gap: 14px; align-items: center; padding: 9px 0; }
.person .avatar-circle { width: 36px; height: 36px; font-size: 14px; }
.person .who { flex: 1; font-size: 14px; }
.person .who small { display: block; color: var(--muted); font-size: 12px; }
.person .icons { display: flex; gap: 4px; color: var(--muted); }
.person .icons svg { width: 18px; height: 18px; }
.msg { margin-bottom: 14px; }
.msg .h { font-size: 13px; font-weight: 500; }
.msg .h span { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 12px; }
.msg .t { font-size: 14px; margin-top: 3px; white-space: pre-wrap; word-wrap: break-word; }
.chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: center; }
.chat-form .input { border-radius: 999px; background: var(--soft); border-color: transparent; }
.chat-form .icon-btn { color: var(--gm-blue); }
.note { font-size: 12px; color: var(--muted); background: var(--soft); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }

/* ----- Bottom control bar ----- */
.bar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.bar-left { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-title { font-size: 14px; color: #e8eaed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.bar-pin { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #e8eaed; background: rgba(255,255,255,.08); border-radius: 4px; padding: 4px 10px; white-space: nowrap; }
.bar-pin svg { width: 13px; height: 13px; opacity: .8; }
.bar-center { display: flex; gap: 4px; align-items: center; }
.bar-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-clock { font-size: 14px; color: #e8eaed; margin-right: 12px; font-weight: 500; }
.ctrl { width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: transparent; color: #fff; transition: background .15s; position: relative; }
.ctrl:hover { background: var(--room-tile); }
.ctrl.off { background: var(--danger); }
.ctrl.on { background: #8ab4f8; color: #202124; }
.ctrl.leave { background: var(--danger); width: 68px; height: 48px; border-radius: 999px; }
.ctrl.leave:hover { background: #c5221f; }
.ctrl .dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #8ab4f8; display: none; }
.ctrl .dot.show { display: block; }
.bar-right .ctrl:hover { background: var(--room-tile); }
.bar-right .ctrl.on { background: #8ab4f8; color: #202124; }

/* Reactions */
.reactions { position: absolute; bottom: 86px; left: 50%; transform: translateX(-50%); background: #3c4043; border-radius: 999px; padding: 6px 10px; display: none; gap: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.reactions.open { display: flex; }
.reactions button { font-size: 26px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 50%; }
.reactions button:hover { background: rgba(255,255,255,.12); }

/* ----- Update dialog (Google style) ----- */
.gm-dialog-bg { position: fixed; inset: 0; background: rgba(32,33,36,.6); display: none; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.gm-dialog-bg.open { display: flex; }
.gm-dialog { background: #fff; color: var(--ink); border-radius: 28px; width: 100%; max-width: 400px; padding: 28px 24px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.4); text-align: center; animation: gmPop .16s ease-out; }
.gm-dialog-logo { display: grid; place-items: center; margin-bottom: 12px; }
.gm-dialog-logo svg { width: 52px; height: 43px; }
.gm-dialog h2 { margin: 0 0 8px; font-size: 22px; font-weight: 400; }
.gm-dialog p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.gm-dialog-actions { display: flex; justify-content: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.gm-btn-text { border: 0; background: none; color: var(--gm-blue); font-family: inherit; font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.gm-btn-text:hover { background: var(--gm-blue-soft); }
.gm-btn-fill { border: 0; background: var(--gm-blue); color: #fff; font-family: inherit; font-size: 14px; font-weight: 500; padding: 10px 26px; border-radius: 999px; cursor: pointer; }
.gm-btn-fill:hover { background: var(--gm-blue-hover); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ----- Ended screen ----- */
.ended { display: none; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 16px; background: radial-gradient(120% 120% at 50% 0%, #009384 0%, var(--lobby-green) 52%, #00564e 100%); }
.ended.active { display: flex; }
.ended h1 { font-weight: 400; color: #fff; font-size: 28px; margin: 0; }
.ended .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.ended .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.7); }

@media (max-width: 860px) {
  .side { position: fixed; inset: 0 0 72px 0; width: auto; border-radius: 0; z-index: 30; }
  .bar-left, .bar-clock { display: none; }
  .bar { padding: 0 6px; }
  .bar-center { gap: 2px; }
  .ctrl { width: 44px; height: 44px; }
  .ctrl.leave { width: 56px; }
}


