/* =============================================
   THE DISCIPLES' WAY KIDS APP — SHARED STYLES
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

:root {
  --gd: #032820;
  --gm: #054030;
  --gn: #085041;
  --gb: #1D9E75;
  --gl: #5DCAA5;
  --gp: #9FE1CB;
  --go: #EF9F27;
  --gol: #FAC775;
  --gop: #FAEEDA;
  --co: #D85A30;
  --col: #F0997B;
  --col-light: #FDEEE8;
  --white: #ffffff;
  --text-light: #e8f5f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(3,40,32,0.3);
  --shadow-card: 0 6px 24px rgba(3,40,32,0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--gd);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .display {
  font-family: 'Fredoka One', cursive;
  letter-spacing: 0.02em;
}

a {
  color: var(--gl);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  border: none;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

/* =============================================
   NAV BAR
   ============================================= */

#tdw-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gm);
  border-bottom: 3px solid var(--gn);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo img {
  height: 44px;
  width: 44px;
  border-radius: 50%;
}

.nav-logo-text {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--white);
  line-height: 1;
}

.nav-logo-text span {
  color: var(--go);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grade-dropdown {
  background: var(--gn);
  color: var(--white);
  border: 2px solid var(--gb);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239FE1CB' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  transition: border-color 0.2s;
}

.grade-dropdown:focus {
  border-color: var(--gl);
  outline: none;
}

.grade-dropdown option {
  background: var(--gm);
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gn);
  border: 2px solid var(--gb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.nav-avatar:hover {
  border-color: var(--go);
  transform: scale(1.1);
}

.nav-lb-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gn);
  border: 2px solid var(--gb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.nav-lb-btn:hover {
  border-color: var(--go);
  transform: scale(1.1);
  text-decoration: none;
}

/* =============================================
   PAGE LAYOUT
   ============================================= */

.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* =============================================
   CARDS
   ============================================= */

.card {
  background: var(--gn);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(93,202,165,0.1);
}

.card-gold {
  background: linear-gradient(135deg, #1a6b52, var(--gn));
  border: 2px solid var(--go);
}

.card-coral {
  background: linear-gradient(135deg, #5c1e0a, #3d1a1a);
  border: 2px solid var(--co);
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  text-decoration: none;
}

.btn-green {
  background: var(--gb);
  color: var(--gd);
}

.btn-gold {
  background: var(--go);
  color: var(--gd);
}

.btn-coral {
  background: var(--co);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gb);
  color: var(--gl);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* =============================================
   STARS
   ============================================= */

.star {
  display: inline-block;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.star.filled {
  filter: drop-shadow(0 0 6px var(--go));
  animation: star-pop 0.4s ease;
}

@keyframes star-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* =============================================
   SECTION HEADERS
   ============================================= */

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gb);
  color: var(--gd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--gl);
}

.section-star {
  margin-left: auto;
  font-size: 1.8rem;
}

/* =============================================
   LESSON SECTIONS WRAPPER
   ============================================= */

.lesson-section {
  background: var(--gn);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(93,202,165,0.12);
  box-shadow: var(--shadow);
}

.lesson-section.completed {
  border-color: var(--go);
  box-shadow: 0 0 0 2px rgba(239,159,39,0.2), var(--shadow);
}

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

.progress-bar-wrap {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

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

/* =============================================
   FEEDBACK MESSAGES
   ============================================= */

.feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 12px;
  display: none;
}

.feedback.correct {
  background: rgba(29,158,117,0.2);
  border: 2px solid var(--gb);
  color: var(--gl);
  display: block;
}

.feedback.incorrect {
  background: rgba(216,90,48,0.2);
  border: 2px solid var(--co);
  color: var(--col);
  display: block;
}

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

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

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

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes star-burst {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(2) rotate(180deg); opacity: 0; }
}

.animate-in {
  animation: fadeIn 0.4s ease forwards;
}

.shake {
  animation: shake 0.4s ease;
}

.bounce {
  animation: bounce 0.6s ease infinite;
}

/* =============================================
   TOAST NOTIFICATION
   ============================================= */

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--gm);
  border: 2px solid var(--gb);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 999;
  transition: transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   GRADE COLORS
   ============================================= */

body.grade-upper .accent { color: var(--go); }
body.grade-upper .accent-bg { background: var(--go); }
body.grade-lower .accent { color: var(--co); }
body.grade-lower .accent-bg { background: var(--co); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 600px) {
  .page-content {
    padding: 16px 12px 80px;
  }

  .lesson-section {
    padding: 16px;
  }

  .nav-logo-text {
    font-size: 1.1rem;
  }
}

.nav-lb-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gn);
  border: 2px solid var(--gb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}
.nav-lb-btn:hover {
  border-color: var(--go);
  transform: scale(1.1);
  text-decoration: none;
}
