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

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --danger-color: #dc2626;
  --danger-hover: #b91c1c;
  --bg-color: #111827;
  --surface-color: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --border-color: #374151;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Home Page */
.home {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.home .container {
  text-align: center;
  max-width: 500px;
}

.home h1 {
  font-size: 48px;
  margin-bottom: 8px;
}

.home .tagline {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 18px;
}

.link-section {
  margin-top: 32px;
}

.link-section .label {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.link-box input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--surface-color);
  color: var(--text-primary);
  font-size: 14px;
}

.copy-status {
  color: #22c55e;
  margin-bottom: 16px;
}

/* Room Page */
.room {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Status Overlay */
.status-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  z-index: 100;
}

.status-content {
  text-align: center;
}

.status-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background-color: var(--surface-color);
}

.status-icon.loading {
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-content p {
  font-size: 20px;
  margin-bottom: 24px;
}

.status-content .btn {
  margin: 8px;
}

/* Video Container */
.video-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
  padding-bottom: 100px;
}

@media (min-width: 768px) {
  .video-container {
    grid-template-columns: 3fr 1fr;
  }
}

.video-wrapper {
  position: relative;
  background-color: var(--surface-color);
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remote-video-wrapper {
  min-height: 300px;
}

@media (min-width: 768px) {
  .remote-video-wrapper {
    min-height: auto;
  }
}

.local-video-wrapper {
  max-height: 200px;
}

@media (min-width: 768px) {
  .local-video-wrapper {
    max-height: none;
  }
}

.video-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--text-secondary);
}

/* Controls */
.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(transparent, var(--bg-color));
}

.control-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background-color: var(--surface-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background-color: var(--border-color);
}

.control-btn.active {
  background-color: var(--danger-color);
}

.control-btn-danger {
  background-color: var(--danger-color);
}

.control-btn-danger:hover {
  background-color: var(--danger-hover);
}

/* Icons (using CSS shapes for MVP) */
.icon {
  display: block;
  width: 24px;
  height: 24px;
  position: relative;
}

.icon-mic::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 16px;
  background: currentColor;
  border-radius: 5px;
  top: 2px;
  left: 7px;
}

.icon-camera::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 12px;
  background: currentColor;
  border-radius: 2px;
  top: 6px;
  left: 2px;
}

.icon-camera::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid currentColor;
  top: 6px;
  right: 2px;
}

.icon-leave::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 4px;
  background: currentColor;
  border-radius: 2px;
  top: 10px;
  left: 2px;
  transform: rotate(-45deg);
}

/* Utility */
.hidden {
  display: none !important;
}
