/* ==========================================================================
   Trade Titans Meet — shared styles
   ========================================================================== */

:root {
  --navy-900: #0b1220;
  --navy-800: #101a2e;
  --navy-700: #16233d;
  --navy-600: #1f3054;
  --ink: #0f172a;
  --text: #e8edf7;
  --text-dim: #9fb0cc;
  --gold: #e8b23a;
  --gold-strong: #d99a14;
  --blue: #3b82f6;
  --danger: #e5484d;
  --ok: #30a46c;
  --surface: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(4, 10, 24, 0.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--navy-900);
}

button { font-family: inherit; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-strong) 100%);
  color: var(--navy-900);
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(232, 178, 58, 0.35);
}

.brand .word em {
  color: var(--gold);
  font-style: normal;
}

.header-note {
  color: var(--text-dim);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Landing page
   -------------------------------------------------------------------------- */

.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(900px 420px at 5% 110%, rgba(232, 178, 58, 0.12), transparent 60%),
    var(--navy-900);
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.hero h1 .accent { color: var(--gold); }

.hero p.sub {
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 30px;
  max-width: 46ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-strong) 100%);
  color: #1a1206;
  box-shadow: 0 6px 20px rgba(232, 178, 58, 0.35);
}

.btn-primary:hover { box-shadow: 0 8px 26px rgba(232, 178, 58, 0.5); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.join-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 4px 4px 4px 14px;
}

.join-inline input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
  width: 180px;
}

.join-inline input::placeholder { color: var(--text-dim); }

.join-inline .btn { padding: 10px 16px; }

.error-line {
  color: #ff9598;
  font-size: 13.5px;
  min-height: 18px;
  margin-top: 12px;
}

/* Feature list under hero copy */

.features {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  padding: 0;
  list-style: none;
  color: var(--text-dim);
  font-size: 14px;
}

.features li { display: flex; align-items: center; gap: 9px; }

.features .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

/* Preview card on the right */

.preview-card {
  background: var(--navy-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-tile {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--navy-700), var(--navy-600));
  position: relative;
  overflow: hidden;
}

.preview-tile .avatar {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: var(--navy-900);
}

.preview-tile .name-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11px;
  color: var(--text);
  background: rgba(4, 10, 24, 0.55);
  padding: 3px 8px;
  border-radius: 6px;
}

.preview-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 16px;
}

.preview-bar span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.preview-bar span.red { background: var(--danger); }

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
  padding: 18px;
}

/* --------------------------------------------------------------------------
   Lobby
   -------------------------------------------------------------------------- */

.lobby {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.lobby-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 28px 60px;
}

.video-preview {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--navy-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow);
}

.video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.video-preview .cam-off-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 15px;
}

.preview-controls {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.lobby-form h2 { margin: 0 0 6px; font-size: 26px; }

.lobby-form .room-code {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 26px;
}

.lobby-form .room-code b { color: var(--gold); font-weight: 600; }

.lobby-form label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.lobby-form input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  margin-bottom: 18px;
}

.lobby-form input[type="text"]:focus { border-color: var(--gold); }

.participants-note {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 14px;
  min-height: 18px;
}

/* --------------------------------------------------------------------------
   Meeting room
   -------------------------------------------------------------------------- */

.room {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(4, 10, 24, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex: none;
}

.room-topbar .brand { font-size: 15px; }
.room-topbar .brand .logo { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }

.room-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 13px;
}

.room-meta .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 255, 255, 0.07);
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--text);
}

.copy-link-btn {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
}

.copy-link-btn:hover { background: rgba(255, 255, 255, 0.12); }

.room-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.stage {
  flex: 1;
  padding: 14px;
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: center;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
}

.tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--navy-800);
  border: 2px solid transparent;
  aspect-ratio: 16 / 10;
  transition: border-color 0.15s ease;
}

.tile.speaking { border-color: var(--gold); }

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--navy-800);
}

.tile.mirrored video { transform: scaleX(-1); }

.tile .avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.tile .avatar-fallback .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
}

.tile .name-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  background: rgba(4, 10, 24, 0.6);
  padding: 4px 10px;
  border-radius: 8px;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile .name-tag .mic-off { color: var(--danger); font-size: 12px; }
.tile .badge-screen {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  background: rgba(48, 164, 108, 0.85);
  color: #fff;
  padding: 3px 9px;
  border-radius: 7px;
}

/* Chat panel */

.chat-panel {
  width: 320px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--navy-800);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-panel.hidden { display: none; }

.chat-header {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header button {
  background: none;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg { font-size: 13.5px; line-height: 1.45; }
.chat-msg .who { font-weight: 600; color: var(--gold); margin-right: 6px; }
.chat-msg .when { color: var(--text-dim); font-size: 11px; margin-left: 6px; }
.chat-msg.system { color: var(--text-dim); font-style: italic; font-size: 12.5px; }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
}

.chat-input input:focus { border-color: var(--gold); }

.chat-input button {
  border: 0;
  border-radius: 10px;
  background: var(--gold);
  color: #1a1206;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}

/* Control bar */

.control-bar {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(4, 10, 24, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ctrl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  transition: background 0.15s ease;
  position: relative;
}

.ctrl:hover { background: rgba(255, 255, 255, 0.16); }
.ctrl.off { background: var(--danger); color: #fff; }
.ctrl.active { background: var(--ok); color: #fff; }
.ctrl.leave { background: var(--danger); color: #fff; width: 66px; border-radius: 28px; }
.ctrl.leave:hover { background: #d13438; }

.ctrl .tip {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(4, 10, 24, 0.9);
  color: var(--text);
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.ctrl:hover .tip { opacity: 1; }

.ctrl .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--gold);
  color: #1a1206;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(4, 10, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.toast.show { opacity: 1; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero, .lobby-main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 40px;
  }
  .preview-card { display: none; }
  .chat-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    width: min(320px, 88vw);
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.4);
  }
}
