/* 
 * Landing Page Styles for Youth Innovations Blog
 * Modern, responsive design with animations and clean aesthetics
 * Color Palette: Primary #4CAF50 (Green), Secondary #2196F3 (Blue), Accent #FF5722 (Orange)
 */

:root {
  --primary-color: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #81C784;
  --secondary-color: #2196F3;
  --secondary-dark: #1976D2;
  --secondary-light: #64B5F6;
  --accent-color: #FF5722;
  --accent-dark: #E64A19;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-light: #FFFFFF;
  --bg-light: #FAFAFA;
  --bg-white: #FFFFFF;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
  --shadow-xl: 0 12px 24px rgba(0,0,0,0.18);
  --border-radius: 12px;
  --transition-speed: 0.3s;
  --max-width: 1200px;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --bg-light: #1A1A1A;
    --bg-white: #2D2D2D;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.5);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.6);
  }
}

/* Global Styles */
.landing-page {
  width: 100%;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 1rem;
}

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

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(33, 150, 243, 0.9) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 800px;
  padding: 2rem;
  color: var(--text-light);
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-tagline {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.hero-description {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed) ease;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--text-light);
  color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-light);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border-color: var(--text-light);
}

.btn-secondary:hover {
  background: var(--text-light);
  color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--text-light);
  transform: translateY(-2px);
}

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

.animate-fade-in {
  animation: fadeIn 1s ease-out;
}

.animate-fade-in-delay {
  animation: fadeIn 1s ease-out 0.3s both;
}

.animate-fade-in-delay-2 {
  animation: fadeIn 1s ease-out 0.6s both;
}

.animate-fade-in-delay-3 {
  animation: fadeIn 1s ease-out 0.9s both;
}

/* Categories Section */
.categories-section {
  padding: 5rem 0;
  background: var(--bg-light);
}

.categories-scroll-wrapper {
  position: relative;
  overflow: hidden;
  margin: 0 -1rem;
  padding: 0 1rem;
}

.categories-grid-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.categories-grid-scroll::-webkit-scrollbar {
  height: 8px;
}

.categories-grid-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.categories-grid-scroll::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.categories-grid-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

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

.category-card {
  flex: 0 0 320px;
  background: var(--bg-white);
  padding: 2.5rem 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed) ease;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.category-icon {
  color: var(--primary-color);
  margin-bottom: 1rem;
  transition: transform var(--transition-speed) ease;
}

.category-card:hover .category-icon {
  transform: scale(1.1) rotate(5deg);
}

.category-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.category-count {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Recent Posts Section */
.recent-posts-section {
  padding: 5rem 0;
  background: var(--bg-white);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed) ease;
  border: 1px solid rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.post-thumbnail {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.1);
}

.post-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.post-category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--primary-color);
  color: var(--text-light);
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1;
}

.post-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.post-title a:hover {
  color: var(--primary-color);
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.post-tag {
  font-size: 0.8125rem;
  color: var(--secondary-color);
  text-decoration: none;
  padding: 0.25rem 0.625rem;
  background: rgba(33, 150, 243, 0.1);
  border-radius: 12px;
  transition: all var(--transition-speed) ease;
}

.post-tag:hover {
  background: var(--secondary-color);
  color: var(--text-light);
}

.read-more {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: gap var(--transition-speed) ease;
  gap: 0.25rem;
}

.read-more:hover {
  gap: 0.625rem;
}

.view-all-posts {
  text-align: center;
  margin-top: 2rem;
}

/* Stats Section */
.stats-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--text-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-card {
  text-align: center;
  padding: 2rem 1rem;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stat-label {
  font-size: 1.125rem;
  font-weight: 500;
  opacity: 0.95;
}

/* CTA Section */
.cta-section {
  padding: 5rem 0;
  background: var(--bg-light);
}

.cta-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.cta-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive Design */
@media (min-width: 1200px) {
  /* On large screens, show grid instead of scroll */
  .categories-grid-scroll {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
  }
  
  .category-card {
    flex: 1 1 auto;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-tagline {
    font-size: 1.25rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .category-card {
    flex: 0 0 280px;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .cta-title {
    font-size: 2rem;
  }
  
  .cta-description {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-tagline {
    font-size: 1.125rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
  
  .category-card {
    padding: 2rem 1rem;
  }
  
  .post-thumbnail {
    height: 180px;
  }
}

/* Lazy Loading Image Effect */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Enhanced Topic Cards */
.topic-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.topic-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.topic-card:hover::after {
  transform: scaleX(1);
}

/* Different gradient for each card */
.topic-card:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.topic-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.topic-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.topic-card:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.topic-card:nth-child(5) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.topic-card:nth-child(6) {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.topic-card .category-name {
  color: white;
  font-weight: 700;
  font-size: 1.6rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.topic-emoji {
  font-size: 4rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

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

.topic-card:hover .topic-emoji {
  animation: pulse 0.6s ease;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.category-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0.5rem 0 1rem;
  line-height: 1.5;
  font-weight: 400;
}

.topic-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.topic-card:hover .topic-badge {
  transform: translateX(5px);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Gradient Background for Topics Section */
.categories-section {
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.08) 0%, 
    rgba(118, 75, 162, 0.08) 50%,
    rgba(240, 147, 251, 0.08) 100%);
}

/* Print Styles */
@media print {
  .hero-section,
  .cta-section,
  .stats-section {
    display: none;
  }
  
  .post-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
