.categories-section {
  padding: 0.5rem 0;
}

/* RTL Styles */
html[lang="ar"] .section-header,
html[lang="ar"] .category-content {
  direction: rtl;
  text-align: center;
}

/* LTR Styles */
html[lang="en_US"] .section-header,
html[lang="en_US"] .category-content {
  direction: ltr;
  text-align: center;
}

.section-header {
  padding: 2rem 1rem;
}

.section-title {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #a0aec0;
  font-weight: normal;
}

.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.category-card {
  flex: 0 0 calc(33.333% - 1.334rem); /* Account for the gap */
  background: #2a374a;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.category-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-card:hover .category-image img {
  transform: scale(1.05);
}

.category-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podcast-count {
  color: #a0aec0;
  font-size: 0.9rem;
  margin: 0;
}

.category-button {
  background: #007bff;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  width: fit-content;
}

.category-button:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

/* Tablet Responsive */
@media (max-width: 992px) {
  .categories-grid {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .category-card {
    flex: 0 0 calc(50% - 0.75rem); /* Two cards per row */
  }

  .category-image {
    height: 180px;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .category-title {
    font-size: 1.3rem;
    min-height: 50px;
  }
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .categories-grid {
    gap: 1rem;
    padding: 0.8rem;
  }

  .category-card {
    flex: 0 0 100%;
  }

  .category-image {
    height: 120px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .category-content {
    padding: 0.8rem;
    gap: 0.5rem;
  }

  .category-title {
    font-size: 1.1rem;
    min-height: 30px;
  }

  .podcast-count {
    font-size: 0.8rem;
    margin: 0;
  }

  .category-button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

.category-search {
  margin: 20px auto;
  max-width: 400px;
}

.category-search input {
  width: 100%;
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 16px;
}
