/* === Base Styles === */
body {
  font-family: 'Poppins', Arial, sans-serif;
  background-color: #f7f8fa;
  margin: 0;
  padding: 0 0 60px 0; /* leave space for footer */
  color: #333;
  line-height: 1.6;
}

h1, h2, h3 {
  font-weight: 600;
  color: #111;
}

p {
  font-weight: 400;
  color: #444;
}

/* === Header === */
header {
  background: linear-gradient(to right, #2196f3, #42a5f5);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

/* User display (top-right) */
.user-display {
  position: absolute;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
}

.user-display a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.user-display a:hover {
  opacity: 0.8;
}

/* === Cards === */
.card {
  background: white;
  margin: 1.5rem auto;
  padding: 1.8rem;
  border-radius: 12px;
  max-width: 750px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-left 0.3s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Highlighted card (when clicked/selected) */
.card.active {
  background: #e3f2fd;
  border-left: 5px solid #2196f3;
  color: #0d47a1;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* === Buttons === */
.btn, button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: #2196f3;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.btn:hover, button:hover {
  background: #1976d2;
  transform: translateY(-2px);
}

.btn.secondary {
  background: #90a4ae;
}

.btn.secondary:hover {
  background: #607d8b;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: -240px;
  width: 235px;
  height: 100%;
  background: #1e88e5;
  color: white;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  opacity: 0;
  transition: left 0.6s ease-in-out, opacity 0.6s ease-in-out;
  z-index: 1000;
}

.sidebar.open {
  left: 0;
  opacity: 1;
}

/* Support JS toggling with .visible / .hidden as well */
.sidebar.visible {
  left: 0;
  opacity: 1;
}

.sidebar.hidden {
  left: -240px;
  opacity: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.sidebar ul li {
  margin: 1rem 0;
}

.sidebar ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  display: block;
  transition: background 0.3s, padding-left 0.3s;
}

.sidebar ul li a:hover {
  background: rgba(255, 255, 255, 0.2);
  padding-left: 1.4rem;
}

.sidebar ul li a.active {
  background: #e3f2fd;
  border-left: 5px solid #2196f3;
  color: #2196f3;
  font-weight: bold;
  display: block;
  padding-left: 0.9rem;
}

/* Hamburger */
.hamburger {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 1100;
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.sidebar.open .close-btn {
  opacity: 1;
}

/* === Footer === */
footer {
  background: #2196f3;
  color: white;
  text-align: center;
  padding: 1rem;
  position: fixed;
  bottom: 0;
  width: 100%;
  font-size: 0.9rem;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.08);
}

/* === Hero Section === */
.hero {
  background: linear-gradient(to right, #42a5f5, #64b5f6);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* === Animations === */
.card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html {
  scroll-behavior: smooth;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.2rem;
  }
  .hero { padding: 2rem 1rem; }
  .hero h2 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
  .card { margin: 1rem; padding: 1.2rem; }
  footer { font-size: 0.8rem; padding: 0.8rem; }
}

/* === Typing Box === */
#typing-box {
  width: 100%;
  max-width: 640px;
  min-height: 220px;
  font-size: 1.1rem;
  font-family: 'Poppins', monospace;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: none;
  line-height: 1.5;
}

/* Finger Circles */
.finger-dots {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  gap: 4rem;
}
.hand-group {
  display: flex;
  gap: 0.6rem;
}
.finger-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #90caf9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  color: #0d47a1;
  transition: background 0.3s;
}
.finger-dot.active {
  background: #1976d2;
  color: #fff;
}

/* === Typing Speed Timer === */
.time-picker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0;
}
.timer-display {
  font-size: 2rem;
  font-weight: bold;
  color: #2196f3;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: #f7f9fc;
  display: inline-block;
  min-width: 100px;
  text-align: center;
}
.timer-buttons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.stats {
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* === Layout Adjustment === */
main {
  display: flex;
  justify-content: center;   /* ✅ keeps both columns centered */
  align-items: flex-start;
  gap: 2.5rem;
  padding: 2rem;
  max-width: 1200px;         /* ✅ content not full-width */
  margin: 0 auto;
}

/* Left column (lesson + typing area) */
.lesson-content {
  flex: 1.2;
  min-width: 550px;
  max-width: 700px;
}

/* Right column (timer + guide) */
.right-column {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;   /* ✅ aligns boxes with left edge */
  margin-right: 2rem;        /* ✅ empty space on right for ads */
}
.wpm-section,
.finger-guide {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  box-sizing: border-box;
}
.finger-guide h3 {
  margin-top: 0;
  color: #2196f3;
  font-weight: 600;
}
.finger-guide ul { list-style: none; padding-left: 0; }
.finger-guide li { margin: 0.3rem 0; font-size: 0.95rem; }
/* Style all typing boxes across lessons */
textarea[id^="typing-box"] {
  width: 100%;
  max-width: 640px;
  min-height: 220px;
  font-size: 1.1rem;
  font-family: 'Poppins', monospace;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: none;
  line-height: 1.5;
  box-sizing: border-box;
  display: block;
  margin-top: 1rem;
}
/* --- Lesson page layout (two columns, ad gutter on far right) --- */
main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* left column */
.lesson-content {
  flex: 1 1 700px;
  min-width: 560px;
  max-width: 720px;
}

/* make the drill line prominent */
.drill {
  font-size: 1.25rem;
  margin: 0.4rem 0 0.6rem;
}
.drill code { font-weight: 600; }

/* quick finger-placement bullets */
.placement {
  margin: 0 0 0.6rem;
  padding-left: 1.2rem;
}
.placement li { margin: 0.2rem 0; }

/* voice toggle spacing */
.voice-toggle { display:inline-flex; align-items:center; gap:.5rem; margin: .4rem 0 .6rem; }

/* typing textarea, consistent across lessons */
textarea[id^="typing-box"] {
  width: 100%;
  max-width: 640px;
  min-height: 220px;
  font-size: 1.1rem;
  font-family: 'Poppins', monospace;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: none;
  line-height: 1.5;
  box-sizing: border-box;
  display: block;
  margin-top: .4rem;
}

/* finger circles below the box — keep inside left column width */
.finger-dots {
  margin-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;      /* match typing box width */
  gap: 3.5rem;
}
.hand-group { display:flex; gap:.6rem; }
.finger-dot {
  width: 42px; height: 42px; border-radius: 50%;
  background: #90caf9; color:#0d47a1; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  transition: background .3s;
}
.finger-dot.active { background:#1976d2; color:#fff; }

/* place next-lesson button right under the circles */
.next-lesson-btn { display:none; margin-top: .9rem; }

/* right column with fixed width so it doesn’t drift; leave ad gutter */
.right-column {
  flex: 0 0 340px;         /* fixed column width */
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: flex-start; /* left edges align */
  margin-right: 2.2rem;    /* empty space at far right for ads */
}

/* timer & finger-guide cards */
.wpm-section,
.finger-guide {
  width: 100%;
  max-width: 340px;
  background:#fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  box-sizing: border-box;
}

.finger-guide h3 { margin:0 0 .6rem; color:#2196f3; font-weight:600; }
.finger-guide ul { list-style:none; padding-left:0; margin:0; }
.finger-guide li { margin:.28rem 0; font-size:.95rem; }

/* timer internals */
.timer-inputs {
  display:flex; gap:1rem; justify-content:center; margin: .6rem 0;
}
.timer-inputs input {
  width: 70px; padding:.45rem; text-align:center;
  border:1px solid #ccc; border-radius:6px; font-size:1rem;
}
.timer-display {
  font-size: 2.2rem; font-weight:700; color:#2196f3;
  background:#f7f9fc; border-radius:10px;
  padding:.6rem 1.1rem; display:inline-block; min-width:110px; margin:.4rem 0 .6rem;
}
.timer-buttons { display:flex; gap:.6rem; justify-content:center; }
.stats { margin-top:.6rem; font-size:.95rem; }

/* keep things usable on tablets/phones */
@media (max-width: 1024px) {
  main { gap: 1.6rem; padding: 1.4rem; }
  .lesson-content { min-width: 0; max-width: 100%; }
  .right-column { flex: 0 0 300px; margin-right: 1rem; }
  .wpm-section, .finger-guide { max-width: 300px; }
  .finger-dots { max-width: 100%; gap: 2.2rem; }
}
@media (max-width: 768px) {
  .lesson.active { flex-direction: column; }
  .right-column { align-items:center; margin-right:0; width:100%; flex:0 0 auto; }
  .wpm-section, .finger-guide { max-width: 520px; }
  .finger-dots { justify-content:center; }
}
/* === Progress Roadmap === */
.progress-roadmap {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.level {
  margin-bottom: 2.5rem;
}

.level h3 {
  color: #2196f3;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.level ul {
  list-style: none;
  padding: 0;
}

.lesson-item {
  background: #fff;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-weight: 500;
}

.lesson-item i.locked {
  color: #bbb;
}

.lesson-item.completed {
  background: #e3f2fd;
  color: #0d47a1;
  border-left: 5px solid #2196f3;
}
/* === Progress Report === */
.roadmap {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.roadmap h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: #2196f3;
}
.roadmap ul {
  list-style: none;
  padding: 0;
}
.roadmap li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  font-size: 1.05rem;
}
.roadmap li.completed {
  color: #2196f3;
  font-weight: bold;
}
.roadmap li.locked {
  color: #bbb;
}
/* === Lesson textarea fix === */
textarea {
  width: 100%;
  max-width: 640px;
  min-height: 220px;
  font-size: 1.1rem;
  font-family: 'Poppins', monospace;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: none;
  line-height: 1.5;
  box-sizing: border-box;
  display: block;
  margin-top: 0.6rem;
}

/* === Lesson Roadmap Styles === */
.progress-roadmap {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.level h3 {
  color: #2196f3;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  margin: 1rem 0;
}

.level ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.2rem 0;
}

.lesson-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

.lesson-item:hover {
  background: #f1f1f1;
  transform: translateX(4px);
}

/* States */
.lesson-item.locked {
  color: #bbb;
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none; /* prevents clicking */
  background: #e0e0e0;
  position: relative;
  transition: background 0.3s;
}
.lesson-item.locked:hover {
  background: #d6d6d6;
}

.lesson-item.completed {
  background: #d4edda; /* green background */
  color: #2e7d32; /* dark green text */
  border-left: 5px solid #2e7d32;
  position: relative;
  transition: background 0.3s, transform 0.3s;
}
.lesson-item.completed:hover {
  background: #c3e6cb;
  transform: translateX(6px);
}

.lesson-item.attempted {
  background: #d0e7ff; /* light blue background */
  color: #1565c0; /* dark blue text */
  border-left: 5px solid #1565c0;
  position: relative;
  transition: background 0.3s, transform 0.3s;
}
.lesson-item.attempted:hover {
  background: #a9d0ff;
  transform: translateX(6px);
}

.lesson-item.unlocked {
  background: #fff8dc; /* light yellowish background */
  color: #8a6d1b; /* dark goldenrod text */
  border-left: 5px solid #d6b800;
  position: relative;
  transition: background 0.3s, transform 0.3s;
}
.lesson-item.unlocked:hover {
  background: #fff3b0;
  transform: translateX(6px);
}

/* Status icon next to lesson text */
.status-icon {
  display: inline-block;
  width: 1.5rem;
  text-align: center;
  font-weight: bold;
  margin-right: 0.6rem;
  user-select: none;
  font-size: 1.2rem;
  line-height: 1;
}

/* Completed lessons (green checkmark) */
.lesson-item.completed .status-icon::before {
  content: "✅";
  color: #2e7d32;
}

/* Attempted lessons (blue smiley) */
.lesson-item.attempted .status-icon::before {
  content: "😊";
  color: #1565c0;
}

/* Unlocked lessons (yellow hourglass) */
.lesson-item.unlocked .status-icon::before {
  content: "⏳";
  color: #d6b800;
}

/* Locked lessons (grey lock) */
.lesson-item.locked .status-icon::before {
  content: "🔒";
  color: #888;
}
.forgot-password {
  text-align: center;
  margin-top: 10px;
}

.forgot-password a {
  color: #007bff;
  font-size: 0.9rem;
  text-decoration: none;
}

.forgot-password a:hover {
  text-decoration: underline;
}
.navbar {
  background: linear-gradient(to right, #2196f3, #42a5f5);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.navbar .logo {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}