:root {
  --bg: #e8f3ff;
  --card: rgba(255,255,255,0.82);
  --line: rgba(255,255,255,0.32);
  --primary: #348df7;
  --primary-dark: #1768c2;
  --soft: #dff0ff;
  --text: #11345e;
  --muted: #5d7ea8;
  --surface-dark: #0d1f3c;
  --surface-dark-2: #132a4d;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

.bg-app {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(116, 191, 255, 0.42), transparent 30%),
    radial-gradient(circle at bottom right, rgba(76, 143, 255, 0.3), transparent 32%),
    linear-gradient(135deg, #eff7ff 0%, #dcebff 50%, #f8fbff 100%);
}

.min-vh-100 {
  min-height: 100vh;
}

.glass-card {
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.hero-panel {
  position: relative;
  min-height: 480px;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,0.88), rgba(217,237,255,0.88));
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 20px 70px rgba(24, 69, 132, 0.14);
}

.hero-content {
  z-index: 2;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
}

.orb-1 {
  width: 220px;
  height: 220px;
  top: -60px;
  right: -20px;
  background: rgba(73, 157, 255, 0.25);
}

.orb-2 {
  width: 180px;
  height: 180px;
  bottom: -50px;
  left: -30px;
  background: rgba(154, 223, 255, 0.35);
}

.timeline-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.timeline-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(113, 186, 255, 0.28);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(52, 105, 174, 0.08);
}

.soft-info {
  padding: 10px 14px;
  border-radius: 999px;
  background: #edf6ff;
  color: var(--muted);
  font-size: 0.92rem;
}

.generated-room-box {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #edf7ff, #d7ebff);
}

.generated-room-id {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.error-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffe8e8;
  color: #d94242;
  font-size: 2rem;
  font-weight: 800;
}

.animate-float {
  animation: floatY 6s ease-in-out infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.room-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(87, 167, 255, 0.3), transparent 30%),
    linear-gradient(135deg, #082142, #0d2d5c 48%, #133b71 100%);
}

.room-shell {
  min-height: 100vh;
}

.prejoin-section {
  min-height: 100vh;
}

.preview-card,
.side-card {
  border-radius: 28px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
}

.preview-stage {
  position: relative;
  min-height: 560px;
  background: linear-gradient(180deg, rgba(4, 20, 47, 0.55), rgba(9, 28, 61, 0.7));
}

#previewCanvas {
  width: 100%;
  height: 560px;
  display: block;
  background: linear-gradient(135deg, #132e54, #0f2445);
}

.preview-overlay {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.88rem;
  border: 1px solid rgba(255,255,255,0.12);
}

.preview-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.btn-soft {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
  color: white;
  border-radius: 14px;
}

.btn-soft:hover {
  background: rgba(255,255,255,0.18);
  color: white;
}

.audio-meter-wrap {
  width: 220px;
}

.audio-meter {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.12);
}

.audio-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #79cfff, #2d8fff);
  transition: width 100ms linear;
}

.side-card {
  padding: 22px;
}

.bg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bg-option {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bg-option img,
.bg-option .bg-none {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
}

.bg-option .bg-none {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
}

.bg-option.active {
  border-color: #8fd0ff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 123, 214, 0.24);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: white;
}

.summary-item span {
  color: rgba(255,255,255,0.66);
}

.meeting-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.meeting-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(8, 22, 46, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
}

.meeting-topbar-left,
.meeting-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meeting-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-weight: 700;
}

.meeting-room-meta {
  display: flex;
  flex-direction: column;
  color: white;
}

.meeting-room-meta span {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
}

.meeting-main {
  position: relative;
  flex: 1;
  min-height: calc(100vh - 74px);
}

.jitsi-container {
  width: 100%;
  height: calc(100vh - 74px);
  background: #061629;
}

.participant-sidebar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: calc(100% - 32px);
  border-radius: 28px;
  background: rgba(8, 20, 42, 0.82);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.participant-sidebar.is-collapsed {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

.participant-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.participant-sidebar-body {
  padding: 18px;
  overflow: auto;
}

.participant-list {
  display: grid;
  gap: 12px;
}

.participant-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  color: white;
}

.participant-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.participant-name {
  font-weight: 700;
}

.participant-role {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.58);
}

.participant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-actions .btn {
  border-radius: 12px;
  font-size: 0.82rem;
}

.participant-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.66);
  text-align: center;
}

code {
  color: #205eac;
}

.room-body code {
  color: #8ed0ff;
}

@media (max-width: 1199px) {
  .preview-stage,
  #previewCanvas {
    min-height: 420px;
    height: 420px;
  }
}

@media (max-width: 991px) {
  .preview-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .audio-meter-wrap {
    width: 100%;
  }

  .participant-sidebar {
    width: 100%;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 0;
  }

  .meeting-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .meeting-topbar-left,
  .meeting-topbar-right {
    justify-content: space-between;
  }
}

@media (max-width: 767px) {
  .hero-panel {
    min-height: auto;
  }

  .bg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-stage,
  #previewCanvas {
    min-height: 300px;
    height: 300px;
  }
}
