/* Categories Page Specific Styles */

/* Main categories grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Category card styling */
.category-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,102,0,0.1) 50%, transparent 100%);
  transition: left 0.3s ease;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  border-color: var(--orange);
}

.category-card:hover::before {
  left: 100%;
}

/* Category icon */
.category-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  text-align: center;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border-radius: 50%;
  width: 80px;
  margin: 0 auto 1.5rem auto;
  border: 2px solid var(--orange);
  box-shadow: 0 4px 12px rgba(255,102,0,0.15);
}

/* Category info */
.category-info {
  text-align: center;
}

.category-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.category-description {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1rem;
  min-height: 3rem;
}

.category-count {
  display: inline-block;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Category arrow */
.category-arrow {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--orange);
  font-weight: bold;
  transition: transform 0.3s ease;
}

.category-card:hover .category-arrow {
  transform: translateY(-50%) translateX(4px);
}

/* Loading and error states */
.loading-spinner {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 1.2rem;
  color: #6b7280;
}

.loading-spinner::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid var(--orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.no-categories, .error {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 1.1rem;
  color: #6b7280;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 400px;
}

/* Section head styling */
.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.section-head p {
  font-size: 1.1rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .section-head {
    display: none; /* Hide section-head on mobile */
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
    margin: 0 1rem; /* Add side margins for better spacing */
  }
  
  .category-card {
    padding: 1.5rem;
    min-height: 280px; /* Ensure consistent height */
  }
  
  .category-icon {
    font-size: 2.5rem;
    height: 60px;
    width: 60px;
    margin: 0 auto 1rem auto;
  }
  
  .category-name {
    font-size: 1.3rem;
    line-height: 1.3;
  }
  
  .category-description {
    font-size: 0.9rem;
    min-height: 2.5rem;
    line-height: 1.5;
  }
  
  .category-count {
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
  }
  
  .section-head {
    margin-bottom: 2.5rem;
    padding: 0 1rem;
  }
  
  .section-head h2 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .section-head p {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .no-categories, .error {
    margin: 2rem 1rem;
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0;
    margin: 0 0.75rem;
  }
  
  .category-card {
    padding: 1.25rem;
    min-height: 260px;
    border-radius: 12px;
    top:50px;
  }
  
  .category-icon {
    font-size: 2rem;
    height: 50px;
    width: 50px;
    margin: 0 auto 0.75rem auto;
    border-width: 1.5px;
  }
  
  .category-name {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }
  
  .category-description {
    font-size: 0.85rem;
    min-height: 2rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
  }
  
  .category-count {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
  }
  
  .category-arrow {
    font-size: 1.2rem;
    right: 1rem;
  }
  
  .section-head {
    margin-bottom: 2rem;
    padding: 0 0.75rem;
  }
  
  .section-head h2 {
    font-size: 1.8rem;
    line-height: 1.1;
    margin-bottom: 0.75rem;
  }
  
  .section-head p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .no-categories, .error {
    margin: 1.5rem 0.75rem;
    padding: 2.5rem 1rem;
    font-size: 1rem;
  }
  
  .loading-spinner {
    padding: 3rem 1rem;
    font-size: 1rem;
  }
}

/* Extra small mobile optimization */
@media (max-width: 360px) {
  .categories-grid {
    margin: 0 0.5rem;
  }
  
  .category-card {
    padding: 1rem;
    min-height: 240px;
  }
  
  .category-icon {
    height: 45px;
    width: 45px;
    font-size: 1.8rem;
  }
  
  .category-name {
    font-size: 1rem;
  }
  
  .category-description {
    font-size: 0.8rem;
    min-height: 1.8rem;
  }
  
  .section-head {
    padding: 0 0.5rem;
  }
  
  .section-head h2 {
    font-size: 1.6rem;
  }
  
  .section-head p {
    font-size: 0.85rem;
  }
}
