/**
 * Lecture Mind - Landing Page Styles
 *
 * Premium SaaS-style landing page with:
 * - Hero section with gradient background
 * - Feature cards with hover effects
 * - How it works timeline
 * - Tech stack showcase
 * - Enhanced footer
 */

/* ============================================
   SMOOTH SCROLLING & SCROLL OFFSET
   ============================================ */
html {
  scroll-behavior: smooth;
  /* Offset for fixed header when navigating via anchor links */
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

/* ============================================
   NAVIGATION HEADER (Landing)
   ============================================ */
.header-landing {
  background: transparent;
  border-bottom: none;
  position: fixed;
  width: 100%;
}

.header-landing.scrolled {
  /* Solid fallback for browsers without backdrop-filter */
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Enhanced glassmorphism for supporting browsers */
@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .header-landing.scrolled {
    background: var(--surface-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.dark .header-landing.scrolled {
  background: rgba(15, 23, 42, 0.95);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .dark .header-landing.scrolled {
    background: var(--surface-overlay);
  }
}

.brand-name-header {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  background: linear-gradient(135deg, var(--foreground) 0%, var(--primary) 40%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 8s ease-in-out infinite;
}

@keyframes shimmerText {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* Premium Logo Animation */
.brand-logo-icon {
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.3));
  transition: all 0.3s var(--ease-out);
  animation: logoBreath 4s ease-in-out infinite;
}

@keyframes logoBreath {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.5)); }
}

.dark .brand-logo-icon {
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.4));
  animation: logoBreathe-dark 4s ease-in-out infinite;
}

@keyframes logoBreathe-dark {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.5)); }
  50% { filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.7)); }
}

.brand-logo:hover .brand-logo-icon {
  filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.6));
  transform: scale(1.05);
}

.dark .brand-logo:hover .brand-logo-icon {
  filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.8));
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo-icon,
  .dark .brand-logo-icon,
  .brand-name-header {
    animation: none;
  }
}

.header-nav {
  display: none;
}

@media (min-width: 768px) {
  .header-nav {
    display: flex;
    gap: var(--space-6);
  }
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--foreground-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--foreground);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  /* Fix for mobile Safari 100vh bug - use dvh with fallback */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + var(--space-12)) var(--space-6) var(--space-12);
  overflow: hidden;
}

@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    padding: calc(var(--header-height) + var(--space-8)) var(--space-8);
    gap: var(--space-12);
  }
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(6, 182, 212, 0.15) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 70% 80%,
    rgba(139, 92, 246, 0.1) 0%,
    transparent 50%
  );
  animation: gradientShift 15s ease-in-out infinite;
}

.dark .hero-gradient {
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(6, 182, 212, 0.2) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 70% 80%,
    rgba(139, 92, 246, 0.15) 0%,
    transparent 50%
  );
}

@keyframes gradientShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(2%, 2%) rotate(1deg); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  opacity: 0.5;
}

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

@media (min-width: 1024px) {
  .hero-content {
    text-align: left;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1_5) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--foreground-muted);
  margin-bottom: var(--space-6);
}

.hero-badge-icon {
  font-size: var(--text-base);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: var(--font-bold);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-6);
}

.hero-title-gradient {
  display: block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--foreground-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
  max-width: 500px;
}

@media (min-width: 1024px) {
  .hero-subtitle {
    margin-left: 0;
    margin-right: auto;
  }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-10);
}

@media (min-width: 1024px) {
  .hero-cta {
    justify-content: flex-start;
  }
}

.btn-hero {
  box-shadow: var(--shadow-lg), 0 0 40px rgba(6, 182, 212, 0.3);
}

.btn-hero:hover {
  box-shadow: var(--shadow-xl), 0 0 60px rgba(6, 182, 212, 0.4);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: center;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-stats {
    justify-content: flex-start;
  }
}

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

.hero-stat-value {
  display: block;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--primary);
  font-family: var(--font-mono);
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--foreground-muted);
}

.hero-stat-divider {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

/* Hero Visual / Mockup */
.hero-visual {
  flex-shrink: 0;
  width: 100%;
  max-width: 500px;
  margin-top: var(--space-8);
}

@media (min-width: 1024px) {
  .hero-visual {
    margin-top: 0;
  }
}

.hero-mockup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.dark .hero-mockup {
  box-shadow: var(--shadow-glow-lg);
}

.mockup-header {
  padding: var(--space-3) var(--space-4);
  background: var(--background-subtle);
  border-bottom: 1px solid var(--border);
}

.mockup-dots {
  display: flex;
  gap: var(--space-2);
}

.mockup-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}

.mockup-dots span:first-child { background: #ef4444; }
.mockup-dots span:nth-child(2) { background: #f59e0b; }
.mockup-dots span:nth-child(3) { background: #22c55e; }

.mockup-content {
  padding: var(--space-6);
}

.mockup-search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.mockup-search svg {
  color: var(--foreground-muted);
  flex-shrink: 0;
}

.mockup-typing {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--foreground);
}

.mockup-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.mockup-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mockup-result {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--background-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.mockup-timestamp {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: var(--font-medium);
  flex-shrink: 0;
}

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

.mockup-text mark {
  background: var(--warning-bg);
  color: var(--warning);
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
}

/* ============================================
   SECTION COMMON STYLES
   ============================================ */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

.section-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--primary-bg);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--font-bold);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--foreground-muted);
  line-height: var(--leading-relaxed);
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
  padding: var(--space-20) 0;
  background: var(--background);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-6);
}

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

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

.feature-card {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  transition: all var(--duration-normal) var(--ease-spring);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-focus);
}

.dark .feature-card:hover {
  box-shadow: var(--shadow-glow-sm);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--feature-color), color-mix(in srgb, var(--feature-color) 60%, var(--accent)));
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-4);
}

.feature-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: white;
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.feature-description {
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  margin-bottom: var(--space-1);
}

.feature-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: var(--font-bold);
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works-section {
  padding: var(--space-20) 0;
  background: var(--background-subtle);
}

.steps-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.steps-line {
  display: none;
}

@media (min-width: 768px) {
  .steps-line {
    display: block;
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    transform: translateX(-50%);
  }
}

.step {
  display: flex;
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .step {
    align-items: center;
  }

  .step:nth-child(odd) {
    flex-direction: row-reverse;
    text-align: right;
  }

  .step:nth-child(odd) .step-content {
    align-items: flex-end;
  }
}

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

.step-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 350px;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-3);
}

.step-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--primary);
}

.step-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.step-description {
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  line-height: var(--leading-relaxed);
}

/* ============================================
   TECH STACK SECTION
   ============================================ */
.tech-section {
  padding: var(--space-20) 0;
  background: var(--background);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

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

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

.tech-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: all var(--duration-normal) var(--ease-spring);
}

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

.tech-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-3);
}

.tech-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.tech-icon.pytorch {
  color: #ee4c2c;
}

.tech-icon.faiss {
  color: var(--primary);
}

.tech-emoji {
  font-size: 2rem;
}

.tech-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.tech-desc {
  font-size: var(--text-xs);
  color: var(--foreground-muted);
}

/* ============================================
   APP SECTION
   ============================================ */
.app-section {
  padding: var(--space-20) 0;
  background: var(--background-subtle);
}

.app-main {
  padding: 0;
}

/* ============================================
   LANDING FOOTER
   ============================================ */
.footer-landing {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin: 0;
}

.footer-subtitle {
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-10);
}

.footer-column h4 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin: 0 0 var(--space-3) 0;
}

.footer-column a {
  display: block;
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  text-decoration: none;
  margin-bottom: var(--space-2);
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* Author Credits Section */
.footer-author {
  max-width: 1200px;
  margin: var(--space-6) auto 0;
  padding: var(--space-4) var(--space-6);
  text-align: center;
  background: linear-gradient(135deg,
    hsl(var(--primary-hsl) / 0.08) 0%,
    hsl(var(--accent-hsl) / 0.08) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--primary-hsl) / 0.15);
  position: relative;
  overflow: hidden;
}

.footer-author::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary) 50%,
    transparent 100%);
  opacity: 0.5;
}

.footer-author p {
  font-size: var(--text-base);
  color: var(--foreground);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.footer-author strong {
  color: var(--primary);
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-author-detail {
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  padding-left: var(--space-2);
  border-left: 2px solid hsl(var(--primary-hsl) / 0.3);
}

@media (max-width: 767px) {
  .footer-author p {
    flex-direction: column;
    gap: var(--space-1);
  }

  .footer-author-detail {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: var(--space-1);
  }
}

.footer-bottom {
  max-width: 1200px;
  margin: var(--space-8) auto 0;
  padding: var(--space-6) var(--space-6) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--text-sm);
  color: var(--foreground-muted);
  margin: 0;
}

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

/* Playground/dashboard views need extra top padding to clear fixed header on mobile */
@media (max-width: 767px) {
  #playground-view,
  #study-view,
  #lecture-detail-view,
  #dashboard-view {
    padding-top: calc(var(--header-height) + var(--space-4));
  }

  .section-container { padding: 0 var(--space-3); }
}

@media (max-width: 767px) {
  .hero-stats {
    flex-direction: column;
    gap: var(--space-4);
  }

  .hero-stat-divider {
    display: none;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS (AOS Replacement)
   ============================================ */

/* Initial state - elements hidden before animation */
[data-aos].aos-init {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-spring);
}

/* Animated state - elements visible */
[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* Different animation types */
[data-aos="fade-up"].aos-init {
  transform: translateY(30px);
}

[data-aos="fade-down"].aos-init {
  transform: translateY(-30px);
}

[data-aos="fade-left"].aos-init {
  transform: translateX(30px);
}

[data-aos="fade-right"].aos-init {
  transform: translateX(-30px);
}

[data-aos="zoom-in"].aos-init {
  transform: scale(0.9);
}

[data-aos="zoom-in"].aos-animate,
[data-aos="fade-left"].aos-animate,
[data-aos="fade-right"].aos-animate,
[data-aos="fade-down"].aos-animate {
  transform: translate(0) scale(1);
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-gradient {
    animation: none;
  }

  .mockup-cursor {
    animation: none;
    opacity: 1;
  }

  /* Disable scroll animations */
  [data-aos].aos-init {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
