/* ======== GENERAL BODY ======== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;

  /* Background image */
  background-image: url('img/img_back_ambulance.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
}

/* Overlay to fade the image */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  z-index: -1;
}

/* HEADING TRANSLATION ICON */

.heading-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* ======== HEADER BAR ======== */
.logo-bar {
  width: 100%;
  background-color: #1e3a8a;
  padding: 1rem 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.logo-bar img {
  max-width: 450px;
  width: 90%;
  height: auto;
  display: block;
}
.menu-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

/* ======== WELCOME / TITLES ======== */
.welcome {
  text-align: center;
  margin: 1rem 0;
  width: 90%;
  max-width: 600px;
}
.welcome span { color: #dc2626; font-weight: bold; }
.welcome h1 { color: #1e3a8a; margin-bottom: 0.5rem; }
.welcome.two-col {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  text-align: left;
}
.welcome-icon img { max-width: 60px; height: auto; }
.welcome-text { max-width: 500px; }

/* ======== GRID CHALLENGE ICONS ======== */
/* make sure each card resizes nicely */
.challenge {
  border: 1px solid #ddd;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  background: #f9f9f9;
  text-decoration: none;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  justify-self: center;
}

.challenge:hover { transform: scale(1.05); }
.icon {
  width: 130px;
  height: 130px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #1e3a8a;
  margin-bottom: 0.5rem;
}
.icon img { width: 80%; height: auto; }

/* ======== CONTENT BOX ======== */
.content {
  width: 90%;
  max-width: 800px;
  background: #f9f9f9;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.content h2 { color: #1e3a8a; margin-bottom: 1rem; }
.content p { margin-bottom: 20px; line-height: 1.5; }

/* ======== FORMS ======== */
.form-card {
  background: #fff;
  border-left: 6px solid #007BFF;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  padding: 30px;
  margin-top: 30px;
  transition: transform 0.2s;
}
.form-card:hover { transform: translateY(-2px); }
.form-card-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
  color: #007BFF;
}
.modern-form label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
  color: #333;
}
.modern-form input[type="text"],
.modern-form input[type="email"],
.modern-form input[type="file"],
.modern-form textarea {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.modern-form input:focus,
.modern-form textarea:focus {
  border-color: #007BFF;
  outline: none;
}
.modern-form .checkbox { display: flex; align-items: center; margin-top: 15px; }
.modern-form .checkbox input { margin-right: 10px; }

/* Unified button style */
button, .modern-form-button, .level-btn, .reorder-controls button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  background: #1e3a8a;
  color: #fff;
  transition: background 0.2s, transform 0.1s;
}
button:hover, .modern-form-button:hover, .level-btn:hover, .reorder-controls button:hover {
  background: #0056b3;
}
button:active, .level-btn.active {
  box-shadow: 0 6px 18px rgba(30,58,138,0.12);
  transform: translateY(-1px);
}

/* ======== FOOTER ======== */
footer { margin: 2rem 0; }
footer a { color: #1e3a8a; text-decoration: underline; }

/* ======== OVERLAY MENU ======== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  justify-content: flex-end;
  z-index: 1000;
}
.overlay.active { display: flex; }
.menu {
  background: #fff;
  width: 250px;
  height: 100%;
  padding: 1rem;
  box-shadow: -2px 0 5px rgba(0,0,0,0.2);
  border-left: 4px solid #1e3a8a;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.overlay.active .menu { transform: translateX(0); }
.menu nav a {
  display: block;
  margin: 1rem 0;
  font-weight: bold;
  color: #1e3a8a;
  text-decoration: none;
}
.menu nav a:hover { color: #dc2626; }

/* ======== CLOSE BUTTON ======== */
.close-btn {
  font-size: 1.5rem;   /* optional: adjust size */
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;         /* this ensures the X is white on all devices */
}

/* ======== QUIZ FEEDBACK ======== */
.quiz-feedback {
  margin-top: 10px;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.quiz-feedback.correct { background-color: #d1fae5; color: #065f46; }
.quiz-feedback.wrong { background-color: #fee2e2; color: #b91c1c; }

/* ======== REORDER EXERCISE ======== */
.exercise { margin: 20px auto; max-width: 800px; }
.exercise h2 { margin-bottom: 10px; color: #1e3a8a; }
.reorder-item {
  padding: 16px;
  margin: 5px 0;
  border-radius: 8px;
  cursor: move;
  font-size: 18px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reorder-item.speaker-a { background-color: #1e3a8a; }
.reorder-item.speaker-b { background-color: #dc2626; }
.reorder-item span { flex: 1; }
.reorder-controls button {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  padding: 2px 6px;
  margin-left: 4px;
  font-size: 14px;
}
.reorder-controls button:hover {
  background: #007BFF;
  color: #fff;
  border-color: #007BFF;
}
#reorder-result {
  margin-top: 10px;
  font-weight: bold;
  font-size: 16px;
}

/* ======== VOCAB QUIZ ======== */
.vocab-controls,
.vocab-levels {
  display: flex;
  gap: 0.75rem;
  justify-content: center; /* keeps them centered */
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.vocab-quiz { margin-top: 1rem; }

.vocab-progress {
  margin-bottom: 0.75rem;
  text-align: center;
  font-weight: 600;
  color: #1e3a8a;
}

.vocab-definition {
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  margin-bottom: 12px;
  line-height: 1.5;
}

.options { display: grid; gap: 8px; }

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
}

.option-btn[disabled] { cursor: default; opacity: 0.9; }

.option-btn.correct {
  background-color: #d1fae5;
  border-color: #065f46;
  color: #065f46;
}

.option-btn.wrong {
  background-color: #fee2e2;
  border-color: #b91c1c;
  color: #7b1f1f;
}

.vocab-controls-bottom {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}


/* Big blue question box */
.quiz-question-box {
  background: #1e3a8a;        /* same blue as your theme */
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 2rem;            /* larger text */
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}


/* Highlight the selected level in red */
.level-btn.active {
  background: #dc2626; /* red */
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 6px 18px rgba(220,38,38,0.25);
  transform: translateY(-1px);
}

/* ===== LEVEL CHANGE MODAL ===== */

.level-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.level-modal.active {
  display: flex;
}

.level-modal-content {
  background: #fff;
  padding: 25px;
  width: 90%;
  max-width: 420px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.level-modal-content h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.level-modal-content p {
  font-size: 1rem;
  margin-bottom: 20px;
}

.level-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.modal-btn.cancel {
  background: #ccc;
  color: #000;
}

.modal-btn.confirm {
  background: #007bff;
  color: #fff;
}

/* ======== SMOOTH SCROLLING ======== */
html { scroll-behavior: smooth; }

/* ======== GRID FIX FOR HOMEPAGE ======== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 90%;
  max-width: 900px;
  margin: 2rem auto;
  justify-items: center;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ======== RESPONSIVE ======== */
@media (max-width: 900px) {
  .reorder-item { padding: 14px; font-size: 16px; }
}
@media (max-width: 600px) {
  .logo-bar img { max-width: 200px; }
  .icon { width: 70px; height: 70px; }
  .menu-btn { font-size: 1.5rem; }
  .welcome.two-col { flex-direction: column; text-align: center; }
  .welcome-icon img { max-width: 40px; }
  .reorder-item { padding: 10px; font-size: 14px; }
  .options { gap: 6px; }
  .option-btn { font-size: 15px; padding: 10px; }
}
@media (max-width: 400px) {
  .welcome h1 { font-size: 1.4rem; }
  .exercise h2 { font-size: 1rem; }
  .form-card { padding: 20px; }
  .modern-form button, .modern-form-button { font-size: 14px; padding: 12px; }
}
