:root {
  --bg-color: #f9f9f9;
  --text-color: #333;
  --container-bg: #ffffff;
  --input-bg: #ffffff;
  --input-border: #ccc;
  --key-bg: #f1f1f1;
  --highlight: #007bff;
  --correct: #28a745;
  --incorrect: #dc3545;
  --shadow: rgba(0, 0, 0, 0.08);
}

body.dark {
  --bg-color: #1e1e2f;
  --text-color: #f5f5f5;
  --container-bg: #2b2b3d;
  --input-bg: #3b3b4e;
  --input-border: #555;
  --key-bg: #44475a;
  --highlight: #61dafb;
  --correct: #00e676;
  --incorrect: #ff5252;
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 40px;
  transition: background-color 0.3s, color 0.3s;
}

/* Hero Area Styles */
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&family=Roboto&display=swap');

body {
  font-family: 'Roboto', sans-serif;
  margin: 0; padding: 0;
}

/* Hero Area */
.hero-area {
  width: 100vw;
  height: 320px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
  box-sizing: border-box;
  color: #f0f9ff;
}

/* Gradient overlay pattern */
.hero-area {
  width: 100vw;
  height: 320px;
  background: linear-gradient(135deg, #a8edea, #fed6e3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
  box-sizing: border-box;
  color: #1e293b; /* dark text for light background */
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
}

/* Gradient overlay pattern (optional, subtle) */
.hero-area::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(255 255 255 / 0.3) 1px, transparent 2px);
  background-size: 60px 60px;
  animation: movePattern 30s linear infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes movePattern {
  from { background-position: 0 0; }
  to { background-position: 60px 60px; }
}

/* Adjust text colors for light bg */
.hero-slide .hero-text {
  color: #1e293b;
}

.hero-slide .hero-heading {
  color: #0f172a;
}

.hero-slide .hero-subtext {
  color: #334155;
}

.hero-btn {
  background: #3b82f6;
  color: white;
  box-shadow: 0 0 12px #93c5fd;
}

.hero-btn:hover {
  background: #2563eb;
  box-shadow: 0 0 18px #2563eb;
}

.hero-image img {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Slides */
.hero-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
  padding: 0 60px;
  box-sizing: border-box;
  z-index: 2;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  animation: scaleUpFade 1s ease forwards;
}

@keyframes scaleUpFade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Text area */
.hero-text {
  max-width: 45%;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  animation-name: slideInLeft;
  position: relative;
  z-index: 3;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.hero-heading {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 3rem;
  margin: 0 0 15px 0;
  line-height: 1.1;
  color: #eff6ff;
  min-height: 4rem;
}

.hero-subtext {
  font-size: 1.25rem;
  margin-bottom: 25px;
  line-height: 1.6;
  color: #dbeafe;
}

.hero-btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1.1rem;
  background: #d70c1d;
  color: #8af409;
  font-weight: 600;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 0 10px #0f1011;
  transition: all 0.3s ease;
  user-select: none;
}

.hero-btn:hover {
  background: #122139;
  box-shadow: 0 0 15px #272a31;
  color: white;
  transform: translateY(-3px);
}

/* Image area */
.hero-image {
  max-width: 45%;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  animation-name: slideInRight;
  position: relative;
  z-index: 3;
}

@keyframes slideInRight {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.hero-image img {
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Typed cursor */
.cursor {
  display: inline-block;
  font-weight: 600;
  color: #60a5fa;
  animation: blink 1.2s infinite;
  user-select: none;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-area {
    flex-direction: column;
    height: auto;
    padding: 40px 20px;
  }
  .hero-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
  box-sizing: border-box;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  animation: scaleUpFade 1s ease forwards;
}


  .hero-text, .hero-image {
    max-width: 100%;
    text-align: center;
    animation: none !important;
  }
  .hero-text {
    margin-bottom: 30px;
  }
  .hero-heading {
    font-size: 2.2rem;
    min-height: auto;
  }
  .hero-image img {
    max-width: 280px;
  }
}
.hero-slide:not(.active) {
  display: flex; /* Keep flex for layout */
  visibility: hidden;
  height: 0;
  overflow: hidden;
}
.container {
  max-width: 1000px;
  margin: auto;
  background: var(--container-bg);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 0 10px var(--shadow);
  text-align: center;
  transition: background 0.3s;
}

h1 {
  font-size: 32px;
  margin-bottom: 20px;
}

.virtual-keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.key-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.key {
  min-width: 40px;
  height: 40px;
  background-color: var(--key-bg);
  border-radius: 4px;
  box-shadow: 0 2px 4px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 16px;
  padding: 0 10px;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}

.key.wide {
  min-width: 80px;
}

.key.space {
  min-width: 240px;
}

.key.highlight {
  background-color: var(--highlight);
  color: white;
}

.key.correct,
.key-correct {
  background-color: var(--correct) !important;
  color: white;
}

.key.incorrect,
.key-incorrect {
  background-color: var(--incorrect) !important;
  color: white;
}

.key-hint {
  box-shadow: 0 0 10px 3px #4caf50;
  animation: pulse 0.8s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 10px 2px #4caf50;
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 15px 4px #66ff66;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px 2px #4caf50;
  }
}

#typing-box-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  border: 1px solid var(--input-border);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  background: var(--container-bg);
  box-shadow: inset 0 1px 3px var(--shadow);
}

#typing-box {
  display: inline-flex;
  gap: 12px;
  font-size: 24px;
}

.word {
  padding: 6px 12px;
  border-radius: 6px;
  background-color: #eee;
  transition: 0.3s;
  display: inline-block;
}

body.dark .word {
  background-color: #3b3b4e;
}

.word.current {
  background-color: var(--highlight);
  color: white;
  font-weight: 500;
}

.word.correct {
  background-color: var(--correct);
  color: white;
}

.word.incorrect {
  background-color: var(--incorrect);
  color: white;
}

body.dark .word.current {
  background-color: var(--highlight) !important;
  color: #121212 !important;
}

body.dark .word.correct {
  background-color: var(--correct) !important;
  color: #121212 !important;
}

body.dark .word.incorrect {
  background-color: var(--incorrect) !important;
  color: #121212 !important;
}

#typing-input {
  width: 60%;
  padding: 12px;
  font-size: 18px;
  background-color: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 6px;
  outline: none;
  transition: 0.3s;
  color: var(--text-color);
}

#typing-input:focus {
  border-color: var(--highlight);
}

#feedback {
  margin-top: 20px;
  font-size: 18px;
}

#stats {
  margin-bottom: 10px;
  font-size: 18px;
}

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: var(--highlight);
}

input:checked + .slider:before {
  transform: translateX(22px);
}
