/* ===================== */
/* Knowledge Base Styles */
/* ===================== */

/* Search & Categories Section */
.kb-search-categories {
  background: #f8fafc;
  padding: 60px 20px;
  text-align: center;
}

/* Improved Search Bar */
.search-bar {
  max-width: 600px;
  margin: 0 auto 40px;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 10px 20px;
  position: relative;
}

.search-bar input[type="text"] {
  flex: 1;
  border: none;
  font-size: 1.1em;
  padding: 12px 15px;
  background: transparent;
}

.search-bar input[type="text"]:focus {
  outline: none;
}

/* Floating Search Button */
.search-bar button {
  background: #4ca1af;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.search-bar button:hover {
  background: #2c3e50;
  transform: translateY(-50%) scale(1.1);
}

/* ======================= */
/* Category Listing Styles */
/* ======================= */
.categories-section {
  background: #fff;
  padding: 60px 20px;
}

.categories-section .section-header {
  font-size: 2.4em;
  font-weight: bold;
  margin-bottom: 30px;
  color: #212121;
  text-align: center;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

/* Enhanced Category Cards */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f8f9fc, #ffffff);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

/* Category Icon (Initial) */
.category-initial {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  font-weight: bold;
  color: white;
  margin-bottom: 10px;
}

/* Dynamic Background Colors */
.category-card[data-color="red"] .category-initial {
  background: #ff6b6b;
}

.category-card[data-color="blue"] .category-initial {
  background: #4ca1af;
}

.category-card[data-color="green"] .category-initial {
  background: #6bcf8f;
}

.category-card[data-color="yellow"] .category-initial {
  background: #f4b400;
}

.category-card[data-color="purple"] .category-initial {
  background: #8e44ad;
}

.category-card[data-color="gray"] .category-initial {
  background: #95a5a6;
}

/* Category Title */
.category-card h3 {
  font-size: 1.6em;
  font-weight: bold;
  color: #212121;
  margin-bottom: 5px;
}

/* Category Description */
.category-description {
  font-size: 1em;
  color: #666;
  margin-bottom: 10px;
  max-width: 80%;
}

/* Article Count */
.article-count {
  font-size: 1em;
  color: #4ca1af;
  font-weight: bold;
}

/* Responsive for Categories */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== */
/* Search Results Page */
/* ==================== */

.search-results {
  background: #fff;
  padding: 60px 20px;
}

.search-results .section-header {
  font-size: 2.2em;
  font-weight: bold;
  margin-bottom: 30px;
  color: #212121;
  text-align: center;
}

.search-results .articles-list {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

/* Improved Search Results Cards */
.search-results .article-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafc;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-results .article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.search-results .article-info {
  display: flex;
  flex-direction: column;
}

.search-results .article-title {
  font-size: 1.4em;
  font-weight: bold;
  color: #212121;
  margin-bottom: 5px;
}

.search-results .article-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.search-results .article-title a:hover {
  color: #4ca1af;
}

.search-results .article-category {
  font-size: 0.9em;
  color: #4ca1af;
}

.search-results .vote-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-results .vote-count {
  font-size: 0.9em;
  color: #4ca1af;
  font-weight: bold;
}

/* Pagination */
.pagination {
  text-align: center;
  margin-top: 40px;
}

.pagination .page-link {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 12px;
  background: #f5f5f5;
  color: #333;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
}

.pagination .page-link:hover {
  background: #4ca1af;
  color: #fff;
  transform: translateY(-2px);
}

.pagination .page-link.active {
  background: #4ca1af;
  color: #fff;
  font-weight: bold;
}

/* Responsive for Search Results */
@media (max-width: 768px) {
  .search-results .article-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .search-results .vote-container {
    margin-top: 10px;
  }
}

/* ====================== */
/* Category Articles Listing (Updated Layout) */
/* ====================== */

.recent-articles {
  background: #fff;
  padding: 50px 20px;
}

.recent-articles .section-header {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 30px;
  color: #212121;
  text-align: center;
}

/* Updated Article Card for Category Articles Listing */
.recent-articles .article-card {
  display: flex;
  align-items: center;
  background: #f9fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recent-articles .article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Left Side Icon with the First Letter and Effects */
.recent-articles .article-icon {
  font-size: 2.5em;
  font-weight: bold;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  margin-right: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.recent-articles .article-icon:hover {
  transform: scale(1.1);
}

/* Right Side Content */
.recent-articles .article-content {
  flex: 1;
}

.recent-articles .article-title {
  font-size: 1.5em;
  font-weight: bold;
  margin: 0;
  color: #212121;
}

.recent-articles .article-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.recent-articles .article-title a:hover {
  color: #4ca1af;
}

.recent-articles .article-excerpt {
  font-size: 1em;
  color: #555;
  margin: 10px 0;
  line-height: 1.6;
}

/* Article Footer Row: Vote Section on Left, Continue Button on Right */
.recent-articles .article-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* Read More Button */
.recent-articles .read-more {
  display: inline-block;
  padding: 8px 14px;
  background: #4ca1af;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1em;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s ease;
}
.recent-articles .read-more:hover {
  background: #2c3e50;
  transform: scale(1.05);
}

/* Reusing Vote Styles */
.recent-articles .vote-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recent-articles .vote-count {
  font-size: 1em;
  color: #4ca1af;
  font-weight: bold;
}
.recent-articles .vote-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}
.recent-articles .vote-btn:hover {
  background: #4ca1af;
  color: #fff;
  transform: translateY(-2px);
}

/* Responsive for Category Articles Listing */
@media (max-width: 768px) {
  .recent-articles .article-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .recent-articles .article-icon {
    margin-bottom: 15px;
  }
  .recent-articles .article-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .recent-articles .vote-container {
    margin-top: 5px;
  }
}
