body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #020817;
  color: white;
  direction: ltr;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 30px 20px;
}

#title {
  color: #ffffff;
  font-size: 52px;
  margin-bottom: 25px;
}

body.arabic {
  direction: rtl;
}

body.arabic #title,
body.arabic .transcript,
body.arabic .chat {
  text-align: right;
}

body:not(.arabic) #title,
body:not(.arabic) .transcript,
body:not(.arabic) .chat {
  text-align: left;
}

.topbar {
  background: #111827;
  border-bottom: 1px solid #1f2937;
  padding: 14px 20px;
  margin-bottom: 30px;
  border-radius: 16px;
}

.topbar span {
  color: #e11d2e;
  font-weight: bold;
  font-size: 26px;
}

.lang-switch {
  float: left;
}

body:not(.arabic) .lang-switch {
  float: right;
}

.lang-switch button {
  padding: 8px 14px;
  margin-left: 5px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
  color: white;
  cursor: pointer;
}

.lang-switch button.active {
  background: #e11d2e;
  border-color: #e11d2e;
}

.video-wrapper {
  position: relative;
  max-width: 700px;
  margin: auto;
}

.main-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: black;
}

.subtitle-overlay {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  padding: 10px 14px;
  box-sizing: border-box;
  text-align: center;
  color: white;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  pointer-events: none;
}

.transcript {
  background: #0b1220;
  border: 1px solid #1e293b;
  padding: 20px;
  border-radius: 18px;
  margin-top: 20px;
  margin-bottom: 20px;
  color: #e5e7eb;
}

.chat {
  margin-top: 20px;
}

.chat input {
  padding: 14px 16px;
  width: 60%;
  border-radius: 14px;
  border: 1px solid #334155;
  background: #111827;
  color: white;
  outline: none;
}

.chat input::placeholder {
  color: #94a3b8;
}

.chat button {
  padding: 14px 20px;
  background: #e11d2e;
  color: white;
  border: none;
  border-radius: 14px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: bold;
}

.chat button:hover {
  background: #be1624;
}

#answer {
  margin-top: 15px;
  font-weight: bold;
  color: #f8fafc;
}

.upload-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.upload-btn,
.generate-btn {
  min-width: 165px;
  height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #e11d2e, #ff3b3b);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.18s ease, opacity 0.18s ease;
  line-height: 1;
  vertical-align: middle;
}

.upload-btn:hover,
.generate-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.upload-btn:active,
.generate-btn:active {
  transform: translateY(0);
}

.file-name {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

#upload-status {
  margin-top: 12px;
  color: #e2e8f0;
  font-size: 14px;
}

.quiz-card {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  overflow: hidden;
}

.quiz-card h3 {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  margin-bottom: 16px;
}

.quiz-option {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: white;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
  word-wrap: break-word;
  white-space: normal;
  box-sizing: border-box;
}

.quiz-option:hover {
  background: #1e293b;
}

.quiz-option.correct {
  background: #16a34a !important;
}

.quiz-option.wrong {
  background: #dc2626 !important;
}

.footer {
  text-align: center;
  margin-top: 50px;
  padding: 24px 10px;
  color: #94a3b8;
  font-size: 13px;
  border-top: 1px solid #1e293b;
  background: #020617;
}

@media (max-width: 768px) {
  .container {
    padding: 14px;
  }

  #title {
    font-size: 28px;
  }

  .upload-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-btn,
  .generate-btn,
  .quiz-option {
    width: 100%;
  }

  .upload-btn,
  .generate-btn {
    height: 48px;
  }

  .main-video {
    width: 100%;
    max-width: 100%;
  }

  .subtitle-overlay {
    font-size: 15px;
    bottom: 12px;
    padding: 8px 10px;
  }

  .quiz-card {
    padding: 14px;
  }

  .quiz-card h3 {
    font-size: 18px;
  }

  .quiz-option {
    font-size: 14px;
  }

  .chat input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
  }

  .chat button {
    width: 100%;
    margin-right: 0;
  }
}