:root {
  --bg-dark: #090d16;
  --bg-panel: #111726;
  --bg-card: #172033;
  --bg-card-hover: #1e2a42;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --cyan: #06b6d4;
  --emerald: #10b981;
  --indigo: #818cf8;
  --amber: #f59e0b;
  --rose: #f43f5e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(129, 140, 248, 0.2);
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.join-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 2rem;
}

.meeting-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.meeting-input:focus {
  border-color: var(--indigo);
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.mode-card.selected {
  background: var(--bg-card-hover);
}

.mode-card:hover {
  background: var(--bg-card-hover);
}

.mode-card.mode-conversation.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.mode-card.mode-observer.selected {
  border-color: var(--emerald);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.mode-card.mode-both.selected {
  border-color: var(--indigo);
  box-shadow: 0 0 15px rgba(129, 140, 248, 0.2);
}

.mode-icon {
  font-size: 2rem;
}

.mode-title {
  font-weight: 600;
}

.mode-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.join-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--indigo), #4f46e5);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.join-btn:not(:disabled):hover {
  opacity: 0.9;
}

.spinner {
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 3px solid white;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.status-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
  display: none;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-creating { background: rgba(245, 158, 11, 0.2); color: var(--amber); }
.status-joining { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }
.status-in_waiting_room { background: rgba(129, 140, 248, 0.2); color: var(--indigo); }
.status-active { background: rgba(16, 185, 129, 0.2); color: var(--emerald); }
.status-failed, .status-error { background: rgba(244, 63, 94, 0.2); color: var(--rose); }

.status-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-danger {
  padding: 0.75rem 1.5rem;
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.2);
}

.sessions-section {
  width: 100%;
  max-width: 800px;
}

.sessions-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.sessions-list {
  display: grid;
  gap: 1rem;
}

.session-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-title {
  font-weight: 600;
}

.session-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.session-mode {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  margin-top: 0.25rem;
}

.session-actions {
  display: flex;
  gap: 0.5rem;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .modes-grid { grid-template-columns: 1fr; }
  .session-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .status-actions { flex-direction: column; }
}
