:root {
  /* Light theme variables */
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;
  --accent: #f1f5f9;
  --accent-foreground: #0f172a;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --ring: #94a3b8;
  --radius: 0.5rem;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-height: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark theme variables */
    --background: #0f172a;
    --foreground: #f8fafc;
    --muted: #1e293b;
    --muted-foreground: #94a3b8;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --border: #334155;
    --input: #334155;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #1e293b;
    --secondary-foreground: #f8fafc;
    --accent: #1e293b;
    --accent-foreground: #f8fafc;
    --destructive: #ef4444;
    --destructive-foreground: #f8fafc;
    --ring: #1e293b;
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
}

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

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--foreground);
  text-decoration: none;
}

.app-logo svg {
  height: 24px;
  width: 24px;
  fill: var(--primary);
}

.app-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

.container {
  width: 100%;
  padding: 0 1rem;
}

.card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.role-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius);
  background-color: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: var(--foreground);
}

.role-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.role-card svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  fill: var(--primary);
}

.role-card h2 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.role-card p {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

/* Form elements */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

select, button {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

select {
  background-color: var(--input);
  border: 1px solid var(--border);
  color: var(--foreground);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
  border-color: var(--primary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  background-color: var(--primary);
  color: var(--primary-foreground);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.button:hover {
  background-color: color-mix(in srgb, var(--primary) 90%, black);
}

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

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

.button.secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.button.secondary:hover {
  background-color: color-mix(in srgb, var(--secondary) 90%, black);
}

.button.danger {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.button.danger:hover {
  background-color: color-mix(in srgb, var(--destructive) 90%, black);
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.button-group .button {
  flex: 1;
}

/* Video element styling */
.video-container {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #000;
  aspect-ratio: 16/9;
  margin-bottom: 1.5rem;
  position: relative;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background-color: var(--muted);
}

.status-indicator.live {
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.status-indicator.connecting {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-indicator.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-indicator.live .dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .container {
    padding: 0;
  }
  
  .card {
    padding: 1rem;
  }
}

/* Additional utility classes */
.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: color-mix(in srgb, var(--primary) 90%, black);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.mt-auto {
  margin-top: auto;
}


.footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: grey;
  background: transparent;
  padding: 10px 0;
  width: 100%;
  pointer-events: none;
}

.footer a {
  color: inherit;
  text-decoration: underline;
  pointer-events: auto; 
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input#codeInput {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--input);
  color: var(--foreground);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

input#codeInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--ring);
}

.recommendation-input button {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}

.recommendation-input button:hover {
  background-color: color-mix(in srgb, var(--primary) 90%, black);
}
