:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-input: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-red: #ef4444;
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-wrong: #f43f5e;
  --border-color: #334155;
  --shadow-glow: 0 0 20px rgba(239, 68, 68, 0.25);
  --radius-lg: 16px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', 'Noto Sans Sinhala', 'Noto Sans JP', sans-serif;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(239, 68, 68, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  -webkit-tap-highlight-color: transparent;
}

/* Typography */
.jp-font {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background-color: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

.badge-brand {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: inline-block;
  margin-bottom: 2px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  gap: 6px;
}

.nav-btn {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-btn:hover {
  border-color: var(--accent-red);
  color: #fff;
}

/* Main Container */
.app-container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1.2rem 1rem;
  overflow-x: hidden;
}

/* Screens */
.screen {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
  display: block;
}

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

/* Screen 1: Home / Hero Card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.hero-card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  color: #fff;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Papers Grid */
.papers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.papers-header h3 {
  font-size: 1.2rem;
  color: #fff;
}

.btn-create-paper-quick {
  background: var(--bg-input);
  border: 1px dashed var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-create-paper-quick:hover {
  background: rgba(6, 182, 212, 0.15);
}

.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.paper-card {
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.paper-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.15);
}

.paper-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-input) 100%);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.paper-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.6rem;
}

.paper-card-icon {
  font-size: 1.8rem;
}

.paper-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.paper-card-sinhala {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.paper-card-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #1e293b;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: auto;
}

.paper-action-panel {
  border-top: 1px solid var(--border-color);
  padding-top: 1.8rem;
  animation: fadeIn 0.3s ease;
}

.selected-paper-banner {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 1.5rem;
  text-align: left;
}

.paper-icon-lg {
  font-size: 2.2rem;
}

.selected-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.selected-paper-info h3 {
  font-size: 1.3rem;
  color: #fff;
}

.selected-paper-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge-paper {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-right: 8px;
}

.badge-section {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  margin-right: 8px;
}

.result-paper-name {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-grid-paper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.create-paper-box {
  border: 1px dashed var(--border-color);
}

.stat-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  min-width: 140px;
}

.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mode-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.mode-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.15);
}

.mode-card.highlight {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-input) 100%);
}

.mode-card.highlight:hover {
  border-color: var(--accent-red);
  box-shadow: var(--shadow-glow);
}

.mode-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.mode-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.mode-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1.2rem;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background: #1e293b;
}

/* Screen 2: Quiz */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.8rem;
}

.quiz-progress-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-mode {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  margin-right: 10px;
}

.question-tracker {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.quiz-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.jump-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-jump-lock {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-jump-lock:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-1px);
}

.jump-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jump-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.jump-select {
  background: var(--bg-input);
  color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 220px;
  transition: all 0.2s ease;
}

.jump-select:hover, .jump-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.jump-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 4px;
}

.btn-relock-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-relock-icon:hover {
  color: var(--accent-wrong);
  background: rgba(239, 68, 68, 0.15);
}

/* Password Auth Modal */
.modal-card-auth {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: fadeIn 0.2s ease;
}

.modal-auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-close-btn {
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.timer-container {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: var(--bg-input);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-red));
  transition: width 0.3s ease;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.question-instruction {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: #f1f5f9;
  line-height: 1.5;
}

.question-instruction.text-prompt-mode {
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  padding: 1.2rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.review-thumb-icon {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 320px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: #0f172a;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.image-wrapper:hover {
  border-color: var(--accent-cyan);
}

.quiz-image {
  width: 100%;
  height: 240px;
  object-fit: contain;
  display: block;
}

.zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Options Grid */
.options-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: #253349;
  transform: translateY(-2px);
}

.option-btn-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-thumb-img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.option-btn.image-option-btn {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.2rem 1rem;
  position: relative;
  min-height: 180px;
  background: #0f172a;
}

.option-btn.image-option-btn .option-num-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.option-img-large {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s ease;
  display: block;
}

.option-btn.image-option-btn:hover:not(:disabled) .option-img-large {
  transform: scale(1.04);
}

.option-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
}

.option-text-group {
  display: flex;
  flex-direction: column;
}

.option-main-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 1px;
}

.option-sub-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.option-btn.selected-correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--accent-green) !important;
}

.option-btn.selected-correct .option-num-badge {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.option-btn.selected-wrong {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: var(--accent-wrong) !important;
}

.option-btn.selected-wrong .option-num-badge {
  background: var(--accent-wrong);
  color: white;
  border-color: var(--accent-wrong);
}

.option-btn.selected-choice {
  background: rgba(6, 182, 212, 0.2) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3) !important;
}

.option-btn.selected-choice .option-num-badge {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
}

/* Feedback Card */
.feedback-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.feedback-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-speak {
  margin-left: auto;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-speak:hover {
  border-color: var(--accent-cyan);
}

.feedback-content {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Screen 3: Results */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
}

.results-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.results-badge.pass {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.results-badge.fail {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-wrong);
  border: 1px solid var(--accent-wrong);
}

.score-circle-wrapper {
  margin: 1.5rem auto;
  display: flex;
  justify-content: center;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
}

.score-percent {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
}

.score-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.score-message {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #e2e8f0;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

/* Review List */
.review-section {
  text-align: left;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.review-section h3 {
  margin-bottom: 1.2rem;
  color: #f1f5f9;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.review-item.wrong {
  border-left: 4px solid var(--accent-wrong);
}

.review-item.correct {
  border-left: 4px solid var(--accent-green);
}

.review-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: #1e293b;
}

.review-details {
  flex: 1;
}

.review-details .q-num {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.review-details .word-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
}

/* Screen 4: Editor */
.editor-container {
  max-width: 800px;
  margin: 0 auto;
}

.editor-header {
  margin-bottom: 1.5rem;
}

.editor-header h2 {
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #cbd5e1;
}

.text-input, .file-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
}

.text-input:focus {
  border-color: var(--accent-cyan);
}

.image-input-choice {
  display: flex;
  align-items: center;
  gap: 10px;
}

.or-divider {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.image-preview-container {
  margin-top: 10px;
}

.image-preview-container img {
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.distractor-helper-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.helper-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.btn-helper {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-helper:hover {
  filter: brightness(1.1);
}

.options-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.editor-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.existing-questions-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.existing-questions-box h3 {
  margin-bottom: 1rem;
}

.editor-questions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-q-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-q-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-q-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: #334155;
}

.btn-delete-q {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-wrong);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-delete-q:hover {
  background: var(--accent-wrong);
  color: white;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 80%;
  max-height: 80%;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

/* Site Master Lock Screen Overlay */
.site-lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #090d16 60%, #030712 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  animation: fadeIn 0.3s ease;
}

.site-lock-card {
  background: rgba(15, 23, 42, 0.94);
  border: 2px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 60px rgba(239, 68, 68, 0.25), 0 25px 50px rgba(0, 0, 0, 0.85);
  border-radius: var(--radius-lg);
  padding: 2.8rem 2.2rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.site-lock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #ef4444);
  background-size: 200% 100%;
  animation: lockShimmer 3s infinite linear;
}

@keyframes lockShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.site-lock-icon-wrapper {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 1.4rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-lock-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.22);
  animation: lockPulse 2s infinite ease-out;
}

@keyframes lockPulse {
  0% { transform: scale(0.85); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 0.15; }
  100% { transform: scale(0.85); opacity: 0.85; }
}

.site-lock-icon {
  font-size: 3rem;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.6));
}

.site-lock-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 1.1rem;
}

.site-lock-warning {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ff4d4d;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.55);
  margin-bottom: 0.9rem;
  line-height: 1.4;
  font-family: 'Noto Sans Sinhala', 'Poppins', sans-serif;
}

.site-lock-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.8rem;
}

.site-lock-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-lock-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.site-lock-input-icon {
  position: absolute;
  left: 14px;
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 2;
}

.site-lock-input {
  width: 100%;
  background: #090d16;
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 14px 44px 14px 44px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-family: inherit;
  letter-spacing: 1px;
  outline: none;
  transition: all 0.25s ease;
}

.site-lock-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
  background: #0c1222;
}

.btn-toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 4px;
  transition: color 0.2s ease;
}

.btn-toggle-pass:hover {
  color: #fff;
}

.site-lock-error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: lockShake 0.4s ease-in-out;
}

@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.site-lock-btn {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.site-lock-btn:hover {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.6);
  transform: translateY(-2px);
}

.site-lock-footer-text {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 1.6rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Mobile Responsive Media Queries */
@media (max-width: 768px) {
  .navbar {
    padding: 0.6rem 0.8rem;
  }
  .brand-title {
    font-size: 1rem;
  }
  .badge-brand {
    font-size: 0.65rem;
  }
  .nav-btn {
    font-size: 0.75rem;
    padding: 5px 8px;
  }
  .hero-card {
    padding: 1.5rem 1rem;
  }
  .hero-card h2 {
    font-size: 1.3rem;
  }
  .papers-grid {
    grid-template-columns: 1fr;
  }
  .mode-selection {
    grid-template-columns: 1fr;
  }
  .options-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .option-btn {
    padding: 1rem 0.8rem;
  }
  .option-main-text {
    font-size: 1.35rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-paper {
    grid-template-columns: 1fr;
  }
  .options-edit-grid {
    grid-template-columns: 1fr;
  }
  .image-wrapper {
    max-width: 100%;
  }
  .quiz-image {
    height: 190px;
  }
  .selected-paper-banner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .review-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .review-thumb {
    width: 100px;
    height: 100px;
  }
  .distractor-helper-box {
    flex-direction: column;
    text-align: center;
  }
}
