/* ===================================
   Polyingo Landing Page Styles
   Inspired by ParagraphWidget & WordView
   =================================== */

:root {
  /* Primary Colors - matching Flutter's Colors.blue */
  --primary: #2196F3;
  --primary-light: #64B5F6;
  --primary-dark: #1976D2;

  /* Accent Colors */
  --accent: #00C853;
  --accent-light: #69F0AE;

  /* Neutral Colors - Dark Mode (default) */
  --bg-dark: #0F1419;
  --bg-card: #1A1F26;
  --bg-card-hover: #242B35;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --divider: rgba(255, 255, 255, 0.1);
  --navbar-bg: rgba(15, 20, 25, 0.8);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #2196F3 0%, #64B5F6 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(33, 150, 243, 0.15) 0%, transparent 50%);

  /* Spacing */
  --section-padding: 100px 0;
  --container-padding: 0 24px;
  --card-radius: 20px;
  --card-padding: 24px;

  /* Transitions */
  --transition: 0.3s ease;
}

/* Light Mode */
[data-theme="light"] {
  --bg-dark: #F5F7FA;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0F2F5;
  --text-primary: #1A1F26;
  --text-secondary: rgba(26, 31, 38, 0.7);
  --text-muted: rgba(26, 31, 38, 0.5);
  --divider: rgba(26, 31, 38, 0.1);
  --navbar-bg: rgba(255, 255, 255, 0.9);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(33, 150, 243, 0.08) 0%, transparent 50%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Typography ===== */
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--container-padding);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header p {
  margin-top: 16px;
  font-size: 1.125rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section-header.left-aligned {
  text-align: left;
}

.section-header.left-aligned p {
  margin-left: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--divider);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--divider);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(68, 138, 255, 0.1);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-icon {
  font-size: 1.2em;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--divider);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-icon-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.theme-toggle .fa-sun {
  display: none;
}

.theme-toggle .fa-moon {
  display: inline;
}

[data-theme="light"] .theme-toggle .fa-sun {
  display: inline;
}

[data-theme="light"] .theme-toggle .fa-moon {
  display: none;
}

.nav-cta {
  padding: 10px 24px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-cta {
  padding: 10px 24px;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--divider);
  padding: 20px;
  z-index: 999;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  display: block;
  padding: 12px;
  border-radius: 10px;
  transition: var(--transition);
}

.mobile-nav-links a:hover {
  background: var(--bg-card);
}

/* ===== Hero Section ===== */
.hero {
  padding: 160px 0 100px;
  background: var(--gradient-hero);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(68, 138, 255, 0.15);
  border: 1px solid rgba(68, 138, 255, 0.3);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.hero-description {
  font-size: 1.25rem;
  margin: 24px 0 32px;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.language-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.lang-badge {
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--divider);
}

/* Phone Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
}

.phone-mockup {
  position: relative;
  width: 300px;
  height: 600px;
  background: #1A1F26;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--divider);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  border-radius: 30px;
  overflow: hidden;
  padding: 20px;
}

.app-demo {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-title {
  font-weight: 600;
}

.demo-level {
  padding: 4px 12px;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.demo-word-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 24px;
  border: 1px solid var(--divider);
}

.word-main {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.word-translation {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.word-actions {
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--divider);
  padding-top: 16px;
}

.action-icon {
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
}

.action-icon:hover {
  opacity: 1;
}

.demo-progress {
  margin-top: auto;
}

.progress-bar {
  height: 8px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  width: 60%;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  animation: progress-pulse 2s infinite;
}

@keyframes progress-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.progress-text {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Features Section ===== */
.features {
  padding: var(--section-padding);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  border: 1px solid var(--divider);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(68, 138, 255, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: inline-block;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.95rem;
}

/* ===== Games Section ===== */
.games {
  padding: var(--section-padding);
  background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(68, 138, 255, 0.05) 50%, var(--bg-dark) 100%);
}

.games-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.tab-btn {
  padding: 14px 28px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 50px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 24px;
  border: 1px solid var(--divider);
  transition: var(--transition);
}

.game-card:hover {
  transform: scale(1.02);
  border-color: var(--primary);
}

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

.game-icon {
  font-size: 1.75rem;
}

.game-badge {
  padding: 4px 12px;
  background: rgba(68, 138, 255, 0.15);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
}

.game-card h4 {
  margin-bottom: 8px;
}

.game-card p {
  font-size: 0.875rem;
}

.skill-badges {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 50px;
  flex-wrap: wrap;
}

.skill-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-radius: 50px;
  border: 1px solid var(--divider);
}

.skill-icon {
  font-size: 1.25rem;
}

/* ===== AI Section ===== */
.ai-section {
  padding: var(--section-padding);
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.ai-features {
  list-style: none;
  margin-top: 32px;
}

.ai-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
}

.check-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Chat Mockup */
.chat-mockup {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  border: 1px solid var(--divider);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--divider);
}

.chat-avatar {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.chat-info {
  display: flex;
  flex-direction: column;
}

.chat-name {
  font-weight: 600;
}

.chat-status {
  font-size: 0.75rem;
  color: var(--accent);
}

.chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
}

.message {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 18px;
}

.message.bot {
  background: var(--bg-dark);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.message.user {
  background: var(--primary);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.message p {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ===== Pricing Section ===== */
.pricing {
  padding: var(--section-padding);
  background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(0, 230, 118, 0.03) 100%);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 40px;
  border: 1px solid var(--divider);
  position: relative;
  transition: var(--transition);
}

.pricing-card:hover {
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 60px rgba(68, 138, 255, 0.2);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  background: var(--gradient-primary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--divider);
}

.plan-header h3 {
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.amount {
  font-size: 3rem;
  font-weight: 800;
}

.period {
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  margin-bottom: 32px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.plan-features .check {
  color: var(--accent);
  font-weight: 700;
}

.plan-features .limit {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pricing-card .btn {
  width: 100%;
}

/* ===== Download Section ===== */
.download {
  padding: var(--section-padding);
  text-align: center;
}

.download-content h2 {
  margin-bottom: 16px;
}

.download-content p {
  font-size: 1.125rem;
  margin-bottom: 40px;
}

.download-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 16px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-download:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.store-icon {
  font-size: 2rem;
}

.store-text {
  text-align: left;
}

.store-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.store-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
  padding: 60px 0 30px;
  border-top: 1px solid var(--divider);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  margin-top: 12px;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 80px;
}

.footer-column h4 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.footer-column ul {
  list-style: none;
}

.social-icons {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.social-icons a {
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--divider);
}

.social-icons a:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.footer-column li {
  margin-bottom: 12px;
}

.footer-column a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--divider);
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    order: 1;
  }

  .hero-visual {
    order: 2;
  }

  .hero-description {
    max-width: 100%;
  }

  .hero-buttons {
    justify-content: center;
  }

  .language-badges {
    justify-content: center;
  }

  .ai-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .section-header.left-aligned {
    text-align: center;
  }

  .section-header.left-aligned p {
    margin-left: auto;
  }

  .ai-features {
    max-width: 500px;
    margin: 32px auto 0;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
    --card-padding: 20px;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu.active {
    display: block;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .phone-mockup {
    width: 260px;
    height: 520px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .games-tabs {
    flex-direction: column;
    align-items: center;
  }

  .tab-btn {
    width: 100%;
    max-width: 300px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    gap: 40px;
  }

  .download-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-download {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .skill-badges {
    flex-direction: column;
    align-items: center;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Light Mode Specific Adjustments ===== */
[data-theme="light"] .phone-mockup {
  background: #FFFFFF;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .phone-screen {
  background: #F5F7FA;
}

[data-theme="light"] .feature-card:hover {
  box-shadow: 0 20px 40px rgba(33, 150, 243, 0.15);
}

[data-theme="light"] .pricing-card.featured {
  box-shadow: 0 0 60px rgba(33, 150, 243, 0.15);
}

[data-theme="light"] .message.bot {
  background: #F0F2F5;
}

[data-theme="light"] .btn-primary {
  color: #FFFFFF;
}

[data-theme="light"] .tab-btn.active {
  color: #FFFFFF;
}

[data-theme="light"] .badge {
  background: rgba(33, 150, 243, 0.1);
  border-color: rgba(33, 150, 243, 0.2);
}

[data-theme="light"] .game-badge {
  background: rgba(33, 150, 243, 0.1);
}