* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
:root {
  --primary: #075e54;
  --primary-dark: #054d44;
  --primary-light: #128c7e;
  --secondary: #34a853;
  --accent: #ea4335;
  --warning: #fbbc04;
  --dark: #202124;
  --gray: #5f6368;
  --light-gray: #e8eaed;
  --white: #ffffff;
  --bg: #f8f9fa;
  --card-shadow: 0 2px 10px rgba(0,0,0,0.1);
  --hover-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  padding-bottom: 70px;
}
html { scroll-behavior: smooth; }
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #075e54 0%, #054d44 50%, #128c7e 100%);
  padding: 15px;
}
.login-container {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 450px;
  padding: 40px;
  text-align: center;
}
.login-logo {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
  letter-spacing: -1px;
}
.login-subtitle { color: var(--gray); font-size: 14px; margin-bottom: 8px; }
.login-brand-line { font-size: 11px; color: var(--gray); margin-bottom: 30px; font-style: italic; }
.login-tabs {
  display: flex;
  margin-bottom: 25px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--light-gray);
}
.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--gray);
  background: var(--bg);
  transition: all 0.2s;
}
.login-tab.active { background: var(--primary); color: var(--white); }
.form-group { margin-bottom: 18px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray); margin-bottom: 6px; }
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary); }
.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--primary-dark); }
.login-foot { margin-top: 18px; font-size: 13px; color: var(--gray); }
.login-foot a { color: var(--primary); text-decoration: none; font-weight: 600; }

.top-bar {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.top-bar-left { display: flex; align-items: center; }
.top-bar-logo { font-size: 18px; font-weight: 700; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
.user-info { text-align: right; }
.user-name { font-size: 13px; font-weight: 600; }
.user-id { font-size: 11px; opacity: 0.8; }
.logout-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.3); }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  border-top: 1px solid var(--light-gray);
  z-index: 99;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.bottom-nav a {
  text-decoration: none;
  color: var(--gray);
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:hover { background: var(--bg); }
.nav-icon { display: block; font-size: 20px; margin-bottom: 2px; }
.nav-label { display: block; }

.bottom-nav-shift { padding-bottom: 80px !important; }

.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 30px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.welcome-banner h1 { font-size: 24px; margin-bottom: 8px; }
.welcome-banner p { font-size: 14px; opacity: 0.9; max-width: 600px; margin: 0 auto; }
.banner-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.3);
}

.progress-section {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.progress-bar-container {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress-header h3 { font-size: 16px; }
.progress-percent { font-size: 20px; font-weight: 800; color: var(--primary); }
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 0 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.module-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.module-card:hover { transform: translateY(-2px); box-shadow: var(--hover-shadow); }
.module-card.completed { border-left: 4px solid var(--secondary); }
.module-card.available { border-left: 4px solid var(--primary); }
.module-card.locked { border-left: 4px solid var(--light-gray); opacity: 0.7; }
.module-card.locked:hover { transform: none; box-shadow: var(--card-shadow); }
.lock-icon { font-size: 24px; margin-bottom: 8px; display: block; }
.module-card-number { font-size: 11px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.module-card-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.module-card-desc { font-size: 13px; color: var(--gray); margin-bottom: 12px; line-height: 1.4; }
.module-card-status { margin-top: auto; }
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge.completed { background: #e6f4ea; color: #137333; }
.status-badge.available { background: #e8f0fe; color: #1a73e8; }
.status-badge.locked { background: var(--bg); color: var(--gray); }

.card-appear {
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.course-content { padding: 20px; max-width: 900px; margin: 0 auto; }
.course-header { text-align: center; margin-bottom: 25px; }
.course-header h1 { font-size: 22px; color: var(--primary); margin-bottom: 6px; }
.course-header p { font-size: 14px; color: var(--gray); }

.phrase-table-wrapper { overflow-x: auto; margin-bottom: 20px; }
.phrase-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.phrase-table th {
  background: var(--primary);
  color: var(--white);
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.phrase-table td { padding: 10px 15px; font-size: 14px; border-bottom: 1px solid var(--light-gray); }
.phrase-table tr:last-child td { border-bottom: none; }
.phrase-table tr:hover { background: #f0fdf4; }
.phrase-num { color: var(--gray); font-size: 12px; width: 40px; }
.english-phrase { font-weight: 600; }
.arabic-phrase { direction: rtl; text-align: right; color: var(--primary); font-weight: 500; }

.content-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}
.content-card h3 { font-size: 16px; color: var(--primary); margin-bottom: 10px; }
.content-card h4 { font-size: 14px; color: var(--dark); margin-bottom: 6px; }
.example-sentence {
  padding: 10px 14px;
  border-left: 4px solid var(--primary);
  background: var(--bg);
  border-radius: 6px;
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}
.arabic-example { direction: rtl; text-align: right; color: var(--primary); font-weight: 500; }

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.vocab-card {
  background: var(--white);
  border-radius: 10px;
  padding: 15px;
  box-shadow: var(--card-shadow);
  text-align: center;
}
.vocab-word { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.vocab-meaning { font-size: 13px; color: var(--gray); margin-bottom: 4px; }
.vocab-arabic { direction: rtl; text-align: center; font-size: 14px; color: var(--primary); font-weight: 500; }

.idiom-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
}
.idiom-text { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.idiom-meaning { font-size: 14px; color: var(--dark); }
.idiom-usage { font-size: 13px; color: var(--gray); font-style: italic; margin-top: 4px; }

.tip-card {
  display: flex;
  gap: 12px;
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
}
.tip-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.tip-content h4 { font-size: 14px; margin-bottom: 4px; }
.tip-content p { font-size: 13px; color: var(--gray); }

.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
}
.cta-box h3 { font-size: 20px; margin-bottom: 10px; }
.cta-box p { font-size: 14px; opacity: 0.9; margin-bottom: 6px; }
.cta-button {
  display: inline-block;
  padding: 12px 30px;
  background: var(--white);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  transition: transform 0.2s;
}
.cta-button:hover { transform: scale(1.05); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 15px 0;
}
.page-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--light-gray);
  background: var(--white);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.filter-tab {
  padding: 8px 16px;
  border: 2px solid var(--light-gray);
  background: var(--white);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray);
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 10px 0;
}
.nav-btn {
  padding: 10px 20px;
  background: var(--white);
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray);
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.nav-btn:disabled:hover { border-color: var(--light-gray); color: var(--gray); }

.take-quiz-btn {
  padding: 14px 40px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 4px 12px rgba(7,94,84,0.3);
}
.take-quiz-btn:hover { background: var(--primary-dark); }
.take-quiz-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.quiz-container { padding: 20px; max-width: 700px; margin: 0 auto; }
.quiz-header { margin-bottom: 20px; }
.quiz-header h2 { color: var(--primary); }
.quiz-progress-text { font-size: 13px; color: var(--gray); margin-top: 4px; }

.question-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--card-shadow);
}
.question-number { font-size: 12px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.question-text { font-size: 16px; font-weight: 600; margin-bottom: 15px; line-height: 1.5; }

.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-item {
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  font-size: 14px;
}
.option-item:hover { border-color: var(--primary); background: #f0fdf4; }
.option-item.selected { border-color: var(--primary); background: #e8f0fe; }
.option-item.correct { border-color: var(--secondary); background: #e6f4ea; }
.option-item.wrong { border-color: var(--accent); background: #fce8e6; }
.option-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--light-gray);
  flex-shrink: 0;
  transition: all 0.2s;
}
.option-item.selected .option-radio { border-color: var(--primary); background: var(--primary); }

.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  gap: 10px;
}
.quiz-actions .nav-btn { padding: 10px 20px; }
.quiz-actions .nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.quiz-submit-btn {
  padding: 10px 24px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.quiz-submit-btn:hover { background: #d93025; }

.result-card {
  text-align: center;
  background: var(--white);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  max-width: 500px;
  margin: 0 auto;
}
.result-icon { font-size: 48px; margin-bottom: 12px; }
.result-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.result-score { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.result-pass { color: var(--secondary); }
.result-fail { color: var(--accent); }
.result-message { font-size: 14px; color: var(--gray); margin-bottom: 20px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.result-actions .nav-btn { padding: 10px 20px; }
.result-actions .take-quiz-btn { padding: 10px 20px; font-size: 14px; }

.final-quiz-banner {
  background: linear-gradient(135deg, var(--secondary) 0%, #2d8f47 100%);
  color: var(--white);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
}
.final-quiz-banner h2 { font-size: 22px; margin-bottom: 6px; }
.final-quiz-banner p { font-size: 14px; opacity: 0.95; }

.certificate {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  position: relative;
}
.cert-border-inner { position: relative; }
.cert-ribbon {
  text-align: center;
  font-size: 14px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.cert-brand { text-align: center; font-size: 12px; color: var(--gray); margin-bottom: 20px; font-style: italic; }
.cert-title { text-align: center; font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.cert-subtitle { text-align: center; font-size: 13px; color: var(--gray); margin-bottom: 20px; }
.cert-presented { text-align: center; font-size: 14px; color: var(--gray); margin-bottom: 8px; }
.cert-name { text-align: center; font-size: 28px; font-weight: 800; color: var(--dark); margin-bottom: 12px; border-bottom: 2px solid var(--light-gray); padding-bottom: 12px; }
.cert-course { text-align: center; font-size: 13px; color: var(--gray); line-height: 1.6; margin-bottom: 25px; }
.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--light-gray);
}
.cert-signature { text-align: center; }
.cert-sig-line { font-size: 11px; color: var(--gray); }
.cert-id { text-align: center; font-size: 11px; color: var(--gray); margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--light-gray); }
.print-cert-btn {
  padding: 12px 30px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.print-cert-btn:hover { background: var(--primary-dark); }

.tense-chart {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.tense-chart th {
  background: var(--primary);
  color: var(--white);
  padding: 8px 12px;
  text-align: left;
}
.tense-chart td {
  padding: 8px 12px;
  border: 1px solid var(--light-gray);
}

.listening-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--card-shadow);
}
.play-audio-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 15px;
}
.play-audio-btn:hover { background: var(--primary-light); }
.listening-instructions {
  background: #e8f0fe;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

@media print {
  body { background: var(--white); padding: 0; }
  .top-bar, .bottom-nav, .logout-btn, .print-cert-btn, .back-btn { display: none !important; }
  .certificate { box-shadow: none; padding: 20px; }
}

@media (max-width: 600px) {
  .top-bar { padding: 10px 12px; }
  .top-bar-logo { font-size: 15px; }
  .user-info { display: none; }
  .welcome-banner { padding: 24px 16px; }
  .welcome-banner h1 { font-size: 20px; }
  .modules-grid { grid-template-columns: 1fr; padding: 0 12px 12px; gap: 12px; }
  .course-content { padding: 15px; }
  .phrase-table th, .phrase-table td { padding: 8px 10px; font-size: 13px; }
  .vocab-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
  .certificate { padding: 20px; }
  .cert-footer { flex-direction: column; gap: 15px; align-items: center; }
  .cert-name { font-size: 22px; }
  .quiz-container { padding: 12px; }
  .question-text { font-size: 14px; }
}

.splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #075e54 0%, #054d44 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  font-size: 48px;
  font-weight: 800;
  color: white;
  margin-bottom: 5px;
  animation: splashBounce 1s ease;
}
.splash-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 30px;
}
.splash-loader {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes splashBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.page-slide-in {
  animation: pageSlideIn 0.3s ease;
}
@keyframes pageSlideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
