/*
  BrainQuest Pro - A Premium Quiz Platform
  Developed by: Krishna Pathak
  Email: krishnapathak0122@gmail.com
  Date: 25-07-2024
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #6a11cb;
  --secondary: #2575fc;
  --accent: #8e2de2;
  --success: #4CAF50;
  --warning: #ff9800;
  --info: #2196F3;
  --danger: #f44336;
  --light: #f5f5f7;
  --dark: #121212;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --card-bg: rgba(30, 30, 46, 0.7);
  --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --premium-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  --premium-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  --glass-border: rgba(255, 255, 255, 0.1);

  /* New Theming Variables */
  --theme-background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --theme-text-color: var(--text-primary);
  --theme-card-background: var(--card-bg);
  --theme-header-background: var(--premium-gradient);
}

/* Dark Theme (Default) */
body {
  font-family: 'Poppins', sans-serif;
  background: var(--theme-background);
  color: var(--theme-text-color);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Light Theme (Example - can be toggled via JS) */
body.light-theme {
  --primary: #673ab7;
  --secondary: #512da8;
  --accent: #9575cd;
  --success: #66bb6a;
  --warning: #ffa726;
  --info: #42a5f5;
  --danger: #ef5350;
  --light: #f5f5f5;
  --dark: #333333;
  --text-primary: #333333;
  --text-secondary: #666666;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);

  --theme-background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
  --theme-text-color: var(--text-primary);
  --theme-card-background: var(--card-bg);
  --theme-header-background: linear-gradient(135deg, #673ab7, #9575cd);
}


body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(94, 53, 177, 0.15) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(126, 87, 194, 0.15) 0%, transparent 20%);
  z-index: -1;
}

.container {
  max-width: 100%;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header Styles */
header {
  background: var(--theme-header-background);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.menu-dropdown {
  position: absolute;
  top: 75px;
  right: 20px;
  background: var(--glass-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  width: 220px;
  overflow: hidden;
  z-index: 200;
  display: none;
  transform: translateY(-10px);
  opacity: 0;
  transition: var(--transition);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.menu-dropdown.active {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.menu-dropdown a {
  display: flex;
  align-items: center;
  padding: 15px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 1px solid var(--glass-border);
  font-weight: 500;
}

.menu-dropdown a:last-child {
  border-bottom: none;
}

.menu-dropdown a:hover {
  background: rgba(94, 53, 177, 0.3);
}

.menu-dropdown a i {
  margin-right: 12px;
  color: var(--accent);
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
}

/* Main Content Styles */
main {
  flex: 1;
  padding: 1.5rem;
  padding-bottom: 90px;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.8rem;
  position: relative;
  padding-bottom: 12px;
  letter-spacing: 0.3px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(126, 87, 194, 0.5);
}

/* Home Page Styles */
.welcome-card {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.welcome-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  box-shadow: 0 0 15px rgba(126, 87, 194, 0.5);
}

.welcome-card h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: white;
  font-weight: 700;
}

.welcome-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.user-stats {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.stat-card {
  flex: 1;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stat-card .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 5px;
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.daily-tasks {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.task-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.task-item.completed {
  background: rgba(67, 160, 71, 0.15);
}

.task-item.completed .task-reward {
  background: var(--success);
  color: white;
}

.task-item i {
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(126, 87, 194, 0.4);
}

.task-info {
  flex: 1;
}

.task-info h4 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  font-weight: 600;
  color: white;
}

.task-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.task-reward {
  background: gold;
  color: #333;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(255, 215, 0, 0.3);
}

.streak-container {
  display: flex;
  justify-content: center;
  margin: 25px 0;
}

.streak-days {
  display: flex;
  gap: 10px;
}

.streak-day {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(30, 30, 46, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  position: relative;
  backdrop-filter: blur(5px);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.streak-day:hover {
  transform: scale(1.1);
}

.streak-day.consecutive {
  background: var(--success);
  color: white;
}

.streak-day.active {
  background: var(--premium-gold);
  color: var(--dark);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.streak-day.active:after {
  content: "✓";
  position: absolute;
  bottom: -18px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: bold;
}

.streak-day.today {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.3);
}

/* Quiz Selection Modal */
.quiz-selection-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.quiz-selection-content {
  background: var(--theme-card-background);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.quiz-selection-content h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.quiz-selection-content .input-group {
  margin-bottom: 20px;
}

.quiz-selection-content select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1rem;
  appearance: none; /* Remove default arrow */
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M287%2C197.9l-13.9%2C13.9L146.2%2C81.8L19.3%2C211.8L5.4%2C197.9L146.2%2C5.4L287%2C197.9z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 12px auto;
}

.quiz-selection-content select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.3);
}

/* In-App Purchase Modal */
.iap-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.iap-content {
  background: var(--theme-card-background);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.iap-content h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.coin-packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.coin-pack-item {
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: var(--transition);
}

.coin-pack-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.coin-pack-item.selected {
  border-color: var(--accent);
  background: rgba(94, 53, 177, 0.3);
  box-shadow: 0 0 20px rgba(126, 87, 194, 0.4);
}

.coin-pack-item h4 {
  font-size: 1.2rem;
  color: gold;
  margin-bottom: 10px;
}

.coin-pack-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.coin-pack-item .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
  margin-top: 10px;
}

/* Feedback Modal */
.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.feedback-content {
  background: var(--theme-card-background);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.feedback-content h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--accent);
}

.feedback-content textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1rem;
  min-height: 120px;
  resize: vertical;
  margin-bottom: 20px;
}

/* Spinner Wheel Page Styles */
.spinner-page {
  text-align: center;
}

.spinner-section {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.wheel-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 20px auto;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 8px solid var(--accent);
  box-shadow: 
    0 0 20px rgba(126, 87, 194, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.21, 0.99);
  transform-style: preserve-3d;
  perspective: 1000px;
  transform: rotateX(15deg);
}

.wheel.spinning {
  box-shadow: 
    0 0 40px rgba(126, 87, 194, 0.8), 
    0 0 80px rgba(126, 87, 194, 0.4),
    0 0 120px rgba(126, 87, 194, 0.2);
  animation: spinGlow 0.5s infinite alternate;
}

@keyframes spinGlow {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.wheel-section {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: bottom right;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 14px;
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: box-shadow 0.3s ease;
}

.wheel-section:hover {
  box-shadow: inset 0 0 25px rgba(255,255,255,0.5);
  z-index: 5;
}

.wheel-pointer {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  z-index: 15;
}

.wheel-pointer i {
  font-size: 50px;
  color: var(--accent);
  filter: 
    drop-shadow(0 0 5px rgba(255,255,255,0.7))
    drop-shadow(0 0 10px rgba(126,87,194,0.5));
  animation: pointerPulse 1.5s infinite;
}

@keyframes pointerPulse {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.2); }
  100% { transform: translateX(-50%) scale(1); }
}

.spin-button {
  background: var(--premium-gradient);
  color: white;
  border: none;
  padding: 14px 35px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(126, 87, 194, 0.4);
  margin-top: 20px;
}

.spin-button:hover {
  background: linear-gradient(135deg, #4527a0, #5e35b1);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(126, 87, 194, 0.6);
}

.spin-button:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spin-timer {
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.reward-display {
  background: rgba(30, 30, 46, 0.7);
  border-radius: 20px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  text-align: center;
  display: none;
}

.reward-display.active {
  display: block;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.reward-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 700;
}

.reward-value {
  font-size: 2rem;
  font-weight: 800;
  color: gold;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.subject-card {
  background: var(--theme-card-background);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.subject-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.subject-icon {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--premium-gradient);
  color: white;
  font-size: 2.8rem;
}

.subject-info {
  padding: 18px;
}

.subject-info h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: white;
  font-weight: 700;
}

.subject-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.questions-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(5px);
  border: 1px solid var(--glass-border);
}

/* Leaderboard Page Styles */
.leaderboard-container {
  background: var(--theme-card-background);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.leaderboard-header {
  background: var(--premium-gradient);
  color: white;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.leaderboard-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.time-filter {
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

.leaderboard-list {
  padding: 18px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-border);
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(30, 30, 46, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  font-weight: 700;
  color: var(--text-primary);
  backdrop-filter: blur(5px);
  border: 1px solid var(--glass-border);
}

.rank.top {
  background: var(--premium-gold);
  color: #333;
  font-weight: 800;
}

.rank.top-2 {
  background: silver;
  color: var(--dark);
  font-weight: 800;
}

.rank.top-3 {
  background: #cd7f32;
  color: white;
  font-weight: 800;
}

.user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  margin-right: 16px;
  box-shadow: 0 4px 12px rgba(126, 87, 194, 0.4);
}

.user-info {
  flex: 1;
}

.user-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.user-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-score {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

/* Profile Page Styles */
.profile-header {
  background: var(--premium-gradient);
  color: white;
  padding: 2.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  border-radius: 0 0 30px 30px;
  margin-bottom: 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--theme-card-background);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 3rem;
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid var(--theme-card-background);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
}

.profile-avatar:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 0 25px rgba(126, 87, 194, 0.6);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.profile-info h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  font-weight: 700;
  color: white;
}

.profile-info p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.edit-btn {
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.edit-btn:hover {
  background: rgba(94, 53, 177, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.membership-section {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.membership-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

       .coin-balance {
  background: var(--premium-gold);
  color: #333;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.premium-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 25px 0;
}

.premium-option {
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.premium-option:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.premium-option.selected {
  border-color: var(--accent);
  background: rgba(94, 53, 177, 0.3);
  box-shadow: 0 0 20px rgba(126, 87, 194, 0.4);
}

.premium-option.featured {
  border: 1px solid var(--accent);
  position: relative;
  transform: scale(1.05);
}

.premium-option.featured::before {
  content: "BEST VALUE";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--premium-gradient);
  color: white;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(126, 87, 194, 0.4);
}

.premium-option h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: white;
  font-weight: 700;
}

.premium-cost {
  font-size: 1.4rem;
  font-weight: 800;
  color: #FFD700;
  margin: 15px 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.premium-cost i {
  margin-right: 8px;
}

.plan-features {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 10px;
}

.membership-timer {
  background: rgba(0,0,0,0.2);
  padding: 10px;
  border-radius: 10px;
  margin-top: 15px;
  text-align: center;
  font-weight: 600;
}

.purchase-btn {
  background: var(--premium-gradient);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(126, 87, 194, 0.4);
}

.purchase-btn:hover {
  background: linear-gradient(135deg, #4527a0, #5e35b1);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(126, 87, 194, 0.6);
}

.badges-container {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 15px 0;
  margin-top: 20px;
}

.badge {
  min-width: 90px;
  height: 110px;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  box-shadow: var(--card-shadow);
  text-align: center;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.badge:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.badge i {
  font-size: 1.8rem;
  color: gold;
  margin-bottom: 12px;
}

.badge h5 {
  font-size: 0.8rem;
  margin-bottom: 6px;
  color: white;
  font-weight: 600;
}

.badge p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Quiz Page Styles */
.quiz-container {
  background: var(--theme-card-background);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.quiz-header {
  background: var(--premium-gradient);
  color: white;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 12px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: white;
  border-radius: 4px;
  width: 30%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.quiz-question {
  padding: 25px;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.6;
  color: white;
}

.quiz-options {
  padding: 0 20px 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option {
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.option:hover {
  background: rgba(94, 53, 177, 0.3);
  transform: translateY(-3px);
}

.option.selected {
  background: rgba(67, 97, 238, 0.3);
  border: 1px solid var(--accent);
}

.option.correct {
  background: rgba(67, 160, 71, 0.3);
  border: 1px solid var(--success);
}

.option.incorrect {
  background: rgba(239, 83, 80, 0.3);
  border: 1px solid var(--danger);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  padding: 18px;
  border-top: 1px solid var(--glass-border);
}

.nav-btn {
  background: var(--premium-gradient);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(126, 87, 194, 0.4);
}

.nav-btn:hover {
  background: linear-gradient(135deg, #4527a0, #5e35b1);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(126, 87, 194, 0.6);
}

.nav-btn.outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: none;
}

.nav-btn.outline:hover {
  background: rgba(126, 87, 194, 0.15);
}

.timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.timer {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  position: relative;
  color: white;
  box-shadow: 0 0 20px rgba(126, 87, 194, 0.4);
}

.timer-progress {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  clip: rect(0px, 35px, 70px, 0px);
  background: rgba(30, 30, 46, 0.7);
}

/* Results Page */
.results-container {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.results-header {
  margin-bottom: 1.8rem;
}

.results-score {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  margin: 25px 0;
  text-shadow: 0 0 15px rgba(126, 87, 194, 0.6);
}

.results-stats {
  display: flex;
  justify-content: space-around;
  margin: 30px 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(126, 87, 194, 0.5);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 25px;
}

/* Auth Screens */
.auth-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.auth-card {
  background: var(--theme-card-background);
  border-radius: 25px;
  width: 100%;
  max-width: 450px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.auth-header {
  background: var(--premium-gradient);
  color: white;
  padding: 2.5rem;
  text-align: center;
}

.auth-header h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  font-weight: 800;
}

.auth-header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

.auth-body {
  padding: 2.2rem;
}

.input-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.input-group input {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-size: 1rem;
  transition: var(--transition);
  background: rgba(30, 30, 46, 0.7);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.input-group input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.3);
}

.password-toggle {
  position: absolute;
  right: 18px;
  top: 45px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.auth-btn {
  background: var(--premium-gradient);
  color: white;
  border: none;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 15px;
  box-shadow: 0 4px 15px rgba(126, 87, 194, 0.4);
}

.auth-btn:hover {
  background: linear-gradient(135deg, #4527a0, #5e35b1);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(126, 87, 194, 0.6);
}

.auth-footer {
  text-align: center;
  margin-top: 1.8rem;
  font-size: 0.95rem;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Auth Mode Switcher */
.auth-mode-switcher {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  padding: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.mode-btn {
  padding: 12px 30px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  transition: var(--transition);
}

.mode-btn.active {
  color: white;
  background: rgba(94, 53, 177, 0.3);
}

.mode-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 70%;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

/* Notification */
.notification {
  position: fixed;
  top: 25px;
  right: 25px;
  background: var(--theme-card-background);
  border-radius: 16px;
  padding: 18px 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 15px;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  max-width: 400px;
}

.notification.active {
  transform: translateX(0);
}

.notification.success {
  border-left: 5px solid var(--success);
}

.notification.error {
  border-left: 5px solid var(--danger);
}

.notification i {
  font-size: 1.4rem;
}

.notification.success i {
  color: var(--success);
}

.notification.error i {
  color: var(--danger);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--theme-card-background);
  display: flex;
  justify-content: space-around;
  padding: 14px 0;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
  z-index: 90;
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
  padding: 8px 20px;
  border-radius: 16px;
}

.nav-item.active {
  color: var(--accent);
  background: rgba(94, 53, 177, 0.3);
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(126, 87, 194, 0.4);
}

.nav-item i {
  font-size: 1.3rem;
  margin-bottom: 6px;
  transition: var(--transition);
}

.nav-item.active i {
  transform: scale(1.2);
}

/* Loading Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: block; /* Make spinner visible by default in certain contexts */
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Avatar Upload */
.avatar-upload {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.avatar-upload-content {
  background: var(--theme-card-background);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(30px);
}

.avatar-preview {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(30, 30, 46, 0.7);
  margin: 25px auto;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 0 25px rgba(126, 87, 194, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Enable Sound Button */
.enable-sound-btn {
  position: fixed;
  bottom: 90px;
  right: 25px;
  background: var(--premium-gradient);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  z-index: 100;
  transition: var(--transition);
}

.enable-sound-btn:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 8px 25px rgba(126, 87, 194, 0.6);
}

/* Firebase Auth Loading */
.firebase-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  font-size: 1.8rem;
  flex-direction: column;
  gap: 25px;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-content {
  background: var(--theme-card-background);
  padding: 35px;
  border-radius: 20px;
  text-align: center;
  max-width: 350px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}
     /* Ad Modal */
.ad-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.ad-content {
  background: var(--theme-card-background);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.ad-content h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--accent);
}

.ad-timer {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 20px 0;
  text-shadow: 0 0 15px rgba(126, 87, 194, 0.6);
}

.ad-close {
  background: var(--premium-gradient);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 480px) {
  .subject-grid {
    grid-template-columns: 1fr;
  }

  .premium-options {
    grid-template-columns: 1fr;
  }

  .user-stats {
    flex-direction: column;
  }

  .streak-day {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .auth-body {
    padding: 1.5rem;
  }
  
  .wheel-container {
    width: 250px;
    height: 250px;
  }

  .coin-packs {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.2);
  }

  .subject-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .premium-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .bottom-nav {
    max-width: 768px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 25px 25px 0 0;
    width: calc(100% - 30px);
    margin: 0 auto 10px; /* Centered with margin */
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }

  .subject-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

 /* New Animation Effects */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Glassmorphism Effect */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* Connection Status */
.connection-status {
  position: fixed;
  top: 10px;
  left: 10px;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(-100%);
}

.connection-status.connected {
  background: rgba(67, 160, 71, 0.3);
  color: var(--success);
}

.connection-status.disconnected {
  background: rgba(239, 83, 80, 0.3);
  color: var(--danger);
  opacity: 1;
  transform: translateY(0);
}

.connection-status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.connection-status.connected .dot {
  background: var(--success);
}

.connection-status.disconnected .dot {
  background: var(--danger);
}

/* Spinner 3D and Glow */
.wheel {
  transform-style: preserve-3d;
  transform: rotateX(10deg); /* Initial 3D tilt */
  box-shadow: 0 0 30px rgba(126, 87, 194, 0.8),
              0 10px 40px rgba(0, 0, 0, 0.5);
}

.wheel-section {
  transform: translateZ(10px); /* Give sections some depth */
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.wheel.spinning {
  animation: spinGlow 1s infinite alternate;
}

@keyframes spinGlow {
  0% { box-shadow: 0 0 20px rgba(126, 87, 194, 0.8); }
  100% { box-shadow: 0 0 50px rgba(126, 87, 194, 1); }
}

/* SHARE PAGE STYLES */
.share-container {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 2rem;
  margin-top: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  text-align: center;
}

.referral-code {
  background: rgba(30, 30, 46, 0.7);
  padding: 15px;
  border-radius: 16px;
  margin: 20px 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 3px;
  border: 2px dashed var(--accent);
}

.share-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.share-btn {
  background: var(--premium-gradient);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(126, 87, 194, 0.6);
}

.referral-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 30px;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.referral-stats span {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.2rem;
}

/* DAILY STREAK IMPROVEMENTS */
.streak-day.active {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  transform: scale(1.15);
}

.streak-day.consecutive {
  animation: streakPulse 2s infinite;
}

@keyframes streakPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(67, 160, 71, 0.6); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(67, 160, 71, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(67, 160, 71, 0.6); }
}

/* LEADERBOARD IMPROVEMENTS */
.leaderboard-item.highlight {
  background: rgba(94, 53, 177, 0.2);
  border-radius: 12px;
}

/* SIGNUP REFERRAL SECTION */
.referral-section {
  margin-top: 20px;
  padding: 15px;
  background: rgba(30, 30, 46, 0.5);
  border-radius: 16px;
  border: 1px dashed var(--accent);
}

.referral-section label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--accent);
}

.referral-section input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

/* Daily Challenges Section */
.daily-challenges {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.challenge-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 14px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.challenge-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.challenge-item i {
  width: 42px;
  height: 42px;
  background: var(--info); /* Different color for challenges */
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(41, 182, 246, 0.4);
}

.challenge-info {
  flex: 1;
}

.challenge-info h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  font-weight: 600;
  color: white;
}

.challenge-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.challenge-reward {
  background: var(--success);
  color: white;
  padding: 5px 12px;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(74, 222, 128, 0.3);
  margin-left: 8px;
}

.btn-small {
  background: var(--premium-gradient);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 8px;
}

.btn-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(126, 87, 194, 0.4);
}

.btn-small:disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

/* Toggle Switch Styles (for settings) */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  float: right; /* Align to the right */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 30, 46, 0.7); /* Glassy background */
  border: 1px solid var(--glass-border);
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--text-secondary);
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-image: var(--premium-gradient);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent);
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
  background-color: white;
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Adjust input-group for settings */
.membership-section .input-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}

.membership-section .input-group:last-child {
  border-bottom: none;
}

.membership-section .input-group label {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--text-primary);
}

/* New Styles for Challenge Options */
.challenge-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.challenge-option-card {
  background: var(--theme-card-background);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.challenge-option-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.challenge-option-card i {
  font-size: 3.5rem;
  color: var(--accent);
  margin-bottom: 15px;
}

.challenge-option-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: white;
}

.challenge-option-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1; /* Allows button to stick to bottom */
}

.challenge-option-card .auth-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
}

/* Modal Styles (reusing existing modal structure) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--theme-card-background);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.modal-content h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--accent);
}

/* Match History Styles */
.match-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  font-size: 0.95rem;
}

.match-opponent {
  font-weight: 600;
  color: white;
  flex: 2;
  text-align: left;
}

.match-result {
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  flex: 1;
  text-align: center;
}

.match-result.win {
  background: var(--success);
  color: white;
}

.match-result.loss {
  background: var(--danger);
  color: white;
}

.match-score {
  font-weight: 700;
  color: var(--accent);
  flex: 1;
  text-align: right;
}

.match-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
  text-align: right;
}

/* Responsive adjustments for new elements */
@media (max-width: 480px) {
  .challenge-options-grid {
    grid-template-columns: 1fr;
  }
  .match-item {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .match-opponent, .match-result, .match-score, .match-date {
    flex: none;
    width: 100%;
    margin-bottom: 5px;
  }
  .match-result {
    margin-top: 5px;
  }
}