/* Category Index Pages Styling */

/* Algorithm grid for category index pages */
.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.algorithm-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.algorithm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.algorithm-card.primary {
  border-left: 4px solid #007bff;
}

.algorithm-card.primary::before {
  content: "RECOMMENDED";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #007bff;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Category page specific styles that don't affect navigation */
.category-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #212529;
}

.category-content h2 {
  font-size: 2rem;
  margin: 2rem 0 1rem 0;
  color: #212529;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.category-content h3 {
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem 0;
  color: #212529;
}

.category-content h4 {
  font-size: 1.25rem;
  margin: 1.25rem 0 0.75rem 0;
  color: #212529;
}

.category-content h4 a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.category-content h4 a:hover {
  text-decoration: underline;
}

.category-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 1.5rem 0;
}

.category-content ul li {
  margin-bottom: 0.25rem;
  padding-left: 1.5rem;
  position: relative;
}

.category-content ul li:before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: #6c757d;
}

.category-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-content th,
.category-content td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.category-content th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.category-content tr:hover {
  background: #f8f9fa;
}

/* Comparison table styling */
.comparison-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.comparison-table table {
  min-width: 600px;
}

/* Badge styles */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-right: 0.5rem;
}

.badge.primary {
  background: rgba(0, 123, 255, 0.1);
  color: #0056b3;
}

.badge.success {
  background: rgba(40, 167, 69, 0.1);
  color: #155724;
}

.badge.info {
  background: rgba(23, 162, 184, 0.1);
  color: #0c5460;
}

.badge.warning {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
}

.badge.secondary {
  background: rgba(108, 117, 125, 0.1);
  color: #495057;
}

/* Responsive Design for Category Pages */
@media (max-width: 768px) {
  .algorithm-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
  }
  
  .algorithm-card {
    padding: 1.5rem 1rem;
    margin: 0 0.5rem;
  }
  
  .algorithm-card.primary::before {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }
  
  .category-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .category-content h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
  }
  
  .category-content h3 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.75rem 0;
  }
  
  .category-content h4 {
    font-size: 1.125rem;
    margin: 1rem 0 0.5rem 0;
  }
  
  .category-content ul li {
    padding-left: 1.25rem;
    margin-bottom: 0.375rem;
  }
  
  .category-content ul li:before {
    left: 0.375rem;
  }
  
  .category-content table {
    font-size: 0.9rem;
  }
  
  .category-content th,
  .category-content td {
    padding: 0.5rem 0.375rem;
  }
  
  .comparison-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .comparison-table table {
    min-width: 500px;
  }
  
  .badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    display: inline-block;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .algorithm-card {
    padding: 1.25rem 0.875rem;
    margin: 0 0.25rem;
  }
  
  .algorithm-card.primary::before {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 0.75rem;
    display: block;
    width: fit-content;
  }
  
  .category-content h1 {
    font-size: 1.75rem;
  }
  
  .category-content h2 {
    font-size: 1.375rem;
  }
  
  .category-content h3 {
    font-size: 1.125rem;
  }
  
  .category-content h4 {
    font-size: 1rem;
  }
  
  .category-content table {
    font-size: 0.85rem;
  }
  
  .category-content th,
  .category-content td {
    padding: 0.375rem 0.25rem;
  }
  
  .comparison-table table {
    min-width: 400px;
  }
  
  .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .algorithm-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }
  
  .algorithm-card {
    padding: 1.75rem;
  }
}