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

html {
  height: 100%;
  overflow: hidden;
}

:root {
  --slide-image-max-height: 50vh; /* Maximum height for images in slides */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  color: #333;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header - same as reference design */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 20px;
  background: #2c3e50;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 50px;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

/* Content sections */
main, section {
  max-width: 100%;
  margin: 10px 0;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 22px;
  font-weight: 600;
}

/* Buttons */
button {
  padding: 12px 24px;
  background: #3498db;
  border: 0;
  border-radius: 4px;
  margin: 8px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
  font-weight: 500;
}

button:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.hidden {
  display: none !important;
}

/* Welcome Section */
.welcome-section {
  max-width: 100%;
  margin: 30px 0;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.welcome-container h2 {
  text-align: center;
  font-size: 28px;
  color: #2c3e50;
  margin-bottom: 30px;
}

.webinar-list {
  margin-top: 20px;
}

.webinar-card {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin: 15px 0;
  border-left: 4px solid #3498db;
  cursor: pointer;
  transition: all 0.3s;
}

.webinar-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.webinar-card h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 20px;
}

.webinar-card p {
  color: #666;
  font-size: 14px;
}

/* Presentation Container */
.presentation-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.presentation-wrapper {
  position: relative;
  width: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Aspect ratio container for slides - responsive to window size */
.aspect-ratio-container {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* Reveal.js direct integration */
.aspect-ratio-container .reveal {
  width: 100%;
  height: 100%;
}

/* Legacy aspect ratio classes removed - format now adapts automatically */

.presentation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #2c3e50;
  color: white;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  margin: 0 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #3498db;
  transition: width 0.3s;
}

.slide-counter {
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

.next-button-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.button-status-message {
  font-size: 12px;
  color: #ecf0f1;
  text-align: center;
  min-height: 18px;
  white-space: nowrap;
}

/* Lernkontrolle Section */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
}

.question-box {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.question-text {
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: 500;
  color: #2c3e50;
}

.question-number {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 5px 12px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-weight: 600;
}

.answer-option {
  padding: 15px;
  background: white;
  border-radius: 6px;
  margin: 10px 0;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #e0e0e0;
}

.answer-option:hover {
  background: #ecf0f1;
  border-color: #3498db;
  transform: translateX(5px);
}

.answer-option.selected {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

/* Participant Form */
.participant-form {
  max-width: 600px;
  margin: 0 auto;
  background: #f8f9fa;
  padding: 30px;
  border-radius: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
}

/* Result Section */
.result-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.result-box {
  background: #f8f9fa;
  padding: 40px;
  border-radius: 12px;
  margin: 30px 0;
}

.result-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.result-title {
  font-size: 32px;
  margin-bottom: 20px;
  color: #2c3e50;
}

.result-score {
  font-size: 48px;
  font-weight: 700;
  margin: 20px 0;
}

.result-score.passed {
  color: #27ae60;
}

.result-score.failed {
  color: #e74c3c;
}

.result-details {
  background: white;
  padding: 25px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
}

.result-details p {
  margin: 10px 0;
  font-size: 18px;
  color: #555;
}

.result-details strong {
  color: #2c3e50;
}

.result-message {
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 16px;
}

.result-message.success {
  background: #d4edda;
  border-left: 4px solid #27ae60;
  color: #155724;
}

.result-message.info {
  background: #d1ecf1;
  border-left: 4px solid #3498db;
  color: #0c5460;
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* Narration Indicator */
.narration-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2c3e50;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

.narration-indicator.speaking {
  background: #27ae60;
}

.narration-icon {
  font-size: 24px;
}

/* Confirmation Section */
.confirmation-container {
  max-width: 800px;
  margin: 0 auto;
}

.confirmation-text {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  border-left: 4px solid #3498db;
  line-height: 1.8;
}

.confirmation-text p {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 16px;
  text-align: justify;
}

.confirmation-text p:last-child {
  margin-bottom: 0;
}

.confirmation-checkbox-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  margin-bottom: 25px;
}

.confirmation-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  cursor: pointer;
  user-select: none;
}

.confirmation-checkbox-label input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.confirmation-checkbox-label span {
  font-size: 16px;
  color: #2c3e50;
  font-weight: 500;
  line-height: 1.6;
}

.confirmation-button-container {
  text-align: center;
}

.confirmation-button-container button {
  padding: 15px 40px;
  font-size: 18px;
  min-width: 250px;
}

/* Voice Controls */
.voice-controls {
  background: #ecf0f1;
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: center;
  flex-shrink: 0;
}

.voice-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.voice-control-group label {
  font-weight: 500;
  white-space: nowrap;
  font-size: 14px;
}

.voice-control-group select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  background: white;
  font-size: 14px;
  cursor: pointer;
}

.voice-control-group input[type="range"] {
  flex: 1;
  cursor: pointer;
}

.voice-control-group span {
  font-weight: 500;
  min-width: 50px;
  text-align: right;
  font-size: 14px;
}

.voice-control-group button {
  padding: 8px 16px;
  margin: 0;
  font-size: 14px;
  min-width: 80px;
}

.voice-control-group button.muted {
  background: #e74c3c;
}

.voice-control-group button.muted:hover {
  background: #c0392b;
}

/* Browser recommendation notice */
.browser-recommendation-notice {
  background: #e8f4f8;
  border: 2px solid #3498db;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
  display: none; /* Hidden by default, shown by JS */
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notice-content {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.notice-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.notice-text {
  flex: 1;
  min-width: 0;
}

.notice-text strong {
  color: #2c3e50;
  font-size: 16px;
  display: block;
  margin-bottom: 8px;
}

.notice-text p {
  margin: 0;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.notice-close {
  background: none;
  border: none;
  color: #3498db;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 30px;
  height: 30px;
  line-height: 28px;
  text-align: center;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}

.notice-close:hover {
  color: #2980b9;
  transform: scale(1.1);
}

.notice-close:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  main, section {
    margin: 10px;
    padding: 20px;
  }
  
  .aspect-ratio-container {
    border-radius: 4px;
  }
  
  .presentation-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .progress-bar {
    width: 100%;
    margin: 10px 0;
  }
  
  h1 {
    font-size: 20px;
  }
  
  .welcome-container h2 {
    font-size: 22px;
  }
  
  .result-title {
    font-size: 24px;
  }
  
  .result-score {
    font-size: 36px;
  }
  
  .voice-controls {
    grid-template-columns: 1fr;
  }
}
