/* ============================================
   DUOLINGO-INSPIRED DESIGN SYSTEM
   Key values:
   - Background: #ffffff
   - Primary text: #3c3c3c
   - Muted text: #afafaf
   - Primary green: #58cc02
   - Green shadow: #58a700
   - Border: #e5e5e5
   - Border shadow: #e5e5e5
   - Correct bg: #d7ffb8
   - Wrong bg: #ffdfe0
   - Wrong red: #ff4b4b
============================================ */

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

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ffffff;
  min-height: 100vh;
  color: #3c3c3c;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================
   HEADER
============================================ */

header {
  text-align: center;
  margin-bottom: 8px;
  width: 100%;
  position: relative;
}

/* Mute button — small icon in top-right of header */
.mute-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: #f7f7f7;
  border: 2px solid #e5e5e5;
  box-shadow: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  transition: background 0.2s;
}

.mute-btn:hover {
  background: #efefef;
}

.mute-btn:active:not(:disabled) {
  transform: scale(0.95);
  box-shadow: none !important;
}

.mute-btn.muted {
  background: #ffdfe0;
  border-color: #ff4b4b;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: #3c3c3c;
  letter-spacing: -0.3px;
}

#surah-name {
  color: #afafaf;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   MODE TABS
============================================ */

.mode-tabs {
  display: flex;
  background: #e5e5e5;
  border-radius: 100px;
  padding: 4px;
  gap: 4px;
  margin: 20px 0 16px;
}

.tab-btn {
  padding: 10px 24px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: #afafaf;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:active:not(:disabled) {
  transform: none;
  box-shadow: none !important;
}

.tab-btn.active {
  background: #ffffff;
  color: #3c3c3c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ============================================
   PROGRESS
============================================ */

.progress {
  font-size: 0.8rem;
  font-weight: 800;
  color: #afafaf;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#word-progress {
  margin-left: 6px;
  color: #58cc02;
}

/* ============================================
   FLASHCARD VIEW
============================================ */

#flashcard-view {
  width: 100%;
}

.card-container {
  width: 100%;
  height: 240px;
  perspective: 1000px;
  margin-bottom: 20px;
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid #e5e5e5;
  box-shadow: 0 4px 0 #e5e5e5;
}

.card-back {
  transform: rotateY(180deg);
}

/* ============================================
   TYPOGRAPHY
============================================ */

.arabic {
  font-size: 2rem;
  line-height: 1.8;
  font-family: 'Traditional Arabic', 'Scheherazade', serif;
  direction: rtl;
  color: #3c3c3c;
  font-weight: 700;
}

.hint {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #afafaf;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transliteration {
  font-style: italic;
  color: #afafaf;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.meaning {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #3c3c3c;
  font-weight: 800;
}

/* ============================================
   BUTTONS — BASE
============================================ */

button {
  font-family: 'Nunito', inherit;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  border-radius: 12px;
  padding: 14px 24px;
  transition: all 0.1s;
  border: 2px solid transparent;
}

button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: none !important;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Audio button */
.audio-btn {
  background: #ffffff;
  color: #1cb0f6;
  border: 2px solid #1cb0f6;
  box-shadow: 0 4px 0 #0090d9;
  margin-bottom: 20px;
  width: 100%;
}

.audio-btn:hover:not(:disabled) {
  background: #e8f7fe;
}

/* Nav buttons */
.nav-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}

#prev-btn {
  flex: 1;
  background: #ffffff;
  color: #afafaf;
  border: 2px solid #e5e5e5;
  box-shadow: 0 4px 0 #e5e5e5;
}

#prev-btn:hover:not(:disabled) {
  background: #f7f7f7;
}

#next-btn {
  flex: 1;
  background: #58cc02;
  color: #ffffff;
  border: 2px solid #58a700;
  box-shadow: 0 4px 0 #58a700;
}

#next-btn:hover:not(:disabled) {
  background: #61d900;
}

/* ============================================
   MCQ VIEW
============================================ */

#mcq-view {
  width: 100%;
}

.mcq-card {
  background: #ffffff;
  border: 2px solid #e5e5e5;
  box-shadow: 0 4px 0 #e5e5e5;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  overflow: hidden;
}

.mcq-card .arabic {
  color: #3c3c3c;
  margin-bottom: 8px;
}

.mcq-card .transliteration {
  color: #afafaf;
  font-style: italic;
}

/* MCQ answers block */
#mcq-answers {
  width: 100%;
  margin-bottom: 16px;
}

/* Feedback text */
.feedback {
  font-weight: 800;
  min-height: 22px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback.correct {
  color: #58cc02;
}

.feedback.wrong {
  color: #ff4b4b;
}

/* MCQ options — 2x2 grid, Duolingo raised style */
.mcq-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.mcq-option {
  background: #ffffff;
  color: #3c3c3c;
  border: 2px solid #e5e5e5;
  box-shadow: 0 4px 0 #e5e5e5;
  padding: 16px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.mcq-option:hover:not(:disabled) {
  border-color: #84d8ff;
  box-shadow: 0 4px 0 #84d8ff;
  background: #f7f7f7;
}

.mcq-option:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: none;
}

/* Correct answer */
.mcq-option.correct {
  background: #d7ffb8;
  border-color: #58cc02;
  box-shadow: 0 4px 0 #58a700;
  color: #3c3c3c;
  animation: pulse 0.3s;
}

/* Wrong answer */
.mcq-option.wrong {
  background: #ffdfe0;
  border-color: #ff4b4b;
  box-shadow: 0 4px 0 #ea2b2b;
  color: #3c3c3c;
  animation: shake 0.3s;
}

/* ============================================
   UTILITY
============================================ */

.hidden {
  display: none !important;
}

/* ============================================
   ANIMATIONS
============================================ */

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
