/* AI REPO ADVENTURES HOMEPAGE THEME - LIGHT */
:root {
  /* ===== COLOR PALETTE ===== */
  --primary-bg: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
  --body-overlay: radial-gradient(circle at 25% 75%, rgba(102, 126, 234, 0.03) 0%, transparent 50%), radial-gradient(circle at 75% 25%, rgba(118, 75, 162, 0.02) 0%, transparent 50%);
  --primary-text: #2d3748;
  --heading-color: #1a202c;
  --paragraph-color: #4a5568;
  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --accent-tertiary: #f093fb;
  --title-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* ===== TYPOGRAPHY ===== */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  --heading-weight: 600;

  /* ===== EFFECTS ===== */
  --text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --glow-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);

  /* ===== NAVBAR ===== */
  --navbar-bg: rgba(255, 255, 255, 0.98);
  --navbar-border: none;
  --navbar-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);

  /* ===== CONTENT AREAS ===== */
  --content-bg: rgba(255, 255, 255, 0.95);
  --content-border: 1px solid #e2e8f0;
  --content-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  --section-border: 1px solid #e2e8f0;

  /* ===== BACKGROUND IMAGES ===== */
  --story-bg-image: url('images/ai-adventures.png');
  --story-background-position-percentage: 50%;
}

/* ===== ANIMATIONS FOR WOW FACTOR ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
  }
  50% {
    box-shadow: 0 10px 50px rgba(102, 126, 234, 0.3);
  }
}

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes slowPan {
  0% {
    transform: scale(1.1) translate(-8%, -5%);
  }
  25% {
    transform: scale(1.15) translate(-2%, -8%);
  }
  50% {
    transform: scale(1.12) translate(2%, -3%);
  }
  75% {
    transform: scale(1.08) translate(-5%, -7%);
  }
  100% {
    transform: scale(1.1) translate(-8%, -5%);
  }
}

@keyframes loadingBar {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Base styles from theme system */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  margin: 0;
  padding: 0;
}

body {
  background: #f7fafc;
  background-attachment: fixed;
  color: var(--primary-text);
  font-family: var(--font-primary);
  font-weight: 400;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
  display: flex;
  flex-direction: column;
}

/* Ensure no gaps around body */
body::before,
body::after {
  margin: 0;
  padding: 0;
}

/* Page loading effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
  transform: translateX(-100%);
  animation: loadingBar 2s ease-out;
  z-index: 9999;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--body-overlay);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 160px); /* Subtract navbar and footer height */
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--navbar-bg);
  border-bottom: var(--navbar-border);
  box-shadow: var(--navbar-shadow);
  padding: 1rem 0;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left a {
  color: var(--heading-color);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-right .github-link {
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.nav-right .github-link:hover {
  opacity: 1;
}

/* ===== TYPOGRAPHY ===== */
h1 {
  background: var(--title-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 2rem;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  text-shadow: var(--glow-shadow);
  position: relative;
}

h2 {
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  border-bottom: var(--section-border);
  padding-bottom: 0.8rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  text-shadow: var(--text-shadow);
  font-size: 1.8rem;
}

h3 {
  color: var(--accent-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

p {
  color: var(--paragraph-color);
  margin-bottom: 1.2rem;
  line-height: 1.7;
  font-size: 1.1rem;
}

/* ===== HERO SECTION WITH BACKGROUND ===== */
.hero-section {
  position: relative;
  background: transparent;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
  animation: fadeIn 1s ease-out, pulseGlow 6s ease-in-out infinite;
  min-height: 400px;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 120%;
  height: 120%;
  background-image: var(--story-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: 1;
  will-change: transform;
  animation: slowPan 30s ease-in-out infinite;
}

.hero-section:hover .hero-background {
  animation-play-state: paused;
  filter: brightness(1.1);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 3rem;
  text-align: center;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  letter-spacing: -1px;
  background: none;
  -webkit-text-fill-color: unset;
  animation: fadeInUp 1s ease-out 0.3s both;
  position: relative;
}

.hero-content h1::after {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  right: -10px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  animation: shimmer 3s ease-in-out 2s infinite;
}

.hero-content h1 .subtitle {
  display: block;
  font-size: 0.6em;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
}

/* Welcome Section */
.welcome-section {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.welcome-section p {
  font-size: 1.2rem;
  line-height: 1.7;
  margin: 0 auto;
  color: var(--paragraph-color);
  font-weight: 400;
}

/* ===== STORY CONTENT WITH BACKGROUND ===== */
.story-content {
  background: var(--content-bg);
  border-radius: 15px;
  padding: 1rem;
  backdrop-filter: blur(5px);
  margin-bottom: 2rem;
}

.story-content h1 {
  position: relative;
  background-image: var(--story-bg-image);
  background-size: cover;
  background-position: center var(--story-background-position-percentage);
  background-repeat: no-repeat;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  border-radius: 15px;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 3rem;
  font-size: 4rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.story-content h1::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.story-content h1 * {
  position: relative;
  z-index: 2;
}

/* ===== HOMEPAGE SPECIFIC STYLES ===== */
.quest-preview {
  background: var(--content-bg);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(5px);
  border: var(--content-border);
  box-shadow: var(--content-shadow);
}

.quest-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  font-family: var(--font-code);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-line;
}

.theme-selector {
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  animation: fadeIn 1s ease-out 0.8s both;
}

.theme-selector h2 {
  text-align: center;
  color: var(--heading-color);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  border: none;
  padding-bottom: 0;
  position: relative;
}

.theme-selector h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  animation: fadeIn 1s ease-out 1s both;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
  margin-left: auto;
  margin-right: auto;
}

.theme-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animation for cards */
.theme-card:nth-child(1) { animation-delay: 1s; }
.theme-card:nth-child(2) { animation-delay: 1.1s; }
.theme-card:nth-child(3) { animation-delay: 1.2s; }
.theme-card:nth-child(4) { animation-delay: 1.3s; }

/* Animated gradient border on hover */
.theme-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #667eea);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: gradientShift 3s ease infinite;
  z-index: 1;
}

.theme-card:hover::before {
  opacity: 1;
}

.theme-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
  border-color: transparent;
  background: #ffffff;
}

.theme-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.theme-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  background: #ffffff;
}

.theme-info h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--heading-color);
  font-size: 1.3rem;
}

.theme-info p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--paragraph-color);
  line-height: 1.5;
}

/* Remove quest list styles - no longer needed */

.theme-preview {
  width: 100%;
  height: 180px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  margin: 0;
  position: relative;
}

.theme-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-card:hover .theme-preview img {
  transform: scale(1.05);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navbar-bg);
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 0;
  margin-top: auto;
  width: 100%;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
  color: var(--paragraph-color);
  font-size: 0.95rem;
}

.footer-content .repo-link {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-content .repo-link:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 769px) and (max-width: 1200px) {
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container { padding: 1rem; }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1.1rem;
  }
  
  .hero-content {
    padding: 3rem 2rem;
    min-height: 200px;
  }
  
  .story-content h1 {
    min-height: 250px;
    padding: 2rem 1rem;
    font-size: 2.5rem;
  }
  
  .theme-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .quest-preview, .theme-selector {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .hero-content {
    padding: 2.5rem 1.5rem;
    min-height: 160px;
  }
  
  .story-content h1 {
    min-height: 200px;
    font-size: 2rem;
  }
  
  .theme-icon {
    font-size: 2.5rem;
  }
}