/* Learn & Explore Landing Page Styles */

.learn-explore-page {
  min-height: calc(100vh - 120px);
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 320px; /* Reduced by 20% from 400px */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible; /* Allow autocomplete suggestions to extend beyond hero */
  background: #f8f9fa; /* Fallback background */
}

/* Hero background image with transparency */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://storypie-entity-content-development.s3.us-east-2.amazonaws.com/assets/landingpages/learn.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.92; /* 92% transparent */
  z-index: 1;
}

/* Production environment override */
body.production .hero-section::before {
  background-image: url('https://storypie-entity-content-production.s3.us-east-2.amazonaws.com/assets/landingpages/learn.png');
}

/* Hero gradient overlay (Flutter pinkAccent to blueAccent) */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #F50057 0%, #448AFF 100%); /* Flutter pinkAccent to blueAccent */
  opacity: 0.6; /* Subtle overlay so background image still shows through */
  z-index: 2;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 3; /* Above background image and gradient overlay, below text content */
}

.hero-content {
  position: relative;
  z-index: 4; /* Above background image, gradient overlay, and dark overlay */
  text-align: center;
  color: white;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hero Search Bar */
.hero-search-container {
  position: relative; /* Enable z-index for autocomplete */
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-search-container .search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.hero-search-container .search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.hero-search-container .search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-search-container .search-input::placeholder {
  color: #666;
}

.hero-search-container .search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #F50057 0%, #448AFF 100%); /* Same gradient as hero overlay */
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-search-container .search-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-search-container .search-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
}

.hero-search-container .search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 99999; /* Much higher z-index to appear above all content */
  max-height: 300px;
  overflow-y: auto;
  display: none;
  margin-top: 8px;
}

.hero-search-container .suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.hero-search-container .suggestion-item:last-child {
  border-bottom: none;
}

.hero-search-container .suggestion-item:hover {
  background-color: #f8f9fa;
}

.hero-search-container .suggestion-text {
  font-weight: 500;
  color: #333;
}

.hero-search-container .suggestion-type {
  font-size: 0.75rem;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
  background: #6c757d;
}

/* Entity type specific colors for hero search */
.hero-search-container .suggestion-type.biography { background: #667eea; }
.hero-search-container .suggestion-type.place { background: #28a745; }
.hero-search-container .suggestion-type.event { background: #dc3545; }
.hero-search-container .suggestion-type.invention { background: #ffc107; color: #333; }
.hero-search-container .suggestion-type.concept { background: #6f42c1; }
.hero-search-container .suggestion-type.myth { background: #fd7e14; }
.hero-search-container .suggestion-type.creations { background: #8e44ad; }

/* Categories Section */
.categories-section {
  padding: 4rem 0;
  /* Removed: background-color to eliminate grey glow behind cards */
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Fixed: Show exactly 3 columns on desktop */
  gap: 2rem;
  margin-top: 2rem;
}

.category-card {
  /* Removed: all container styling - just pure image */
  /* Removed: fixed height - let images determine their own height */
  background: none; /* Explicitly remove any background */
}

/* Removed: hover animation */

.category-link {
  display: block;
  text-decoration: none;
  height: 100%;
  color: inherit;
  background: none; /* Explicitly remove any background */
}

.category-link:hover {
  color: inherit;
  text-decoration: none;
}

.category-image-container {
  position: relative;
  height: 100%;
  /* Removed: overflow: hidden to show pure image */
  background: none; /* Explicitly remove any background */
}

.category-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Fixed: Honor aspect ratio, don't crop */
  /* Removed: transition animation */
}

/* Removed: image hover animation */

.category-overlay {
  position: absolute;
  top: 1rem; /* Fixed: Match the left padding distance */
  left: 1rem; /* Match the top distance */
  /* Removed: right: 0 to avoid full width */
  /* Removed: black overlay background */
  color: white;
  padding: 0; /* Removed: No additional padding needed */
  /* Removed: text-align: center */
}

.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  /* Removed: text-shadow */
}

.category-count {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0;
  /* Removed: text-shadow */
}

/* Footer */
.footer {
  background-color: #2c3e50;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-brand img {
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0;
}

.footer-links {
  text-align: right;
}

.footer-links a {
  color: white;
  text-decoration: none;
  margin-left: 1.5rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 1;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
  }
  
  /* Hero Search Mobile Styles */
  .hero-search-container {
    margin-top: 1.5rem;
    padding: 0 1rem;
  }
  
  .hero-search-container .search-container {
    max-width: 100%;
  }
  
  .hero-search-container .search-input {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border-radius: 50px; /* Ensure pill shape on mobile */
  }
  
  .hero-search-container .search-btn {
    width: 36px;
    height: 36px;
    right: 6px;
    display: flex; /* Ensure same display as desktop */
    align-items: center;
    justify-content: center;
  }
  
  .hero-search-container .search-btn svg {
    width: 16px;
    height: 16px;
  }
  
  /* Ensure autocomplete displays properly on mobile */
  .hero-search-container .search-suggestions {
    z-index: 99999; /* Same high z-index on mobile */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  
  /* Mobile ellipsis for long suggestion titles */
  .hero-search-container .suggestion-text {
    max-width: 200px; /* Limit width on mobile */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .hero-section {
    height: 225px; /* Reduced by 25% from 300px */
  }
  
  .categories-section {
    padding: 0rem 0; /* Mobile: no top/bottom padding */
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr); /* Fixed: Show 2 columns on tablet */
    gap: 1.5rem;
  }
  
  /* .category-card height removed - let images determine their own height */
  
  .category-title {
    font-size: 1.3rem;
  }
  
  .category-overlay {
    top: 0.6rem; /* Mobile: reduced from 1rem */
    left: 0.9rem; /* Mobile: reduced from 1rem */
  }
  
  .footer-links {
    text-align: left;
    margin-top: 1rem;
  }
  
  .footer-links a {
    margin-left: 0;
    margin-right: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr); /* Fixed: Show 2 columns on mobile instead of 1 */
    gap: 1rem;
  }
  
  /* .category-card height removed - let images determine their own height */
  
  .categories-section {
    padding: 1.5rem 0;
  }
}

/* RTL Support */
.rtl .footer-links {
  text-align: left;
}

.rtl .footer-links a {
  margin-left: 0;
  margin-right: 1.5rem;
}

@media (max-width: 768px) {
  .rtl .footer-links {
    text-align: right;
  }
  
  .rtl .footer-links a {
    margin-right: 0;
    margin-left: 1.5rem;
  }
}

/* Loading State */
.category-image[loading] {
  background-color: #e9ecef;
  background-image: linear-gradient(45deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  background-size: 400% 100%;
  animation: loading 1.5s infinite;
}

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

/* Accessibility */
.category-link:focus {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

/* Removed: focus-within animation to match no-hover design */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero-overlay {
    background: rgba(0, 0, 0, 0.7);
  }
  
  /* Removed: category-overlay background since we removed the overlay entirely */
}

/* Animations removed - no longer needed */
