* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --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;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  padding-bottom: 70px;
}

html {
  scroll-behavior: smooth;
}

/* LOGIN PAGE */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 50%, #1565c0 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: 14px;
  background: var(--white);
  border: none;
  transition: all 0.3s;
}

.login-tab.active {
  background: var(--primary);
  color: var(--white);
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  outline: none;
}

.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.3s;
  margin-top: 10px;
}

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

.login-btn.admin-btn {
  background: var(--dark);
}

.login-btn.admin-btn:hover {
  background: #000;
}

.login-error {
  color: var(--accent);
  font-size: 13px;
  margin-top: 10px;
  display: none;
}

.login-footer {
  margin-top: 25px;
  font-size: 11px;
  color: var(--gray);
  line-height: 1.6;
}

/* DASHBOARD */
.dashboard-wrapper {
  min-height: 100vh;
  background: var(--bg);
}

.top-bar {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-bar-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: 700;
  font-size: 14px;
}

.user-id {
  font-size: 12px;
  color: var(--gray);
}

.logout-btn {
  padding: 8px 20px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: #d32f2f;
}

.welcome-banner {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: var(--white);
  padding: 30px 40px;
  margin: 20px 30px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.welcome-banner h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.welcome-banner p {
  opacity: 0.9;
  font-size: 15px;
}

.progress-section {
  padding: 0 30px 30px;
}

.progress-bar-container {
  background: var(--white);
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 25px;
}

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

.progress-header h3 {
  font-size: 18px;
}

.progress-percent {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.progress-bar {
  height: 12px;
  background: var(--light-gray);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 6px;
  transition: width 0.5s ease;
}

/* MODULE GRID */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 0 30px 30px;
}

.module-card {
  background: var(--white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.module-card:hover:not(.locked) {
  box-shadow: var(--hover-shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.module-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.module-card.completed {
  border-color: var(--secondary);
}

.module-card.in-progress {
  border-color: var(--warning);
}

.module-card-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.module-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark);
}

.module-card-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 15px;
}

.module-card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.completed {
  background: #e6f4ea;
  color: var(--secondary);
}

.status-badge.locked {
  background: var(--light-gray);
  color: var(--gray);
}

.status-badge.available {
  background: #e8f0fe;
  color: var(--primary);
}

.status-badge.in-progress {
  background: #fef7e0;
  color: #e37400;
}

.lock-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 20px;
}

/* COURSE VIEWER */
.course-viewer {
  min-height: 100vh;
  background: var(--bg);
}

.course-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
}

.course-header {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 25px;
}

.course-header h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.course-header p {
  color: var(--gray);
  font-size: 15px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--white);
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 20px;
  transition: all 0.3s;
  color: var(--dark);
  text-decoration: none;
}

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

.take-quiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  margin-top: 20px;
  transition: background 0.3s;
}

.take-quiz-btn:hover {
  background: #2d9249;
}

/* PHRASE TABLE */
.phrase-table-wrapper {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 25px;
}

.phrase-table {
  width: 100%;
  border-collapse: collapse;
}

.phrase-table thead {
  background: var(--primary);
  color: var(--white);
}

.phrase-table th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.phrase-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--light-gray);
  font-size: 14px;
}

.phrase-table tbody tr:hover {
  background: #f8f9fa;
}

.phrase-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.phrase-num {
  color: var(--gray);
  font-weight: 600;
  width: 50px;
}

.english-phrase {
  font-weight: 600;
  color: var(--dark);
}

.hindi-phrase {
  color: var(--primary);
  font-weight: 500;
}

.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid var(--light-gray);
}

.nav-btn {
  padding: 10px 25px;
  border-radius: 8px;
  border: 2px solid var(--light-gray);
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  color: var(--dark);
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* QUIZ PAGE */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
}

.quiz-header {
  background: var(--white);
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-timer {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.quiz-progress-text {
  font-size: 14px;
  color: var(--gray);
}

.question-card {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.question-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}

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

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--light-gray);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 15px;
}

.option-item:hover {
  border-color: var(--primary);
  background: #f0f6ff;
}

.option-item.selected {
  border-color: var(--primary);
  background: #e8f0fe;
  font-weight: 600;
}

.option-item.correct {
  border-color: var(--secondary);
  background: #e6f4ea;
}

.option-item.wrong {
  border-color: var(--accent);
  background: #fce8e6;
}

.option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--light-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-item.selected .option-radio {
  border-color: var(--primary);
}

.option-item.selected .option-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
}

.quiz-submit-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.3s;
}

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

/* QUIZ RESULTS */
.result-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--card-shadow);
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
}

.result-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

.result-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
}

.result-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  margin: 15px 0;
}

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

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

.result-message {
  font-size: 16px;
  color: var(--gray);
  margin-bottom: 25px;
}

.result-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* ADMIN DASHBOARD */
.admin-container {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--card-shadow);
}

.stat-card h4 {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .stat-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
}

.student-table-wrapper {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
}

.student-table thead {
  background: var(--dark);
  color: var(--white);
}

.student-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.student-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--light-gray);
  font-size: 13px;
}

.student-table tbody tr:hover {
  background: #f8f9fa;
}

.admin-search {
  padding: 25px 30px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
}

.admin-search input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.admin-search input:focus {
  border-color: var(--primary);
}

.search-btn {
  padding: 12px 25px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

/* CERTIFICATE */
.certificate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eaed;
  padding: 40px;
}

.certificate {
  background: var(--white);
  width: 800px;
  min-height: 560px;
  border: 8px solid var(--primary);
  border-radius: 8px;
  padding: 50px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.cert-border-inner {
  border: 2px solid var(--primary);
  height: 100%;
  padding: 30px;
  border-radius: 4px;
}

.cert-logo {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 3px;
}

.cert-brand {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 25px;
}

.cert-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.cert-subtitle {
  font-size: 16px;
  color: var(--gray);
  margin-bottom: 25px;
}

.cert-presented {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 10px;
}

.cert-name {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: inline-block;
}

.cert-course {
  font-size: 16px;
  color: var(--dark);
  margin-bottom: 25px;
  line-height: 1.6;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 40px;
  padding-top: 20px;
}

.cert-signature {
  text-align: center;
}

.cert-sig-line {
  width: 200px;
  border-top: 2px solid var(--dark);
  padding-top: 8px;
  font-weight: 600;
  font-size: 13px;
}

.cert-date {
  font-size: 13px;
  color: var(--gray);
}

.cert-id {
  font-size: 11px;
  color: var(--gray);
  margin-top: 15px;
}

.print-cert-btn {
  margin-top: 30px;
  padding: 14px 40px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* LISTENING EXERCISE */
.listening-card {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.listening-instructions {
  background: #e8f0fe;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
}

.play-audio-btn {
  padding: 12px 30px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  transition: background 0.3s;
}

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

/* VOCABULARY CARDS */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.vocab-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--primary);
}

.vocab-word {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 5px;
}

.vocab-meaning {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 5px;
}

.vocab-hindi {
  font-size: 15px;
  color: var(--primary);
  font-weight: 600;
}

/* SECTION HEADERS */
.section-header {
  background: var(--white);
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--gray);
  font-size: 14px;
}

/* CONTENT CARDS */
.content-card {
  background: var(--white);
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.content-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--primary);
}

.content-card p, .content-card li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dark);
}

.content-card ul {
  padding-left: 20px;
}

.content-card ul li {
  margin-bottom: 8px;
}

.example-sentence {
  background: #f8f9fa;
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  margin: 10px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.hindi-example {
  color: var(--primary);
  font-weight: 500;
  font-style: normal;
}

/* TENSE CHARTS */
.tense-chart {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.tense-chart th {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
}

.tense-chart td {
  padding: 10px 16px;
  border: 1px solid var(--light-gray);
  font-size: 14px;
}

.tense-chart tr:nth-child(even) {
  background: #f8f9fa;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--gray);
  border-radius: 4px;
}

/* PRINT STYLES */
@media print {
  .top-bar, .back-btn, .print-cert-btn, .nav-btn, .quiz-actions { display: none !important; }
  .certificate { box-shadow: none; border: 8px solid #1a73e8; }
}

/* RESPONSIVE - ANDROID MOBILE FIRST */
@media (max-width: 768px) {
  .modules-grid { grid-template-columns: 1fr; padding: 0 12px 12px; gap: 12px; }
  .welcome-banner { margin: 12px; padding: 18px; border-radius: 10px; }
  .welcome-banner h1 { font-size: 20px; }
  .welcome-banner p { font-size: 13px; }
  .top-bar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .top-bar-logo { font-size: 20px; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-card .stat-number { font-size: 28px; }
  .certificate { width: 100%; min-width: auto; padding: 20px; border-width: 5px; }
  .cert-name { font-size: 24px; }
  .cert-title { font-size: 22px; letter-spacing: 1px; }
  .cert-border-inner { padding: 15px; }
  .vocab-grid { grid-template-columns: 1fr; }
  .quiz-container { padding: 10px; }
  .course-content { padding: 12px; }
  .module-card { padding: 18px; }
  .module-card-title { font-size: 16px; }
  .module-card-desc { font-size: 12px; }
  .question-card { padding: 18px; }
  .question-text { font-size: 16px; }
  .option-item { padding: 12px 14px; font-size: 14px; min-height: 48px; }
  .quiz-header { padding: 15px; flex-direction: column; gap: 8px; align-items: flex-start; }
  .quiz-actions { flex-wrap: wrap; gap: 10px; justify-content: center; }
  .quiz-submit-btn { width: 100%; text-align: center; }
  .nav-btn { padding: 12px 18px; font-size: 13px; min-height: 44px; }
  .login-container { padding: 25px 20px; margin: 10px; }
  .login-logo { font-size: 32px; }
  .login-btn { padding: 14px; font-size: 16px; min-height: 48px; }
  .phrase-table { font-size: 13px; }
  .phrase-table th { padding: 10px 12px; font-size: 12px; }
  .phrase-table td { padding: 8px 12px; font-size: 12px; }
  .back-btn { padding: 8px 14px; font-size: 13px; }
  .listening-card { padding: 18px; }
  .play-audio-btn { padding: 14px 24px; font-size: 16px; min-height: 48px; width: 100%; justify-content: center; }
  .take-quiz-btn { padding: 14px 24px; font-size: 15px; width: 100%; justify-content: center; }
  .content-card { padding: 18px; }
  .content-card h3 { font-size: 18px; }
  .idiom-card { padding: 15px; }
  .idiom-text { font-size: 16px; }
  .tip-card { padding: 15px; gap: 10px; }
  .tip-number { width: 32px; height: 32px; font-size: 13px; }
  .tip-content h4 { font-size: 14px; }
  .tip-content p { font-size: 13px; }
  .cta-box { padding: 25px 18px; }
  .cta-box h3 { font-size: 20px; }
  .cta-button { padding: 14px 25px; font-size: 15px; width: 100%; text-align: center; }
  .result-card { padding: 25px 18px; margin: 15px; }
  .result-score { font-size: 36px; }
  .result-actions { flex-direction: column; }
  .result-actions .nav-btn, .result-actions .take-quiz-btn, .result-actions .quiz-submit-btn { width: 100%; text-align: center; }
  .pagination { gap: 5px; }
  .page-btn { width: 32px; height: 32px; font-size: 12px; }
  .filter-tabs { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
  .filter-tab { padding: 8px 14px; font-size: 12px; white-space: nowrap; min-height: 40px; }
  .admin-search { flex-direction: column; padding: 15px; }
  .admin-search input { width: 100%; }
  .search-btn { width: 100%; }
  .student-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .student-table { min-width: 600px; }
  .tense-chart { font-size: 12px; }
  .tense-chart th, .tense-chart td { padding: 8px 10px; }
  .user-info { display: none; }
  .welcome-banner { text-align: center; }
  .module-nav { flex-direction: column; gap: 10px; }
  .module-nav .nav-btn { width: 100%; text-align: center; }
}

@media (max-width: 400px) {
  .login-container { padding: 20px 15px; }
  .login-logo { font-size: 28px; }
  .top-bar-logo { font-size: 18px; }
  .welcome-banner h1 { font-size: 18px; }
  .module-card { padding: 15px; }
  .module-card-title { font-size: 15px; }
  .question-text { font-size: 15px; }
  .option-item { font-size: 13px; padding: 10px 12px; }
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  background: var(--white);
  transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* FILTER TABS */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  border: 2px solid var(--light-gray);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--white);
  transition: all 0.3s;
}

.filter-tab:hover, .filter-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* NOTIFICATION */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 10px;
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.notification.success { background: var(--secondary); }
.notification.error { background: var(--accent); }
.notification.info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* IDIOM/PROVERB CARDS */
.idiom-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 15px;
  border-left: 4px solid var(--secondary);
}

.idiom-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.idiom-meaning {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 5px;
}

.idiom-usage {
  font-size: 14px;
  color: var(--primary);
  font-style: italic;
}

/* TIPS CARDS */
.tip-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.tip-number {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.tip-content {
  flex: 1;
}

.tip-content h4 {
  font-size: 16px;
  margin-bottom: 5px;
}

.tip-content p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
}

/* CTA BOX */
.cta-box {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: var(--white);
  border-radius: 12px;
  padding: 35px;
  text-align: center;
  margin: 25px 0;
}

.cta-box h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.cta-box p {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.cta-button {
  display: inline-block;
  padding: 14px 35px;
  background: var(--white);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* FINAL QUIZ SPECIAL */
.final-quiz-banner {
  background: linear-gradient(135deg, #ea4335, #c62828);
  color: var(--white);
  padding: 25px 30px;
  border-radius: 12px;
  margin-bottom: 25px;
  text-align: center;
}

.final-quiz-banner h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.final-quiz-banner p {
  opacity: 0.9;
}

/* ========== SPLASH SCREEN ========== */
.splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 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; }
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--gray);
  font-size: 10px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 60px;
  gap: 3px;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a .nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav a .nav-label {
  line-height: 1;
}

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

/* ========== APP-LIKE TRANSITIONS ========== */
.page-slide-in {
  animation: pageSlideIn 0.3s ease;
}

@keyframes pageSlideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.card-appear {
  animation: cardAppear 0.35s ease both;
}

@keyframes cardAppear {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Staggered animation for lists */
.module-card:nth-child(1) { animation-delay: 0.02s; }
.module-card:nth-child(2) { animation-delay: 0.04s; }
.module-card:nth-child(3) { animation-delay: 0.06s; }
.module-card:nth-child(4) { animation-delay: 0.08s; }
.module-card:nth-child(5) { animation-delay: 0.10s; }
.module-card:nth-child(6) { animation-delay: 0.12s; }
.module-card:nth-child(7) { animation-delay: 0.14s; }
.module-card:nth-child(8) { animation-delay: 0.16s; }
.module-card:nth-child(9) { animation-delay: 0.18s; }
.module-card:nth-child(10) { animation-delay: 0.20s; }

/* ========== PULL TO REFRESH INDICATOR ========== */
.ptr-indicator {
  position: fixed;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: top 0.3s;
  font-size: 18px;
}

.ptr-indicator.show {
  top: 15px;
}

/* ========== iOS SAFE AREAS ========== */
@supports (padding-top: env(safe-area-inset-top)) {
  .top-bar {
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .bottom-nav {
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ========== ANDROID CHROME ADDRESS BAR HIDE ========== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
  /* Keep light theme - SEPSAcademy branding */
}

/* ========== LANDSCAPE MODE ========== */
@media (orientation: landscape) and (max-height: 500px) {
  .splash-logo { font-size: 36px; }
  .splash-sub { font-size: 14px; margin-bottom: 15px; }
  .bottom-nav { height: 50px; }
  .bottom-nav a .nav-icon { font-size: 18px; }
  .bottom-nav a .nav-label { font-size: 9px; }
}

/* ========== TABLET / DESKTOP LARGE ========== */
@media (min-width: 1024px) {
  .bottom-nav {
    max-width: 500px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
  .modules-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .top-bar, .back-btn, .print-cert-btn, .nav-btn, .quiz-actions, .bottom-nav, .splash-screen { display: none !important; }
  .certificate { box-shadow: none; border: 8px solid #1a73e8; }
  body { padding-bottom: 0; }
}

/* ========== MODULE BOTTOM SHEET ========== */
.modules-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: var(--white);
  border: none;
  border-radius: 28px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,115,232,0.4);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.modules-fab:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}
.modules-fab-icon { font-size: 18px; }

.modules-sheet-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
}
.modules-sheet-overlay.active {
  display: block;
  opacity: 1;
}

.modules-sheet {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  max-height: 85vh;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  z-index: 10001;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.modules-sheet.active {
  transform: translateY(0);
}

.modules-sheet-handle {
  width: 40px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
  margin: 12px auto 0;
  cursor: pointer;
}

.modules-sheet-header {
  padding: 12px 20px 14px;
  border-bottom: 1px solid #e8eaed;
  flex-shrink: 0;
}
.modules-sheet-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.modules-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.modules-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}
.modules-sheet-item:active {
  background: #f1f3f4;
}
.modules-sheet-item.active {
  background: #e8f0fe;
}
.modules-sheet-item .ms-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eaed;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.modules-sheet-item.active .ms-num {
  background: #1a73e8;
  color: var(--white);
}
.modules-sheet-item .ms-info {
  flex: 1;
  min-width: 0;
}
.modules-sheet-item .ms-title {
  font-size: 14px;
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modules-sheet-item .ms-count {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.modules-sheet-item .ms-arrow {
  color: #ccc;
  font-size: 16px;
  flex-shrink: 0;
}

.modules-sheet-footer {
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #e8eaed;
  flex-shrink: 0;
}
.modules-sheet-quiz {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #34a853, #2d9249);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s;
}
.modules-sheet-quiz:active {
  transform: scale(0.97);
}

@media (min-width: 768px) {
  .modules-fab {
    bottom: 30px;
    right: 30px;
    padding: 16px 28px;
    font-size: 16px;
  }
  .modules-sheet {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }
  .modules-sheet.active {
    transform: translateX(-50%) translateY(0);
  }
}
