/* Modern Color Palette */
:root {
  --primary: #4CAF50;
  --primary-light: #81C784;
  --primary-dark: #388E3C;
  --secondary: #FFC107;
  --accent: #2196F3;
  --background: #F5F9F5;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --text-lighter: #999999;
  --correct: #4CAF50;
  --wrong: #F44336;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 70px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  min-height: 100%;
  touch-action: manipulation;
  padding-bottom: calc(70px + env(safe-area-inset-bottom)); /* 70px for nav + bottom inset */
}

/* Progress Header */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.user-details h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.xp-bar {
  width: 130px;
  height: 6px;
  background-color: #E0E0E0;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.xp-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
}

.xp-text {
  position: absolute;
  top: -16px;
  left: 0;
  font-size: 0.65rem;
  color: var(--text-light);
  white-space: nowrap;
}

.streak-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #FFF3E0;
  padding: 6px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.streak-display:active {
  transform: scale(0.95);
}

.fire-icon {
  font-size: 1rem;
  color: #FF6D00;
}

.streak-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.streak-label {
  font-size: 0.6rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Carousel */
.carousel-container {
  margin: 0 12px 20px;
  position: relative;
}

.carousel {
  display: flex;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow);
  height: 100px;
}

.carousel-item {
  min-width: 100%;
  transition: transform 0.5s ease;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.carousel-item::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.carousel-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.carousel-text {
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 85%;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  gap: 6px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #BDBDBD;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 20px;
}

.action-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 15px 12px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.action-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-card.touch-active {
  background-color: rgba(0, 0, 0, 0.03);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 12px;
}

.action-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.action-card p {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--secondary);
  color: #333;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--card-bg);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px); /* Adjust for system nav */
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}


.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.75rem;
  transition: all 0.2s ease;
  padding: 5px 8px;
  border-radius: 6px;
  flex: 1;
  max-width: 25%;
}

.nav-item i {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active i {
  color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 360px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
  
  .progress-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .streak-display {
    flex-direction: row;
    gap: 6px;
    align-self: flex-end;
  }
  
  .streak-label {
    display: none;
  }
  
  .carousel {
    height: 90px;
  }
  
  .carousel-text {
    font-size: 0.8rem;
  }
}

@media (min-width: 600px) {
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .carousel {
    height: 120px;
  }
  
  .carousel-text {
    font-size: 1rem;
  }
}

/* Android-specific optimizations */
@media (hover: none) {
  .action-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
  
  .streak-display:hover {
    transform: none;
  }
}

/* Prevent text size adjustment */
body {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Better touch targets */
button, .action-card, .nav-item {
  touch-action: manipulation;
}

/* Disable callout */
.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.learn-container {
  padding: 20px;
  margin-bottom: 80px;
}

.learn-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
}

.learn-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #444;
}

.section-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.learn-card {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.learn-card:hover {
  transform: translateY(-5px);
}

.learn-card h3 {
  margin: 10px 0 5px;
  font-size: 1rem;
}

.learn-card p {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #333;
}