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

:root {
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --green: #22c55e;
  --red: #ef4444;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-700: #374151;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  min-height: 100vh;
  color: var(--gray-700);
}

/* Layout com menu lateral */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--teal);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar.hidden {
  display: none !important;
}
.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 16px;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}
.sidebar-link {
  display: block;
  padding: 10px 14px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}
.sidebar-link.active {
  background: rgba(255,255,255,0.25);
  color: white;
  font-weight: 600;
}
.sidebar-footer {
  padding: 16px 12px 0;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.sidebar-footer .sidebar-link {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}
.sidebar-footer .sidebar-connected {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 6px;
}
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.main-content header {
  flex-shrink: 0;
}
.main-content main {
  flex: 1;
}

/* Mobile/Tablet Styles */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -220px; /* Hidden by default */
    width: 220px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
  }
  
  .sidebar.sidebar-open {
    left: 0;
  }
  
  .sidebar-brand {
    padding-top: 20px;
  }

  .sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
  }

  .sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 16px;
  }
}

/* Hamburger Menu Button */
.hamburger-button {
  display: none;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  margin-right: 12px;
}

@media (max-width: 768px) {
  .hamburger-button {
    display: inline-block;
  }
}

/* Overlay for mobile menu */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

header {
  background: var(--teal);
  color: white;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.header-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  opacity: 0.95;
}

.lang-toggle {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 4px 10px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.lang-btn.active {
  background: white;
  color: var(--teal);
}

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px;
}

.start-screen {
  text-align: center;
  padding: 60px 20px;
}

.start-screen h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--teal-dark);
}

.start-screen p {
  color: var(--gray-500);
  margin-bottom: 12px;
}

.question-count {
  font-weight: 600;
  color: var(--teal) !important;
}

.help-text {
  font-size: 0.9rem;
  margin-top: 16px;
}

.help-text code {
  background: var(--gray-200);
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--teal);
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-link:hover {
  text-decoration: underline;
}

.btn-primary {
  background: var(--teal);
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.hidden {
  display: none !important;
}

.question-screen {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.question-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.question-text {
  flex: 1;
}

.question-text h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.question-main {
  font-size: inherit;
}

.question-translation {
  font-size: 0.7rem;
  color: var(--gray-500);
  font-weight: normal;
  line-height: 1.3;
}

.instruction {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.question-image {
  flex-shrink: 0;
  text-align: center;
}

.question-image img {
  max-width: 120px;
  max-height: 120px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
}

.question-id {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  background: white;
}

.option-letter {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--teal);
  min-width: 1.5em;
}

.option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.option-translation {
  font-size: 0.7rem;
  color: var(--gray-500);
  font-weight: normal;
  line-height: 1.3;
}

.option:hover:not(.revealed) {
  border-color: var(--teal);
  background: rgba(13, 148, 136, 0.05);
}

.option.revealed {
  cursor: default;
}

.option.correct {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.option.correct::after {
  content: '✓';
  margin-left: auto;
  color: var(--green);
  font-weight: bold;
}

.option.incorrect {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

.option.incorrect::after {
  content: '✗';
  margin-left: auto;
  color: var(--red);
  font-weight: bold;
}

.feedback {
  margin: 16px 0;
  padding: 12px;
  background: var(--gray-100);
  border-radius: 8px;
  font-size: 0.95rem;
}

.feedback p {
  margin: 0;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--gray-700);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn.btn-primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

.btn.btn-primary:hover {
  background: var(--teal-dark);
  color: white;
  border-color: var(--teal-dark);
}

.result-screen {
  text-align: center;
  padding: 60px 20px;
}

.result-screen h1 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.result-score {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-score.pass {
  color: var(--green);
}

.result-score.fail {
  color: var(--red);
}

.result-msg {
  color: var(--gray-500);
  margin-bottom: 32px;
}
