/* resources/css/forum-cards.css */

/* === Секция форума === */
.forum-section {
  padding: 4rem 1rem;
  background: #ffffff;
}

.forum-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.forum-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.75rem;
}

.forum-subtitle {
  font-size: 1.1rem;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

/* === Сетка карточек === */
.forum-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

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

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

/* === Карточка темы форума === */
.forum-topic-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.forum-topic-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: #4a7c59;
}

/* Заголовок темы */
.forum-topic-header {
  padding: 1.25rem;
  background: linear-gradient(135deg, #f8f5f0 0%, #ffffff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.forum-topic-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.forum-topic-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.forum-topic-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.forum-topic-stat svg {
  width: 16px;
  height: 16px;
  color: #94a3b8;
}

/* Список последних сообщений */
.forum-messages-list {
  padding: 1rem;
  flex-grow: 1;
  background: #fafafa;
}

.forum-message-item {
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border-left: 3px solid #4a7c59;
  transition: all 0.2s ease;
}

.forum-message-item:hover {
  background: #f1f5f9;
  border-left-color: #c9a961;
}

.forum-message-item:last-child {
  margin-bottom: 0;
}

.forum-message-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #2d3748;
}

.forum-message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a7c59 0%, #3a6347 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.forum-message-text {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.forum-message-date {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Ссылка на тему */
.forum-view-topic {
  display: block;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, #4a7c59 0%, #3a6347 100%);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.forum-view-topic:hover {
  background: linear-gradient(135deg, #3a6347 0%, #2d4d38 100%);
}

/* Кнопка "Все темы" */
.forum-view-all {
  display: block;
  text-align: center;
  margin: 2rem auto 0;
  color: #4a7c59;
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 2rem;
  border: 2px solid #4a7c59;
  border-radius: 50px;
  transition: all 0.3s ease;
  width: fit-content;
}

.forum-view-all:hover {
  background: #4a7c59;
  color: #ffffff;
}

/* Пустое состояние */
.forum-empty {
  text-align: center;
  padding: 3rem;
  background: #f8f5f0;
  border-radius: 16px;
  grid-column: 1 / -1;
}

.forum-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.forum-empty-text {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* Анимация появления */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.forum-topic-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.forum-topic-card:nth-child(1) { animation-delay: 0.1s; }
.forum-topic-card:nth-child(2) { animation-delay: 0.2s; }
.forum-topic-card:nth-child(3) { animation-delay: 0.3s; }
.forum-topic-card:nth-child(4) { animation-delay: 0.4s; }
.forum-topic-card:nth-child(5) { animation-delay: 0.5s; }
.forum-topic-card:nth-child(6) { animation-delay: 0.6s; }
