/* 
 * homepage.css - Стили для главной страницы
 */

/* ----------- Общие стили секций ----------- */
.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: var(--spacing-md);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 60px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.section-title i {
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-xl);
}

.section-subtitle {
  font-size: var(--font-base);
  font-weight: normal;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
}

/* ----------- Улучшенная компактная hero-секция с ярким градиентом ----------- */
.hero-section {
  position: relative;
  padding: var(--spacing-lg) 0;
  margin-bottom: var(--spacing-md);
  text-align: center;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  
  /* НОВЫЙ: Киберпанк градиент */
  background: linear-gradient(135deg, #0f0f23 0%, #1a0d33 25%, #2d1b4e 50%, #1e3a8a 75%, #06b6d4 100%);
  
  /* НОВОЕ: Киберпанк эффекты */
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.3), 
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ДОБАВИТЬ после hero-section */
.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2306b6d4' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  z-index: 1;
}

/* НОВЫЕ: Киберпанк анимации для hero */
.hero-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
  animation: scan-line 3s linear infinite;
  z-index: 2;
}

@keyframes scan-line {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Улучшаем стиль текста для лучшей читаемости */
.hero-title {
  font-size: var(--font-3xl);
  font-weight: 900;
  color: white;
  margin: 0 0 var(--spacing-sm);
  letter-spacing: -0.03em;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.8), 0 3px 8px rgba(0, 0, 0, 0.3);
  line-height: 1.1;
  position: relative;
  z-index: 3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* НОВОЕ: Киберпанк свечение */
  animation: title-glow 2s ease-in-out infinite alternate;
}

@keyframes title-glow {
  0% { text-shadow: 0 0 20px rgba(6, 182, 212, 0.8), 0 3px 8px rgba(0, 0, 0, 0.3); }
  100% { text-shadow: 0 0 30px rgba(6, 182, 212, 1), 0 0 40px rgba(139, 92, 246, 0.5), 0 3px 8px rgba(0, 0, 0, 0.3); }
}

/* Улучшаем описание */
.hero-description {
  font-size: var(--font-base);
  color: rgba(255, 255, 255, 0.95);
  max-width: 70rem;
  margin: 0 auto var(--spacing-md);
  line-height: 1.4;
  position: relative;
  z-index: 2;
  /* Улучшаем рендеринг для лучшей четкости */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Улучшаем кнопки */
.hero-buttons {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  position: relative;
  z-index: 2;
}

.hero-buttons .btn {
  min-width: 160px;
  justify-content: center;
  font-weight: 700;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: var(--font-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Основная кнопка - четкий стиль */
.hero-buttons .btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.hero-buttons .btn-primary:hover {
  background: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Вторичная кнопка - прозрачный стиль */
.hero-buttons .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hero-buttons .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Применяем тот же стиль для архивных страниц и 404 */
.archive-hero-section, 
.error-hero-section {
  background: linear-gradient(135deg, var(--footer-bg) 0%, #2563eb 50%, #1e40af 100%);
  padding: var(--spacing-lg) 0;
  margin-bottom: var(--spacing-md);
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.25);
}

.archive-hero-section::before,
.error-hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  z-index: 1;
}

/* Код 404 */
.error-code {
  font-size: 4rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
  position: relative;
  z-index: 2;
}

/* Контейнер, чтобы текст был над градиентом */
.hero-section .container,
.archive-hero-section .container,
.error-hero-section .container {
  position: relative;
  z-index: 2;
}

/* ----------- Секция категорий ----------- */
.categories-section {
  margin-bottom: var(--spacing-2xl);
  padding-top: var(--spacing-md);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
  text-align: center;
  height: 180px;
  z-index: 1;
  border: 1px solid rgba(79, 70, 229, 0.1);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.3);
}

.category-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  transition: opacity 0.3s ease, transform 0.5s ease;
  z-index: -1;
}

.category-card:hover .category-bg {
  opacity: 0.12;
  transform: scale(1.05);
}

.category-title {
  font-size: var(--font-lg);
  font-weight: 700;
  margin: var(--spacing-sm) 0 var(--spacing-xs);
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.category-card:hover .category-title {
  color: var(--primary);
}

.category-count {
  font-size: var(--font-sm);
  color: var(--text-light);
  transition: color 0.3s ease;
}

.category-card:hover .category-count {
  color: var(--primary);
}

.category-icon {
  font-size: 2.5rem;
  color: var(--primary);
  transition: transform 0.3s ease, color 0.3s ease;
}

.category-card:hover .category-icon {
  transform: scale(1.2);
  color: var(--primary-dark);
}

/* ----------- Секция "Лучшее на сайте" ----------- */
.featured-section {
  margin-bottom: var(--spacing-2xl);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--spacing-xl);
}

.featured-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  height: 100%;
}

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

.featured-thumbnail {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 соотношение */
  overflow: hidden;
}

.featured-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-card:hover .featured-thumbnail img {
  transform: scale(1.05);
}

.featured-category {
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  color: white;
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.featured-badge {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: linear-gradient(to right, #f59e0b, #d97706);
  color: white;
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.featured-content {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.featured-title {
  font-size: var(--font-lg);
  font-weight: 700;
  margin: 0 0 var(--spacing-md);
  line-height: 1.3;
}

.featured-title a {
  color: var(--text-primary);
  transition: color 0.3s ease;
}

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

.featured-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.featured-features .feature-tag {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.3s ease;
}

.featured-features .feature-tag:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: auto;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
  font-size: var(--font-sm);
  color: var(--text-light);
  margin-bottom: var(--spacing-lg);
}

.featured-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.featured-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.featured-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ----------- Секция "Популярное" ----------- */
.trending-section {
  margin-bottom: var(--spacing-2xl);
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--spacing-xl);
}

.trending-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  height: 100%;
}

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

.trending-thumbnail {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 соотношение */
  overflow: hidden;
}

.trending-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.trending-card:hover .trending-thumbnail img {
  transform: scale(1.05);
}

.trending-badge {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: linear-gradient(to right, var(--danger), #b91c1c);
  color: white;
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Основной список модов */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-2xl);
}

.post-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

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

/* Улучшенное отображение звезд */
.star-rating {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  color: var(--star);
}

.star-rating i {
  font-size: var(--font-sm);
}

.rating-value {
  margin-left: var(--spacing-xs);
  font-weight: 600;
}

/* ----------- Медиа-запросы для адаптивности ----------- */
@media (max-width: 1200px) {
  .featured-grid,
  .trending-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 992px) {
  .hero-title {
    font-size: var(--font-2xl);
  }
  
  .hero-description {
    font-size: var(--font-lg);
  }
  
  .featured-grid,
  .trending-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: var(--font-xl);
  }
  
  .hero-description {
    font-size: var(--font-md);
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-buttons .btn {
    width: 100%;
  }
  
  .featured-grid,
  .trending-grid {
    grid-template-columns: 1fr;
  }
  
  .featured-actions,
  .trending-actions,
  .post-actions {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: var(--font-lg);
  }
  
  .hero-description {
    font-size: var(--font-base);
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .category-card {
    height: 150px;
  }
  
  .featured-meta,
  .trending-meta,
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
}