/* Variables */
:root {
  --primary: #4E73E9;
  --primary-light: #8BA0F0;
  --primary-dark: #214BD1;
  --secondary: #FF9A3C;
  --secondary-light: #FFBB7A;
  --secondary-dark: #E87A1C;
  --accent: #FF5D8F;
  --background: #F8F9FE;
  --text: #333;
  --text-light: #666;
  --success: #46CC8F;
  --border-radius: 12px;
  --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Comic Neue', cursive;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Header */
header {
  background-color: white;
  padding: 16px 24px;
  box-shadow: var(--box-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.logo h1 {
  font-size: 28px;
  color: var(--primary);
  margin: 0;
}

.tagline {
  font-size: 18px;
  color: var(--accent);
  margin: 0;
}

/* Navigation */
.main-nav {
  background-color: var(--primary);
  padding: 12px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.main-nav a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  transition: var(--transition);
}

.main-nav a:hover, 
.main-nav a.active {
  background-color: var(--primary-dark);
}

.main-nav a img {
  width: 24px;
  height: 24px;
}

/* Main content */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

.character-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.character {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speech-bubble {
  background-color: white;
  border-radius: 20px;
  padding: 12px 16px;
  box-shadow: var(--box-shadow);
  margin-top: 16px;
  position: relative;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid white;
}

.speech-bubble.hidden {
  display: none;
}

/* Controls panel */
.controls-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background-color: white;
  padding: 12px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.filter-controls {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-btn {
  background-color: var(--primary-light);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary);
}

.sound-controls button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Syllable grid */
.syllabe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.syllabe-item {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  cursor: pointer;
}

.syllabe-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.syllabe-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.syllabe-content {
  padding: 12px;
  text-align: center;
}

.syllabe-text {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 4px;
}

.syllabe-word {
  font-size: 16px;
  color: var(--text-light);
}

/* Progress tracker */
.progress-tracker {
  background-color: white;
  padding: 16px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-top: 24px;
}

.progress-tracker h3 {
  margin-bottom: 12px;
  text-align: center;
}

.progress-bar {
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background-color: var(--success);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-tracker p {
  text-align: center;
  font-weight: bold;
  color: var(--text-light);
}

/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background-color: white;
  border-radius: var(--border-radius);
  max-width: 90%;
  width: 500px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: popIn 0.3s forwards;
}

@keyframes popIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-text {
  padding: 20px;
  text-align: center;
}

.popup-text h2 {
  font-size: 36px;
  color: var(--primary);
  margin-bottom: 8px;
}

.popup-text p {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 20px;
}

.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text);
  transition: var(--transition);
}

.close-btn:hover {
  background-color: var(--accent);
  color: white;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-family: 'Comic Neue', cursive;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn.primary {
  background-color: var(--primary);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-dark);
}

.btn.secondary {
  background-color: var(--secondary);
  color: white;
}

.btn.secondary:hover {
  background-color: var(--secondary-dark);
}

/* Footer */
footer {
  background-color: white;
  padding: 16px 24px;
  text-align: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

/* Utility classes */
.hidden {
  display: none;
}

/* Animation for discovered syllables */
@keyframes discover {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.discovered {
  animation: discover 0.6s;
  border: 3px solid var(--success);
}

/* Sound button states */
.sound-on img {
  opacity: 1;
}

.sound-off img {
  opacity: 0.5;
}

/* Responsive design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .nav-container {
    flex-wrap: wrap;
  }
  
  .syllabe-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  
  .popup-content {
    max-width: 95%;
  }
  
  .controls-panel {
    flex-direction: column;
    gap: 16px;
  }
  
  .filter-controls {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    padding: 0 16px;
  }
  
  .main-nav a {
    width: 100%;
  }
  
  .syllabe-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .popup-text h2 {
    font-size: 28px;
  }
  
  .popup-text p {
    font-size: 18px;
  }
  
  .popup-buttons {
    flex-direction: column;
  }
}