:root {
  --primary-color: #00a9c4;
  --secondary-color: #1e293b;
  --background-color: #ffffff;
  --surface-color: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --hover-color: #f1f5f9;
}

/* body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--surface-color);
  color: var(--text-primary);
  line-height: 1.6;
} */

/* .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  gap: 30px;
  margin-top: 40px;
} */

/* Blog Section */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 60px;
}

.news-card {
    background: var(--background-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-img-container {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .card-img-container img {
  transform: scale(1.05);
}

.category-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(135deg, #f9c74f, #f8961e);
  color: #fff;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}

.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-tag {
  display: inline-block;
  /* padding: 4px 12px; */
  /* border: 1.5px solid var(--primary-color); */
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-color);
  background-color: transparent;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.card-title a {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-text {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
}

.card-stats {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-left {
  display: flex;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.stat-item:hover {
  color: var(--accent-color);
}

.stat-item i {
  font-size: 14px;
}

.like-btn.liked i {
  color: #ef4444;
}

.share-btn {
  display: none;
}

.card-stats .stats-row .post-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Pagination */
.pagination-section {
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  list-style: none;
  gap: 5px;
}

.pagination .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  /* Thêm các thuộc tính của button để trông giống link */
  background-color: transparent;
  cursor: pointer;
  font-size: 1rem; /* Chỉnh lại font-size nếu cần */
}

.pagination .page-link:hover,
.pagination li.active .page-link {
  /* Sửa selector cho trạng thái active */
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* Sidebar Widgets */
.sidebar {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.widget-item {
  background: var(--background-color);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.widget-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent-color);
}

/* Search Widget */
.search-form {
  position: relative;
}

.search-form input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.search-form input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.search-form button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-form button:hover {
  background: var(--accent-color);
}

/* Categories Widget */
.categories-widget ul {
  list-style: none;
}

.categories-widget ul li {
  margin-bottom: 8px;
}

.categories-widget ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  display: block;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.categories-widget ul li a:hover {
  background: var(--hover-color);
  color: var(--accent-color);
}

.categories-widget ul li.active a {
  color: var(--accent-color);
  font-weight: bold;
}

.alert {
  border-radius: 5px;
  margin-bottom: 20px;
}

.btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

/* Recent Posts Widget */
.recent-post-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.recent-post-item:last-child {
  border-bottom: none;
}

.recent-post-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.recent-post-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-post-content h4 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.recent-post-content h4 a:hover {
  color: var(--accent-color);
}

.recent-post-content time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Tags Widget */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  background: var(--surface-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.tag-item:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .row {
    flex-direction: column;
    gap: 20px;
  }

  .col-lg-3 {
    width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .stats-left {
    gap: 10px;
  }

  .stat-item {
    font-size: 11px;
  }
}

.page-link {
  color: var(--accent-color);
}

.active > .page-link,
.page-link.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* CSS cho thanh chủ đề ngang */

/* .topics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
} */

/* .topics-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  padding-left: 12px;
  border-left: 4px solid #00a9c4;
} */

.topics-bar {
  background: #ffffff;
  /* border: 1px solid #e2e8f0; */
  /* border-top: 1px solid #00a9c4; */
  border-bottom: 1px solid #00a9c4;
  /* border-radius: 12px; */
  padding: 2px;
  margin-bottom: 30px;
  /* box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06); */
}

.topics-main {
  display: flex;
  align-items: center;
  gap: 15px;
}

.topics-container {
  position: relative;
  overflow: hidden;
  flex: 1;
}

.topics-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 5px 0;
}

.topics-scroll::-webkit-scrollbar {
  display: none;
}

.topic-item {
  flex-shrink: 0;
  padding: 10px 20px;
  border: 1px solid #e2e8f0;
  /* border-radius: 15px; */
  background: #ffffff;
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}

.topic-item:hover {
  border-color: #00a9c4;
  color: #00a9c4;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.topic-item.active {
  border-color: #00a9c4;
  background: #00a9c4;
  color: #ffffff;
}

.topic-item.active:hover {
  background: #0891b2;
  border-color: #0891b2;
}

.scroll-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.scroll-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #64748b;
}

.scroll-btn:hover {
  background: #f1f5f9;
  border-color: #00a9c4;
  color: #00a9c4;
}

.scroll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8fafc;
}

.scroll-btn:disabled:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

/* Fade effect cho cuối thanh cuộn */
.topics-container::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to right, transparent, #ffffff);
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .topics-main {
    gap: 10px;
  }

  .scroll-controls {
    gap: 6px;
  }

  .scroll-btn {
    width: 28px;
    height: 28px;
  }

  .topic-item {
    padding: 8px 16px;
    font-size: 13px;
  }
}
