/* RaRa Ramen FOH Allergy Training - Shared Styles */
:root {
  --rara-red: #C41E3A;
  --rara-dark: #1a1a2e;
  --rara-cream: #FFF8F0;
  --rara-gold: #D4A843;
  --accent-green: #2E7D32;
  --accent-blue: #1565C0;
  --danger-red: #D32F2F;
  --warning-orange: #E65100;
  --text-primary: #212121;
  --text-secondary: #555;
  --border-light: #e0e0e0;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--rara-cream);
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.course-header {
  background: linear-gradient(135deg, var(--rara-dark), var(--rara-red));
  color: white;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 30px;
  text-align: center;
}
.course-header h1 { font-size: 2em; margin-bottom: 8px; }
.course-header .subtitle { font-size: 1.1em; opacity: 0.9; }
.course-header .badge {
  display: inline-block;
  background: var(--rara-gold);
  color: var(--rara-dark);
  padding: 4px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85em;
  margin-top: 12px;
}

/* Module header */
.module-header {
  background: linear-gradient(135deg, var(--rara-dark), var(--rara-red));
  color: white;
  padding: 30px 40px;
  border-radius: 12px;
  margin-bottom: 30px;
}
.module-header .module-number {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
}
.module-header h1 { font-size: 1.8em; margin: 8px 0; }
.module-header .learning-objective {
  background: rgba(255,255,255,0.15);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 0.95em;
  line-height: 1.5;
}
.module-header .learning-objective strong { color: var(--rara-gold); }

/* Navigation */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}
.nav-bar a {
  color: var(--rara-red);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-bar a:hover { background: rgba(196,30,58,0.1); }
.nav-bar a.btn-primary {
  color: white;
  background: var(--rara-red);
}
.nav-bar a.btn-primary:hover {
  background: #A01830;
  color: white;
}

/* Content sections */
.section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.section h2 {
  color: var(--rara-red);
  font-size: 1.4em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rara-gold);
}
.section h3 {
  color: var(--rara-dark);
  font-size: 1.15em;
  margin: 20px 0 10px;
}

/* Alert boxes */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 16px 0;
  border-left: 4px solid;
}
.alert-danger {
  background: #FFEBEE;
  border-color: var(--danger-red);
  color: #B71C1C;
}
.alert-warning {
  background: #FFF3E0;
  border-color: var(--warning-orange);
  color: #BF360C;
}
.alert-info {
  background: #E3F2FD;
  border-color: var(--accent-blue);
  color: #0D47A1;
}
.alert-success {
  background: #E8F5E9;
  border-color: var(--accent-green);
  color: #1B5E20;
}
.alert strong { display: block; margin-bottom: 4px; }

/* Key points / lists */
ul, ol { padding-left: 24px; margin: 12px 0; }
li { margin-bottom: 8px; }

.key-points {
  background: #F5F5F5;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 16px 0;
}
.key-points h4 {
  color: var(--rara-red);
  margin-bottom: 10px;
}

/* Allergen cards */
.allergen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.allergen-card {
  background: white;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.allergen-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.allergen-card .emoji { font-size: 2.5em; margin-bottom: 8px; }
.allergen-card .name { font-weight: 700; color: var(--rara-dark); font-size: 1.1em; }
.allergen-card .detail { font-size: 0.85em; color: var(--text-secondary); margin-top: 6px; }

/* Scenario / case study boxes */
.scenario {
  background: linear-gradient(to right, #FFF8E1, #FFFDE7);
  border: 2px solid var(--rara-gold);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
}
.scenario h4 {
  color: var(--rara-dark);
  margin-bottom: 12px;
}

/* Flipcards */
.flipcard-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.flipcard {
  perspective: 1000px;
  height: 180px;
  cursor: pointer;
}
.flipcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flipcard.flipped .flipcard-inner {
  transform: rotateY(180deg);
}
.flipcard-front, .flipcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-weight: 600;
}
.flipcard-front {
  background: var(--rara-red);
  color: white;
  font-size: 1.05em;
}
.flipcard-back {
  background: var(--rara-dark);
  color: white;
  transform: rotateY(180deg);
  font-size: 0.95em;
  font-weight: 400;
  line-height: 1.5;
}
.flipcard-hint {
  font-size: 0.75em;
  opacity: 0.7;
  margin-top: 8px;
  font-weight: 400;
}

/* Steps */
.steps { counter-reset: step; margin: 20px 0; }
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.step-number {
  counter-increment: step;
  background: var(--rara-red);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-content strong { display: block; margin-bottom: 4px; }

/* Quiz styles */
.quiz-container {
  background: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 24px;
  border: 2px solid var(--accent-blue);
}
.quiz-container h3 {
  color: var(--accent-blue);
  margin-bottom: 16px;
}
.question {
  background: #F5F5F5;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.question p { font-weight: 600; margin-bottom: 12px; }
.question label {
  display: block;
  padding: 10px 16px;
  margin: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.question label:hover { background: #E3F2FD; border-color: var(--accent-blue); }
.question input[type="radio"] { margin-right: 10px; }
.feedback {
  display: none;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 10px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--rara-red);
  color: white;
}
.btn-primary:hover { background: #A01830; }
.btn-secondary {
  background: var(--rara-dark);
  color: white;
}

/* Progress indicator */
.progress-bar {
  background: #E0E0E0;
  border-radius: 10px;
  height: 8px;
  margin: 16px 0;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--rara-red), var(--rara-gold));
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
th {
  background: var(--rara-dark);
  color: white;
  padding: 12px 16px;
  text-align: left;
}
td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}
tr:nth-child(even) { background: #F5F5F5; }

/* Checklist */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.checklist li::before {
  content: "\2610";
  font-size: 1.2em;
  color: var(--rara-red);
}

/* Footer */
.module-footer {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  border-top: 2px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Print styles */
@media print {
  body { max-width: 100%; padding: 0; background: white; }
  .nav-bar { display: none; }
  .section { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .flipcard { height: auto; }
  .flipcard-inner { transform: none !important; }
  .flipcard-front, .flipcard-back {
    position: relative;
    backface-visibility: visible;
    transform: none !important;
  }
}

@media (max-width: 600px) {
  body { padding: 12px; }
  .course-header, .module-header { padding: 20px; }
  .course-header h1, .module-header h1 { font-size: 1.4em; }
  .allergen-grid { grid-template-columns: repeat(2, 1fr); }
  .flipcard-container { grid-template-columns: 1fr; }
}
