/**
 * Category Navigation Styles
 * 
 * Styles for category grid/list view with resource counts.
 * Mobile-first responsive design.
 */

.category-navigation {
  margin-bottom: 2rem;
}

.category-navigation__header {
  margin-bottom: 1.5rem;
}

.category-navigation__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.category-navigation__subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* View Toggle */
.category-navigation__view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.view-toggle-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.view-toggle-btn--active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Grid View */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.category-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.category-card:active {
  transform: translateY(0);
}

.category-card--selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.category-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.category-card__name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.category-card__description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  flex: 1;
}

.category-card__count {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #3b82f6;
  font-weight: 600;
  margin-top: auto;
}

.category-card__count-number {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
}

/* List View */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-list-item {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.category-list-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.category-list-item--selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.category-list-item__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.category-list-item__content {
  flex: 1;
  min-width: 0;
}

.category-list-item__name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.category-list-item__description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-list-item__count {
  flex-shrink: 0;
  background: #dbeafe;
  color: #1e40af;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.875rem;
}

/* All Categories Option */
.category-card--all,
.category-list-item--all {
  border-color: #d1d5db;
  background: #f9fafb;
}

.category-card--all:hover,
.category-list-item--all:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
}

.category-card--all.category-card--selected,
.category-list-item--all.category-list-item--selected {
  border-color: #6b7280;
  background: #e5e7eb;
}

/* Loading State */
.category-navigation--loading {
  opacity: 0.6;
  pointer-events: none;
}

.category-navigation__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: #6b7280;
}

.category-navigation__loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Empty State */
.category-navigation__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.category-navigation__empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.category-navigation__empty-text {
  font-size: 1rem;
  margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .category-card {
    min-height: auto;
    padding: 1.25rem;
  }

  .category-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .category-list-item__description {
    white-space: normal;
  }

  .category-list-item__count {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  .category-navigation__title {
    font-size: 1.25rem;
  }

  .category-card__icon,
  .category-list-item__icon {
    font-size: 2rem;
  }

  .category-card__name,
  .category-list-item__name {
    font-size: 1rem;
  }
}

/* Accessibility */
.category-card:focus,
.category-list-item:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Print Styles */
@media print {
  .category-navigation__view-toggle {
    display: none;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
