/* CSS Variables - Ethiopian Theme */
:root {
  --primary: #1B4D3E;
  --primary-light: #2D7A5F;
  --secondary: #F4C430;
  --danger: #DC3545;
  --bg: #0A0A0A;
  --surface: #1A1A1A;
  --text: #FFFFFF;
  --text-secondary: #A0A0A0;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Screen Container */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.screen.active {
  display: flex;
}

/* Landing Screen */
.logo {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.logo-text {
  display: block;
  font-size: 48px;
  font-weight: bold;
  color: var(--secondary);
}

.logo-subtext {
  display: block;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--text-secondary);
}

.tagline {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-style: italic;
}

.features {
  margin-top: var(--space-xl);
  text-align: center;
}

.feature {
  color: var(--text-secondary);
  padding: var(--space-sm);
  font-size: 14px;
}

.online-count {
  position: absolute;
  bottom: var(--space-xl);
  color: var(--text-secondary);
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: var(--space-md) var(--space-xl);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

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

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

.btn-primary:disabled {
  background: #333;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  background: #222;
}

.btn-large {
  padding: var(--space-lg) var(--space-xl);
  font-size: 18px;
  width: 100%;
  max-width: 300px;
}

.btn-control {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0;
  font-size: 12px;
}

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

.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: var(--space-sm);
}

.link {
  color: var(--text-secondary);
  text-decoration: none;
  margin-top: var(--space-md);
}

/* Modal */
.modal {
  background: var(--surface);
  padding: var(--space-xl);
  border-radius: 16px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.modal h2 {
  margin-bottom: var(--space-lg);
}

.modal .btn {
  width: 100%;
  margin-top: var(--space-md);
}

.modal .emoji {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  text-align: left;
  cursor: pointer;
}

.checkbox-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* Waiting Screen */
.waiting-content {
  text-align: center;
}

.loader {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.loader span {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loader span:nth-child(1) { animation-delay: -0.32s; }
.loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.self-preview {
  width: 150px;
  height: 200px;
  margin: var(--space-lg) auto;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

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

/* Video Chat Screen */
.video-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 100px;
  background: #000;
}

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

.video-container.dimmed {
  opacity: 0.3;
}

.pip {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 100px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--primary);
}

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

.connection-status {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(0,0,0,0.5);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 20px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-light);
  border-radius: 50%;
}

.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  background: var(--surface);
  padding: var(--space-md);
}

#btn-report {
  position: absolute;
  bottom: var(--space-xs);
  right: var(--space-md);
}

/* Reconnecting Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
}

.reconnect-box {
  background: var(--surface);
  padding: var(--space-xl);
  border-radius: 16px;
  text-align: center;
  max-width: 280px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  animation: spin 1s linear infinite;
}

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

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: var(--space-sm) 0;
}

.countdown {
  margin: var(--space-md) 0;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  margin: var(--space-md) 0;
}

.progress {
  height: 100%;
  background: var(--primary);
  transition: width 1s linear;
}

/* Media Queries for larger screens */
@media (min-width: 480px) {
  .self-preview {
    width: 180px;
    height: 240px;
  }

  .pip {
    width: 140px;
    height: 200px;
  }
}

@media (min-width: 768px) {
  .video-container {
    bottom: 80px;
  }

  .controls {
    height: 80px;
  }

  .pip {
    width: 180px;
    height: 240px;
    bottom: var(--space-lg);
    right: var(--space-lg);
  }
}
