body {
  font-family: 'Fredoka', 'Segoe UI', Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
  color: #333;
}

/* Sidebar Styles */
.sidebar {
  width: 240px;
  background: #2f3542;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  color: white;
  padding: 20px 0;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header h2 {
  color: #ffa502;
  padding: 0 20px;
  margin-bottom: 30px;
}

.nav-item {
  padding: 15px 25px;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.nav-item:hover, .nav-item.active {
  background: #57606f;
  border-left: 4px solid #ffa502;
}

.nav-item .icon { margin-right: 15px; font-size: 1.2em; }

.badge {
  background: #f1c40f;
  color: #000;
  font-size: 0.6em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 10px;
}

.main-content {
  margin-left: 240px;
  width: calc(100% - 240px);
  display: flex;
  justify-content: center;
}

/* Fullscreen Quiz Mode */
body.quiz-mode .sidebar {
  display: none;
}

body.quiz-mode .main-content {
  margin-left: 0;
  width: 100%;
}

/* Home Icon */
#home-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 2em;
  cursor: pointer;
  background: white;
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  z-index: 10;
}

.container {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 90%;
  max-width: 500px;
  border: 4px solid #fff;
  position: relative;
}

/* Fact Cards */
.fact-card {
  background: #f1f2f6;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 15px;
  text-align: left;
  border-left: 5px solid #ff4757;
}

.fact-card a {
  color: #1e90ff;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

body.dark-mode .fact-card a {
  color: #f1c40f;
}

/* Auth Modal */
#auth-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.auth-modal {
  background: white;
  width: 350px;
  border-radius: 20px;
  overflow: hidden;
  padding-bottom: 20px;
}

.auth-tabs { display: flex; background: #f1f2f6; }
.tab-btn { flex: 1; border-radius: 0; box-shadow: none; margin: 0; background: transparent; color: #333; }
.tab-btn.active { background: white; color: #1e90ff; border-bottom: 3px solid #1e90ff; }

.auth-body { padding: 20px; }
.auth-body input { width: 90%; padding: 12px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #ddd; }

#level-display {
  font-weight: 600;
  color: #ffa502;
  font-size: 1.2em;
  margin-bottom: 10px;
}

#level-dropdown {
  width: 100%;
  padding: 12px;
  border-radius: 15px;
  border: 2px solid #1e90ff;
  font-family: inherit;
  font-size: 1.1em;
  margin-bottom: 20px;
  cursor: pointer;
}

#level-grid {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  max-height: 250px;
  overflow-y: auto;
}

.level-dot {
  aspect-ratio: 1/1;
  width: 100%;
  min-height: 50px;
  background-color: #ffffff;
  border: 2px solid #1e90ff;
  color: #1e90ff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.level-dot:hover:not(.locked) {
  background-color: #1e90ff;
  color: white;
  transform: scale(1.1);
}

.level-dot.locked {
  background-color: #dcdde1;
  border-color: #7f8c8d;
  color: #7f8c8d;
  cursor: not-allowed;
  opacity: 0.6;
}

.level-dot.current {
  background-color: #ffa502;
  border-color: #ff7f50;
  color: white;
}

#progress-card {
  background: #f1f2f6;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 20px;
  font-weight: 600;
  color: #2f3542;
}

#premium-box {
  margin-top: 30px;
  padding: 20px;
  border: 3px dashed #f1c40f;
  border-radius: 20px;
  background-color: #fff9db;
}

#premium-box p {
  font-weight: 600;
  margin-bottom: 10px;
}

h1 {
  color: #ff4757;
  margin-bottom: 25px;
  font-size: 2.8em;
  text-shadow: 2px 2px #ffeaa7;
}

h2 {
  color: #2f3542;
  margin-bottom: 20px;
  font-size: 1.6em;
}

button {
  background-color: #1e90ff;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.2em;
  font-weight: 600;
  margin: 5px;
  transition: all 0.2s ease;
  box-shadow: 0 4px #0984e3;
}

button:hover {
  background-color: #3742fa;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(2px);
  box-shadow: none;
}

button:disabled {
  background-color: #ccc;
  box-shadow: none;
  cursor: not-allowed;
}

#feedback {
  margin-top: 20px;
  font-weight: 600;
  font-size: 1.3em;
}

.hidden {
  display: none !important;
}

.option-btn {
  background-color: #ffffff;
  color: #333;
  border: 3px solid #f1f2f6;
  padding: 15px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1.1em;
  margin: 5px;
  width: calc(100% - 10px); /* Adjust width to fit container with margin */
  transition: all 0.2s ease;
  box-shadow: 0 4px #dfe4ea;
}

.option-btn:hover:not(:disabled) {
  background-color: #f1f2f6;
  border-color: #1e90ff;
  transform: scale(1.02);
}

/* Answer Feedback Classes */
.option-btn.correct {
  background-color: #d4edda !important;
  border-color: #2ed573 !important;
  color: #155724;
}

.option-btn.incorrect {
  background-color: #f8d7da !important;
  border-color: #ff4757 !important;
  color: #721c24;
}

/* Dark Mode Styles */
body.dark-mode {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
}

body.dark-mode .sidebar {
  background: #1a252f;
  box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

body.dark-mode .sidebar-header h2 {
  color: #f1c40f;
}

body.dark-mode .nav-item:hover, body.dark-mode .nav-item.active {
  background: #34495e;
  border-left-color: #f1c40f;
}

body.dark-mode .container {
  background-color: rgba(44, 62, 80, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 4px solid #34495e;
}

body.dark-mode #home-icon {
  background: #34495e;
  color: #ecf0f1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

body.dark-mode h1 {
  color: #f1c40f;
  text-shadow: 2px 2px #2c3e50;
}

body.dark-mode h2 {
  color: #ecf0f1;
}

body.dark-mode .fact-card {
  background: #34495e;
  border-left-color: #f1c40f;
  color: #ecf0f1;
}

body.dark-mode #auth-overlay .auth-modal {
  background: #34495e;
  color: #ecf0f1;
}

body.dark-mode .auth-tabs {
  background: #2c3e50;
}

body.dark-mode .tab-btn {
  color: #ecf0f1;
}

body.dark-mode .tab-btn.active {
  background: #34495e;
  color: #f1c40f;
  border-bottom-color: #f1c40f;
}

body.dark-mode #level-dropdown {
  background: #2c3e50;
  color: #ecf0f1;
  border-color: #f1c40f;
}

body.dark-mode .auth-body input {
  background: #2c3e50;
  border-color: #4a627a;
  color: #ecf0f1;
}

body.dark-mode #level-display {
  color: #f1c40f;
}

body.dark-mode #level-grid {
  background: #34495e;
}

body.dark-mode .level-dot {
  background-color: #2c3e50;
  border-color: #f1c40f;
  color: #f1c40f;
}

body.dark-mode .level-dot:hover:not(.locked) {
  background-color: #f1c40f;
  color: #2c3e50;
}

body.dark-mode .level-dot.locked {
  background-color: #4a627a;
  border-color: #7f8c8d;
  color: #7f8c8d;
}

body.dark-mode .level-dot.current {
  background-color: #f1c40f;
  border-color: #f1c40f;
  color: #2c3e50;
}

body.dark-mode #progress-card {
  background: #34495e;
  color: #ecf0f1;
}

body.dark-mode #premium-box {
  border-color: #f1c40f;
  background-color: #2c3e50;
  color: #ecf0f1;
}

body.dark-mode button {
  background-color: #f1c40f;
  color: #2c3e50;
  box-shadow: 0 4px #e6b800;
}

body.dark-mode button:hover {
  background-color: #e6b800;
  transform: translateY(-2px);
}

body.dark-mode button:active {
  transform: translateY(2px);
  box-shadow: none;
}

body.dark-mode button:disabled {
  background-color: #555;
  box-shadow: none;
  color: #aaa;
}

body.dark-mode #feedback {
  color: #ecf0f1;
}

body.dark-mode .option-btn {
  background-color: #2c3e50;
  color: #ecf0f1;
  border: 3px solid #34495e;
  box-shadow: 0 4px #1a252f;
}

body.dark-mode .option-btn:hover:not(:disabled) {
  background-color: #34495e;
  border-color: #f1c40f;
}

body.dark-mode .option-btn.correct {
  background-color: #27ae60 !important;
  border-color: #2ecc71 !important;
  color: #ecf0f1;
}

body.dark-mode .option-btn.incorrect {
  background-color: #c0392b !important;
  border-color: #e74c3c !important;
  color: #ecf0f1;
}

body.dark-mode .progress-container {
  background: #34495e;
}

body.dark-mode #progress-bar-fill {
  background: linear-gradient(to right, #2ecc71, #27ae60);
}

body.dark-mode #audio-trigger {
  color: #ecf0f1;
}

/* Dark Mode for Glossary and Achievements */
body.dark-mode #glossary-search,
body.dark-mode #achievements-list {
  background: #2c3e50;
  border-color: #4a627a;
  color: #ecf0f1;
}

body.dark-mode #glossary-list .glossary-item .punjabi-word,
body.dark-mode #achievements-list .achievement-item .achievement-title {
  color: #f1c40f;
}

body.dark-mode #glossary-list .glossary-item .english-meaning,
body.dark-mode #achievements-list .achievement-item .achievement-description {
  color: #bdc3c7;
}
/* Progress Bar */
.progress-container {
  width: 100%;
  height: 10px;
  background: #f1f2f6;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #2ed573, #7bed9f);
  transition: width 0.3s ease;
}

/* Audio Trigger */
#audio-trigger {
  font-size: 1.5em;
  cursor: pointer;
  margin-bottom: 10px;
  display: inline-block;
  transition: transform 0.2s;
}

#audio-trigger:hover { transform: scale(1.2); }

/* Glossary Screen Styles */
#glossary-screen {
  text-align: left;
}

#glossary-search {
  width: calc(100% - 20px);
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
}

#glossary-container, #achievements-container {
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid rgba(0,0,0,0.05);
  border-radius: 10px;
  padding: 10px;
  background-color: rgba(0,0,0,0.02);
  margin-bottom: 20px;
}

/* Card Styles for Glossary and Achievements */
.glossary-card, .achievement-card {
  background: white;
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid #eee;
  transition: transform 0.2s;
}

.glossary-card:hover, .achievement-card.unlocked:hover {
  transform: translateY(-2px);
}

.glossary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.punjabi-word {
  font-size: 1.2em;
  font-weight: 600;
  color: #1e90ff;
}

.category-tag {
  font-size: 0.8em;
  background: #f1f2f6;
  padding: 4px 10px;
  border-radius: 20px;
  color: #747d8c;
}

.achievement-card.locked {
  opacity: 0.7;
  background: #f1f2f6;
  border-style: dashed;
}

.achievement-card.unlocked {
  border: 2px solid #f1c40f;
  background: #fffdf2;
}

#audio-trigger:hover { transform: scale(1.2); }

/* Footer Styles */
.app-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid rgba(0,0,0,0.1);
  font-size: 0.9em;
  color: #626e73;
  position: relative;
}

.footer-content p {
  margin: 5px 0;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: #1e90ff;
  text-decoration: none;
  margin: 0 5px;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Dark Mode Footer */
body.dark-mode .app-footer {
  border-top-color: rgba(255,255,255,0.1);
  color: #bdc3c7;
}

/* Dark Mode Cards */
body.dark-mode .glossary-card, body.dark-mode .achievement-card {
  background: #34495e;
  border-color: #4a627a;
  color: #ecf0f1;
}

body.dark-mode .achievement-card.locked {
  background: #2c3e50;
  color: #95a5a6;
}

body.dark-mode .category-tag {
  background: #2c3e50;
  color: #bdc3c7;
}

body.dark-mode .footer-links a {
  color: #f1c40f;
}