/* ========================================
   MathMe Landing Page - Main CSS
   ======================================== */

/* CSS Variables */
:root {
  /* Primary - Blue */
  --color-primary: #2196F3;
  --color-primary-dark: #1976D2;
  --color-primary-light: #BBDEFB;

  /* Secondary - Green */
  --color-secondary: #4CAF50;
  --color-secondary-dark: #388E3C;
  --color-secondary-light: #C8E6C9;

  /* Accent - Orange */
  --color-accent: #FF9800;
  --color-accent-dark: #F57C00;

  /* Neutral */
  --color-background: #FFFFFF;
  --color-surface: #F5F5F5;
  --color-text-primary: #212121;
  --color-text-secondary: #757575;
  --color-border: #E0E0E0;

  /* Semantic */
  --color-success: #4CAF50;
  --color-error: #F44336;
  --color-warning: #FF9800;

  /* Fonts */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-xxl: 64px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* Skip to Main Content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 20px;
}

p {
  margin-bottom: var(--spacing-sm);
}

/* Desktop Typography */
@media (min-width: 1024px) {
  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 40px;
  }

  h3 {
    font-size: 32px;
  }

  h4 {
    font-size: 24px;
  }
}

/* ========================================
   Layout
   ======================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

.section {
  padding: var(--spacing-xxl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: 80px 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 100px 0;
  }
}

.section-gray {
  background-color: var(--color-surface);
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: var(--color-text-primary);
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font-heading);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: center;
  min-height: 48px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  color: white;
}

.btn-app-store img,
.btn-google-play img,
.btn-app-store-large img,
.btn-google-play-large img {
  height: 48px;
  width: auto;
}

@media (max-width: 767px) {
  .btn {
    padding: 12px 24px;
    min-height: 48px;
  }
}

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 0 var(--spacing-xxl) 0;
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-xl);
}

.hero-text {
  max-width: 600px;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: var(--spacing-md);
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 36px;
  margin-bottom: var(--spacing-sm);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 18px;
  margin-bottom: var(--spacing-lg);
  opacity: 0.95;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  align-items: center;
}

.hero-visual {
  position: relative;
  max-width: 400px;
}

.hero-visual img {
  width: 100%;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
  background: transparent !important;
}

/* Math Symbols Animation */
.math-symbol {
  position: absolute;
  font-size: 48px;
  font-weight: bold;
  opacity: 0.3;
  animation: rotate 10s linear infinite;
}

.symbol-1 {
  top: 10%;
  left: 5%;
  color: #FFD700;
}

.symbol-2 {
  top: 20%;
  right: 10%;
  color: #FF6B6B;
}

.symbol-3 {
  bottom: 30%;
  left: -5%;
  color: #4ECDC4;
}

.symbol-4 {
  bottom: 10%;
  right: 5%;
  color: #95E1D3;
}

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

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

/* Desktop Hero */
@media (min-width: 1024px) {
  .hero-section {
    padding: 120px 0 var(--spacing-xxl) 0;
  }

  .hero-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .hero-text {
    max-width: 500px;
  }

  .hero-title {
    font-size: 56px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .cta-buttons {
    flex-direction: row;
    gap: var(--spacing-md);
  }

  .hero-visual {
    max-width: 500px;
  }
}

/* ========================================
   Problems & Solutions Section
   ======================================== */

.problems-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.problem-card {
  background: white;
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-normal);
}

.problem-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.problem-icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.problem-card h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.problem-card p {
  color: var(--color-text-secondary);
  margin: 0;
}

.solutions-list {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.solutions-title {
  margin-bottom: var(--spacing-md);
}

.solutions li {
  padding: var(--spacing-sm) 0;
  font-size: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.solutions li:last-child {
  border-bottom: none;
}

@media (min-width: 768px) {
  .problems-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .problems-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   Features Section
   ======================================== */

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.feature-card {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 64px;
  margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
  margin-bottom: var(--spacing-sm);
}

.feature-card p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
}

.feature-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-top: var(--spacing-md);
}

.additional-features {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.additional-features h3 {
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.features-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
}

.features-list li {
  padding: var(--spacing-sm);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  font-size: 16px;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ========================================
   Adaptive Learning Section
   ======================================== */

.adaptive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.adaptive-card {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-normal);
}

.adaptive-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.adaptive-icon {
  font-size: 64px;
  margin-bottom: var(--spacing-sm);
}

.adaptive-card h3 {
  margin-bottom: var(--spacing-sm);
}

.adaptive-card p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.adaptive-visual {
  text-align: center;
}

.adaptive-visual img {
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .adaptive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   Gamification Section
   ======================================== */

.gamification-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.gamification-card {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-normal);
}

.gamification-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gamification-icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.gamification-card h3 {
  margin-bottom: var(--spacing-xs);
}

.gamification-card p {
  color: var(--color-text-secondary);
  margin: 0;
}

.gamification-visual {
  text-align: center;
}

.gamification-visual img {
  max-width: 400px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .gamification-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gamification-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   TikTok Interface Section
   ======================================== */

.tiktok-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  align-items: center;
}

.tiktok-text {
  max-width: 600px;
}

.tiktok-description {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: var(--spacing-lg);
}

.tiktok-benefits {
  list-style: none;
}

.tiktok-benefits li {
  padding: var(--spacing-sm) 0;
  font-size: 18px;
  color: var(--color-text-secondary);
}

.tiktok-visual {
  max-width: 400px;
}

.tiktok-visual img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 1024px) {
  .tiktok-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ========================================
   Gallery Section
   ======================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal);
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   Technology Section
   ======================================== */

.technology-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.tech-card {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-normal);
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.tech-icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.tech-card h3 {
  margin-bottom: var(--spacing-sm);
}

.tech-card p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
}

.trust-badges .badge {
  background: var(--color-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .technology-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .technology-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   Testimonials Section
   ======================================== */

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.testimonial-card {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stars {
  font-size: 20px;
  margin-bottom: var(--spacing-sm);
}

.testimonial-text {
  font-size: 16px;
  line-height: 1.8;
  font-style: italic;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
}

.testimonial-author {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.testimonial-source {
  font-size: 14px;
  color: var(--color-text-secondary);
}

@media (min-width: 768px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   Pricing Section
   ======================================== */

.pricing-table {
  margin-bottom: var(--spacing-xl);
  overflow-x: auto;
}

.pricing-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pricing-table th,
.pricing-table td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.pricing-table thead {
  background: var(--color-primary);
  color: white;
}

.pricing-table th {
  font-weight: 600;
}

.pricing-table .premium-col {
  background: var(--color-secondary);
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table tbody tr:hover {
  background: var(--color-surface);
}

.pricing-info {
  text-align: center;
}

.pricing-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

/* ========================================
   FAQ Section
   ======================================== */

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: white;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: var(--spacing-md);
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background: var(--color-surface);
}

.faq-icon {
  font-size: 24px;
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding: 0 var(--spacing-md) var(--spacing-md);
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* ========================================
   Final CTA Section
   ======================================== */

.cta-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
}

.cta-section .section-title,
.cta-section .section-subtitle {
  color: white;
}

.cta-buttons-large {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: center;
}

@media (min-width: 768px) {
  .cta-buttons-large {
    flex-direction: row;
    justify-content: center;
  }
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--color-text-primary);
  color: white;
  padding: var(--spacing-xxl) 0 var(--spacing-md);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.footer-column h4 {
  margin-bottom: var(--spacing-md);
  color: white;
}

.footer-logo {
  max-width: 150px;
  margin-bottom: var(--spacing-sm);
  background: transparent !important;
}

.footer-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--spacing-xs);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: white;
}

.footer-download-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.social-links {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.social-links a {
  display: inline-block;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.social-links a:hover {
  transform: translateY(-3px);
  opacity: 0.8;
}

.social-links img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.mt-20 {
  margin-top: 20px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: var(--spacing-md);
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   Animations
   ======================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus Indicators */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   Utilities
   ======================================== */

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

.mb-0 {
  margin-bottom: 0;
}

.mt-20 {
  margin-top: 20px;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .hero-section,
  .cta-section,
  .footer {
    background: white;
    color: black;
  }

  .btn,
  .cta-buttons,
  .cta-buttons-large {
    display: none;
  }
}
