:root {
  --primary: #1e3a8a;
  --secondary: #3b82f6;
  --accent: #2563eb;
  --text: #1f2937;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, #3b82f6, #2563eb);
}

[data-theme="dark"] {
  --primary: #1e40af;
  --secondary: #1e3a8a;
  --accent: #60a5fa;
  --text: #e5e7eb;
  --bg: #111827;
  --card-bg: #1f2937;
  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
  line-height: 1.6;
}

header {
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 4rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 10px var(--shadow);
}

.logo {
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: white;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  font-size: 1.1rem;
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  display: flex;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  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;
  transition: 0.4s;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.theme-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: #fff;
}

.theme-icon.sun {
  display: block;
}

.theme-icon.moon {
  display: none;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

input:checked + .slider .sun {
  display: none;
}

input:checked + .slider .moon {
  display: block;
}

.vocab-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 4rem 2rem;
  background: var(--gradient);
}

.container {
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 1.5rem;
  box-shadow: 0 6px 20px var(--shadow);
  max-width: 500px;
  text-align: center;
  position: relative;
  animation: slideInDown 1s ease-out;
}

h2 {
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--gradient);
  width: 0;
  transition: width 0.5s ease;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.choices button {
  background: var(--card-bg);
  border: 1px solid var(--shadow);
  padding: 1rem;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.choices button:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px var(--shadow);
  background: var(--gradient);
  color: white;
}

.choices button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.choices button.correct {
  background: #4caf50;
  color: white;
  animation: pulse 1s ease;
}

.choices button.wrong {
  background: #ef4444;
  color: white;
  animation: shake 0.5s ease;
}

.feedback {
  margin-top: 1.5rem;
  font-family: "Poppins", sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  min-height: 2rem;
}

.score {
  margin-top: 1rem;
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  color: var(--text);
}

.next-btn,
.restart-btn {
  margin-top: 2rem;
  padding: 1rem 2rem;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: none;
}

.next-btn:hover,
.restart-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
}

footer {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 1.5rem;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  width: 100%;
}

/* Animations */
@keyframes slideInDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25%,
  75% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
}

@media (max-width: 768px) {
  header {
    padding: 1rem 2rem;
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .vocab-game {
    padding: 2rem 1rem;
  }

  .container {
    padding: 2rem;
    max-width: 90%;
  }

  h2 {
    font-size: 2rem;
  }

  .choices button {
    font-size: 1rem;
    padding: 0.8rem;
  }
}
