/* Multiplayer Styles */
.multiplayer-setup, .player-turn, .survival-setup, .survival-quiz-container {
  background: white;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.setup-header, .survival-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 20px 20px 0 0;
  text-align: center;
  position: relative;
   display: flex;
  justify-content: space-between;
  align-items: center;
}

.survival-header h2 {
  flex: 1;
  margin: 0;
}

.survival-setup .close-quiz,
.survival-quiz-container .close-quiz,
.survival-results .close-quiz {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.setup-content, .survival-content {
  padding: 2rem;
}

.players-list {
  margin: 1rem 0;
}

.player-input {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.player-input input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.player-input button {
  background: #ff4757;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.add-player-btn {
  width: 100%;
  padding: 0.75rem;
  background: #2ed573;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
}

.setup-footer, .survival-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.cancel-btn, .start-btn, .start-survival-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}

.cancel-btn {
  background: #6c757d;
  color: white;
}

.start-btn, .start-survival-btn {
  background: #007bff;
  color: white;
}

.scores-display {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

.player-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px solid transparent;
}

.player-score.active {
  border-color: #007bff;
  background: #e3f2fd;
}

.ready-btn {
  width: 100%;
  padding: 1rem;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: bold;
}

/* Survival Mode Styles */
.survival-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.streak, .lives, .difficulty {
  font-size: 1.2rem;
  font-weight: bold;
}

.difficulty-selection {
  margin: 2rem 0;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.difficulty-btn {
  padding: 1rem;
  border: 2px solid #ddd;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.difficulty-btn.active {
  border-color: #007bff;
  background: #e3f2fd;
}

.survival-quiz-container {
  max-width: 600px;
}

.quit-survival {
  padding: 0.75rem 1.5rem;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Survival mode close button */
.survival-setup .close-quiz,
.survival-quiz-container .close-quiz,
.survival-results .close-quiz {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.survival-setup .close-quiz:hover,
.survival-quiz-container .close-quiz:hover,
.survival-results .close-quiz:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Daily Objectives Styles */
.objectives-panel {
  background: white;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.objectives-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.points-display {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
}

.objectives-content {
  padding: 2rem;
}

.objectives-list {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.objective-item {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 1.5rem;
  border-left: 5px solid #007bff;
  transition: all 0.3s;
}

.objective-item.completed {
  border-left-color: #28a745;
  background: #d4edda;
}

.objective-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.objective-header h3 {
  margin: 0;
  color: #333;
}

.objective-description {
  color: #666;
  margin-bottom: 1rem;
}

.objective-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  transition: width 0.3s;
}

.progress-text {
  font-weight: bold;
  color: #333;
}

.completed-badge {
  background: #28a745;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  margin-top: 1rem;
}

/* Glossary Styles */
.glossary-container {
  background: white;
  border-radius: 20px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: #333;
}

.glossary-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.glossary-content {
  padding: 2rem;
  color: #333;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #ddd;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  color: #333;
}

.tab-btn.active {
  border-color: #007bff;
  background: #007bff;
  color: white;
}

.tab-btn:hover:not(.active) {
  border-color: #007bff;
  color: #007bff;
}

.search-container {
  margin-bottom: 2rem;
}

.search-container input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  color: #333;
  background: white;
}

.search-container input::placeholder {
  color: #000;
}

.terms-list {
  display: grid;
  gap: 1.5rem;
}

.term-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.5rem;
  border-left: 4px solid #007bff;
}

.term-title {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1.2rem;
}

.term-definition {
  color: #000;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.term-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.term-category {
  background: #007bff;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.9rem;
}

.related-terms {
  font-size: 0.9rem;
  color: #000;
  font-style: italic;
}

.glossary-term {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: underline;
}

.term-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  max-width: 400px;
  width: 90%;
}

.term-popup-content {
  padding: 1.5rem;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}

.term-popup-content h4 {
  margin: 0 0 1rem 0;
  color: #333;
  text-align: center;
}

.term-popup-content p {
  text-align: center;
  margin: 0;
}

.close-popup {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #666;
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.profile-header .close-quiz {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-header .close-quiz:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Notification Styles */
.in-app-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.5s ease-out;
  z-index: 1000;
  max-width: 350px;
}

.in-app-notification.show {
  transform: translateX(0);
}

.in-app-notification.fade-out {
  opacity: 0;
  transform: translateX(100%);
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  text-align: center;
  min-height: 80px;
}

.notification-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
}

.notification-text {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.notification-text h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  text-align: center;
}

.notification-text p {
  margin: 0;
  opacity: 0.9;
  text-align: center;
}

/* Close button styles for modals */
.notification-center .close-quiz,
.glossary-container .close-quiz {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-center .close-quiz:hover,
.glossary-container .close-quiz:hover {
  background: rgba(255, 255, 255, 0.2);
}

.close-notification {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
}

.notification-center {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: #333;
}

.notification-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.mark-all-read {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
}

.notification-settings {
  margin-bottom: 2rem;
  padding: 1rem;
}

.notification-settings h3 {
  color: #333;
  margin-bottom: 1rem;
}

.setting-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.setting-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #333;
}

.notification-history {
  padding: 1rem;
}

.notification-history h3 {
  color: #333;
  margin-bottom: 1rem;
}

.notifications-list {
  display: grid;
  gap: 1rem;
}

.notification-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border-left: 4px solid #007bff;
}

.notification-item.unread {
  background: #e3f2fd;
}

.notification-item.read {
  background: #f8f9fa;
  color: #000;
  opacity: 0.7;
}

.no-notifications {
  text-align: center;
  padding: 2rem;
  color: #000;
}

.notification-details h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.notification-details p {
  margin: 0 0 0.5rem 0;
  color: #000;
}

.notification-time {
  font-size: 0.8rem;
  color: #000;
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Auth System Styles */
.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  color: white;
}

.user-avatar {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: bold;
  font-size: 1.1rem;
}

.user-level {
  font-size: 0.9rem;
  opacity: 0.8;
}

.user-xp {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Profile Modal Styles */
.profile-panel {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  color: white;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.profile-content {
  padding: 2rem;
}

.profile-info {
  text-align: center;
  margin-bottom: 2rem;
}

.profile-avatar {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
}

.xp-progress {
  margin: 1rem 0;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  transition: width 0.3s ease;
}

.xp-info {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.profile-badges {
  margin-bottom: 2rem;
}

.profile-badges h4, .profile-preferences h4 {
  color: white;
  margin-bottom: 1rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.badge-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.badge-name {
  font-size: 0.9rem;
  font-weight: bold;
  color: white;
}

.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: white;
}

.preference-item select, .preference-item input {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.preference-item select option {
  background: #333;
  color: white;
}

.preference-item input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* Level Up Notification */
.level-up-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  text-align: center;
  transition: transform 0.3s ease;
}

.level-up-notification.show {
  transform: translate(-50%, -50%) scale(1);
}

.levelup-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.levelup-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.levelup-reward {
  display: block;
  margin-top: 1rem;
  font-style: italic;
  opacity: 0.8;
}

/* XP Notifications */
.xp-notification,
.challenge-xp-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 300px;
}

.xp-notification.show,
.challenge-xp-notification.show {
  transform: translateX(0);
}

.challenge-xp-notification {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #333;
}

.xp-content,
.challenge-xp-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.xp-icon,
.challenge-xp-icon {
  font-size: 2rem;
}

.xp-text h4,
.challenge-xp-text h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.xp-text p,
.challenge-xp-text p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.bonus-text {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  font-weight: bold;
}

.xp-reward,
.points-reward {
  display: block;
  font-weight: bold;
  margin-top: 0.3rem;
}

.xp-reward {
  color: #4CAF50;
}

.points-reward {
  color: #2196F3;
}

/* Adaptive Quiz Styles */
.adaptive-info-panel {
  background: white;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #333;
  position: relative;
}

.adaptive-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.adaptive-content {
  padding: 1.5rem;
}

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

.adaptive-explanation li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.current-settings {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 10px;
  margin: 1rem 0;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.setting-value {
  font-weight: bold;
  color: #667eea;
}

.recommendations {
  margin: 1rem 0;
}

.recommendation-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  border-left: 4px solid;
}

.recommendation-item.high {
  background: #fff3cd;
  border-left-color: #ffc107;
}

.recommendation-item.low {
  background: #d1ecf1;
  border-left-color: #17a2b8;
}

.rec-icon {
  font-size: 1.2rem;
}

.performance-stats {
  background: #e9ecef;
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1rem;
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  max-width: 300px;
}

/* Responsive */
@media (max-width: 768px) {
  .multiplayer-setup, .player-turn, .survival-setup, .objectives-panel, .glossary-container, .notification-center {
    width: 95%;
    margin: 1rem;
  }

  .setup-footer, .survival-footer {
    flex-direction: column;
  }

  .scores-display {
    gap: 0.5rem;
  }

  .difficulty-buttons {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    justify-content: center;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
  }

  .in-app-notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .header-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
}