/* ===============================================
   📂 ESTILOS PARA CATEGORÍAS DEL BLOG
   =============================================== */

/* Category Header */
.category-header {
  background: linear-gradient(135deg, 
    var(--primary-color) 0%, 
    var(--secondary-color) 100%);
  color: white;
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.category-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../../assets/img/patterns/circuit-board.png') center/cover;
  opacity: 0.1;
  z-index: 1;
}

.category-header .container {
  position: relative;
  z-index: 2;
}

.category-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-icon i {
  font-size: 2rem;
  color: white;
}

.category-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.category-description {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.category-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.category-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  transition: all 0.3s ease;
}

.category-stats .stat-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.category-stats .stat-item i {
  font-size: 1.1rem;
}

/* Category Content Layout */
.category-content {
  padding: 4rem 0;
  background: var(--bg-color);
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.category-main {
  min-height: 600px;
}

/* Featured Section for Categories */
.featured-section {
  margin-bottom: 3rem;
}

.featured-section .section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 2rem;
  position: relative;
}

.featured-section .section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  margin-left: 1rem;
}

.featured-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* Posts Section for Categories */
.posts-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.section-header .section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-controls label {
  font-weight: 500;
  color: var(--text-color-light);
  font-size: 0.9rem;
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  color: var(--text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Posts Grid for Categories */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Load More Section */
.load-more-section {
  text-align: center;
  padding: 2rem 0;
}

.load-more-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.load-more-btn:hover::before {
  left: 100%;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.load-more-btn.hidden {
  display: none;
}

/* Category Sidebar */
.category-sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-widget {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.widget-title i {
  color: var(--primary-color);
}

/* Categories Navigation */
.categories-nav {
  margin: 0;
}

.categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item {
  margin-bottom: 0.5rem;
}

.category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.category-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

.category-item.active .category-link {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.category-link i {
  margin-right: 0.75rem;
  width: 1.2rem;
  text-align: center;
}

.post-count {
  font-size: 0.9rem;
  opacity: 0.7;
  font-weight: 400;
}

/* Tags Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-link {
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.tag-link:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

/* Empty Category State */
.empty-category {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-color-light);
}

.empty-category i {
  font-size: 4rem;
  color: var(--border-color);
  margin-bottom: 1rem;
}

.empty-category h3 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.empty-category p {
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .category-title {
    font-size: 2rem;
  }

  .category-description {
    font-size: 1rem;
  }

  .category-stats {
    gap: 1rem;
  }

  .content-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .category-sidebar {
    order: -1;
    position: static;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .featured-posts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .category-header {
    padding: 2rem 0;
  }

  .category-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }

  .category-icon i {
    font-size: 1.5rem;
  }

  .category-title {
    font-size: 1.5rem;
  }

  .category-stats {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .posts-section {
    padding: 1.5rem;
  }

  .sidebar-widget {
    padding: 1.5rem;
  }
}

/* Dark Mode Support for Categories */
[data-theme="dark"] .category-header {
  background: linear-gradient(135deg, 
    #1a1a1a 0%, 
    #2d2d2d 100%);
}

[data-theme="dark"] .posts-section,
[data-theme="dark"] .sidebar-widget {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .sort-select {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .category-link {
  color: var(--text-color);
}

[data-theme="dark"] .category-link:hover {
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .tag-link {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .tag-link:hover {
  background: var(--primary-color);
  color: white;
}
