:root {
  --primary-color: #007bff;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --secondary-color: #6c757d;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

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

body {
  width: 100vw;
  height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
}

canvas {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
}

#logo {
  position: fixed;
  top: 10px;
  left: 10px;
  height: 80px;
  z-index: 1000;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

label[for="languageSelector"] {
  position: absolute;
  top: 10px;
  right: 120px;
  color: white;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

#languageSelector {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 12px;
  font-size: 16px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed);
}

#languageSelector:hover,
#languageSelector:focus {
  background-color: white;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
  outline: none;
}

.button-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 90%;
  max-width: 600px;
  z-index: 100;
}

.button-container button {
  padding: 12px 24px;
  min-width: 120px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background-color: var(--primary-color);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed);
}

.button-container button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.button-container button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Distinct styles for each button type */
#previousButton {
  background-color: var(--secondary-color);
}

#repeatButton {
  background-color: var(--success-color);
}

#skipButton {
  background-color: var(--danger-color);
}

#submitButton {
  background-color: var(--primary-color);
}

#startButton {
  display: block;
  background-color: var(--primary-color);
  font-size: 18px;
  padding: 15px 30px;
  min-width: 150px;
}

#submitButton, #repeatButton, #skipButton, #previousButton {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #logo {
    height: 60px;
  }
  
  .button-container {
    bottom: 15px;
  }
  
  .button-container button {
    padding: 10px 20px;
    min-width: 100px;
    font-size: 14px;
  }
  
  label[for="languageSelector"] {
    right: 100px;
  }
  
  #languageSelector {
    padding: 6px 10px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #logo {
    height: 40px;
  }
  
  .button-container {
    gap: 8px;
  }
  
  .button-container button {
    padding: 8px 16px;
    min-width: 80px;
    font-size: 12px;
  }
  
  label[for="languageSelector"] {
    display: none;
  }
  
  #languageSelector {
    top: 5px;
    right: 5px;
  }
}

/* Loading indicator */
.loading-spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  z-index: 2000;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Visual feedback for recording */
.recording-indicator {
  display: none;
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--danger-color);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(220, 53, 69, 0.4);
  animation: pulse 2s infinite;
  z-index: 1000;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* Question, yes/no indicator, and transcription display */
.question-display,
.transcription-display,
.yes-no-indicator {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  max-width: 800px;
  width: 90%;
  padding: 15px 20px;
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--box-shadow);
  z-index: 1000;
  display: none;
  text-align: center;
  backdrop-filter: blur(5px);
}

.question-display {
  top: 120px;
  font-weight: bold;
  font-size: 18px;
  color: var(--dark-color);
}

.yes-no-indicator {
  top: 180px;
  font-size: 16px;
  color: white;
  background-color: var(--danger-color);
  font-weight: bold;
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.transcription-display {
  bottom: 100px;
  font-size: 16px;
  color: var(--primary-color);
  font-style: italic;
}

/* Language control styling */
.language-control {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.language-control label {
  color: white;
  margin-right: 10px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments for displays */
@media (max-width: 768px) {
  .question-display {
    top: 90px;
    font-size: 16px;
    padding: 12px 16px;
  }
  
  .yes-no-indicator {
    top: 150px;
    font-size: 14px;
    padding: 10px 14px;
  }
  
  .transcription-display {
    bottom: 80px;
    font-size: 14px;
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .question-display {
    top: 60px;
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .yes-no-indicator {
    top: 120px;
    font-size: 12px;
    padding: 8px 10px;
  }
  
  .transcription-display {
    bottom: 60px;
    font-size: 12px;
    padding: 8px 10px;
  }
}