/* =========================================================
   AksharaChitra – Optimized & User-Friendly CSS v12.0
   Enhanced Landing Section with AI Features
   ========================================================= */

/* -------------------- 0) Root Variables -------------------- */
:root {
  /* Colors */
  --accent: #00bfa6;
  --accent-hover: #00d4b8;
  --primary: #1e88e5;
  --primary-700: #1565c0;
  --primary-hover: #1976d2;
  --muted: #6b7280;
  --text: #111827;
  --card: #ffffff;
  --bg: #f6f7fb;
  --glass: rgba(255, 255, 255, 0.92);
  --glass-hover: rgba(255, 255, 255, 0.96);
  --danger: #e53935;
  --success: #10b981;
  --warning: #f59e0b;
  
  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1200px;
  --ui-gap: 16px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.04);
  --shadow-md: 0 8px 24px rgba(2, 6, 23, 0.08);
  --shadow-lg: 0 16px 40px rgba(2, 6, 23, 0.12);
  
  /* Transitions */
  --transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography */
  --font-sans: "Poppins", "Inter", system-ui, -apple-system, sans-serif;
  
  /* Focus ring */
  --focus-ring: rgba(30, 136, 229, 0.15);
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --card: #1a1f2e;
    --bg: #0f141f;
    --glass: rgba(26, 31, 46, 0.85);
    --text: #e8eef5;
    --muted: #9fb0c7;
  }
}

body.dark {
  --card: #1a1f2e;
  --bg: #0f141f;
  --glass: rgba(26, 31, 46, 0.85);
  --text: #e8eef5;
  --muted: #9fb0c7;
}

/* -------------------- 1) Reset & Base -------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* -------------------- 2) Hero Landing Section -------------------- */
.about-intro {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 60px);
  color: white;
  text-align: center;
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.about-intro::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.3; }
}

.about-intro-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.about-intro-header h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.highlight {
  color: #ffd700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.home-intro-logo {
  width: clamp(60px, 10vw, 90px);
  height: clamp(60px, 10vw, 90px);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  transition: transform var(--transition);
}

.home-intro-logo:hover {
  transform: scale(1.1) rotate(5deg);
}

.subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin-bottom: 20px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.about-intro p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
  margin: 15px auto;
  max-width: 800px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.about-intro strong {
  color: #ffd700;
  font-weight: 700;
}

/* -------------------- 3) Why Choose Us Section -------------------- */
.why-choose-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 50px);
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}

.why-choose-section h2 {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--primary);
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

.why-choose-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.comparison-card {
  background: var(--glass);
  border-radius: 12px;
  padding: 25px;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.comparison-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.comparison-card.aksharachitra {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-color: var(--primary);
}

.comparison-card h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.comparison-card.aksharachitra h3 {
  color: var(--primary);
}

.comparison-card.others h3 {
  color: var(--muted);
}

.comparison-features {
  list-style: none;
  padding: 0;
}

.comparison-features li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: start;
  gap: 10px;
  font-size: 0.95rem;
}

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

.comparison-card.aksharachitra .comparison-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.comparison-card.others .comparison-features li::before {
  content: '✗';
  color: var(--danger);
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* -------------------- 4) AI Features Showcase -------------------- */
.ai-features-showcase {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 50px);
  margin-bottom: 40px;
  color: white;
  position: relative;
  overflow: hidden;
}

.ai-features-showcase::before {
  content: '🤖';
  position: absolute;
  font-size: 200px;
  opacity: 0.1;
  right: -50px;
  top: -50px;
  animation: float 6s ease-in-out infinite;
}

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

.ai-features-showcase h2 {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 15px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.ai-features-showcase > p {
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 30px;
  opacity: 0.95;
}

.ai-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  position: relative;
  z-index: 1;
}

.ai-feature-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition);
}

.ai-feature-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-5px);
}

.ai-feature-card .icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
}

.ai-feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.ai-feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* -------------------- 5) Optimized Dropdowns -------------------- */
select, .lang-select {
  width: 100%;
  max-width: 100%;
  padding: 10px 35px 10px 12px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  border-radius: var(--radius-sm);
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
}

select:hover, .lang-select:hover {
  border-color: var(--primary);
}

select:focus, .lang-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.lang-select.compact {
  max-width: 200px;
  padding: 8px 30px 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Mobile optimized dropdowns */
@media (max-width: 768px) {
  select, .lang-select {
    padding: 12px 35px 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    touch-action: manipulation;
  }
  
  .lang-select.compact {
    max-width: 100%;
    padding: 10px 30px 10px 12px;
  }
}

/* -------------------- 6) Key Features Grid -------------------- */
.home_feature_container {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(25px, 4vw, 40px);
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.home_feature_title {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  color: var(--primary);
  margin-bottom: 25px;
  text-align: center;
}

.home_feature_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  list-style: none;
  padding: 0;
}

.home_feature_item {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  padding: 18px;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  transition: all var(--transition);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.home_feature_item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

/* -------------------- 7) CTA Buttons -------------------- */
.home_feature_cta {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

#home_feature_create_btn,
#home_feature_share_btn {
  padding: 14px 30px;
  border-radius: 12px;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
}

#home_feature_create_btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow-md);
}

#home_feature_create_btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

#home_feature_share_btn {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

#home_feature_share_btn:hover {
  background: var(--primary);
  color: white;
}

.home_feature_share_icon {
  width: 24px;
  height: 24px;
}

/* -------------------- 8) TTS & Voice Controls -------------------- */
.tts-voice-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.tts-voice-section h3 {
  color: var(--primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tts-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.tts-btn, .voice-btn {
  padding: 12px 24px;
  border-radius: 10px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tts-btn:hover, .voice-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.tts-btn.active, .voice-btn.listening {
  background: linear-gradient(135deg, #ff6f61, #ff8a80);
  color: white;
  border-color: transparent;
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 111, 97, 0.6); }
  50% { box-shadow: 0 0 0 15px rgba(255, 111, 97, 0); }
}

/* -------------------- 9) Quick Help Section -------------------- */
.home_help_container {
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
  border-radius: var(--radius);
  padding: clamp(25px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}

.home_help_title {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  color: #00838f;
  margin-bottom: 25px;
  text-align: center;
}

.home_help_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  list-style: none;
  padding: 0;
}

.home_help_item {
  background: rgba(255, 255, 255, 0.7);
  padding: 18px;
  border-radius: 10px;
  border-left: 4px solid #00acc1;
  transition: all var(--transition);
  backdrop-filter: blur(5px);
}

.home_help_item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(5px);
}

.home_help_tip {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 20px;
  border-radius: 10px;
  margin-top: 25px;
  font-weight: 600;
}

/* -------------------- 10) Desktop Fonts Tutorial -------------------- */
.desktop-fonts-tutorial {
  margin-top: 40px;
}

.tutorial-container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(25px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}

.tutorial-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--primary);
}

.tutorial-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  color: var(--primary);
}

.tutorial-subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-top: 10px;
}

.feature-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 10px;
}

.steps-container {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.step-card {
  background: var(--glass);
  border-radius: 12px;
  padding: 20px;
  border-left: 5px solid var(--primary);
  transition: all var(--transition);
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.step-number {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: bold;
  flex-shrink: 0;
}

.step-title {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: var(--text);
  font-weight: 600;
}

.step-description {
  color: var(--muted);
  line-height: 1.7;
}

.benefits-section {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: white;
  padding: 30px;
  border-radius: var(--radius);
  margin-top: 30px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.benefit-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.benefit-item .emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
}

.cta-section {
  text-align: center;
  margin-top: 30px;
  padding: 30px;
  background: linear-gradient(135deg, #fa709a, #fee140);
  border-radius: var(--radius);
}

.cta-button {
  background: var(--primary);
  color: white;
  padding: 14px 40px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* -------------------- 11) Responsive Design -------------------- */
@media (max-width: 768px) {
  .about-intro {
    padding: 40px 20px;
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  
  .ai-features-grid {
    grid-template-columns: 1fr;
  }
  
  .home_feature_grid,
  .home_help_grid {
    grid-template-columns: 1fr;
  }
  
  .home_feature_cta {
    flex-direction: column;
  }
  
  #home_feature_create_btn,
  #home_feature_share_btn {
    width: 100%;
    justify-content: center;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .about-intro-header {
    flex-direction: column;
  }
  
  .home-intro-logo {
    width: 60px;
    height: 60px;
  }
  
  .tts-controls {
    flex-direction: column;
  }
  
  .tts-btn, .voice-btn {
    width: 100%;
    justify-content: center;
  }
}

/* -------------------- 12) Accessibility -------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* -------------------- 13) Animations -------------------- */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

.home_feature_fade {
  animation: fadeIn 0.6s ease-in;
}

/* -------------------- END OF CSS -------------------- */