/* ========================================
   IntelDigest - Main Landing Page
   Language Selection
   ======================================== */

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

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Animated background particles */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: float-particle 20s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 16s; }

@keyframes float-particle {
  0%, 100% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}

/* Main container */
.landing-container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px;
  max-width: 800px;
  width: 100%;
}

/* Logo */
.logo-container {
  margin-bottom: 40px;
  animation: fadeInDown 1s ease;
}

.logo-container img {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}

/* Title */
.title {
  color: white;
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 1s ease;
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.3rem;
  margin-bottom: 50px;
  animation: fadeInUp 1s ease 0.2s backwards;
}

/* Language cards */
.language-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  animation: fadeInUp 1s ease 0.4s backwards;
}

.language-card {
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 35px 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.language-card:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.language-flag {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.language-name {
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
  display: block;
}

.language-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 8px;
  display: block;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .landing-container {
    padding: 30px 20px;
    width: 100%;
  }

  .logo-container {
    margin-bottom: 25px;
  }

  .logo-container img {
    width: 80px;
    height: 80px;
  }

  .title {
    font-size: 2.2rem;
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 35px;
    padding: 0 10px;
  }

  .language-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .language-card {
    padding: 25px 20px;
  }

  .language-flag {
    font-size: 2.5rem;
  }

  .language-name {
    font-size: 1.2rem;
  }

  .language-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .landing-container {
    padding: 20px 15px;
  }

  .logo-container img {
    width: 70px;
    height: 70px;
  }

  .title {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .language-card {
    padding: 20px 15px;
    min-height: 100px;
  }

  .language-flag {
    font-size: 2rem;
  }

  .language-name {
    font-size: 1.1rem;
  }

  .language-desc {
    font-size: 0.8rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .language-card {
    min-height: 120px;
  }

  .language-card:active {
    background-color: rgba(255, 255, 255, 0.3);
  }
}

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

/* Prevent horizontal scroll */
html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
  .landing-container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(40px, env(safe-area-inset-top));
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }

  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}
