/* ═══════════════════════════════════════════════════════════════════════════
   BROWSE BY CATEGORY - MODERN ANIMATED CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.home-category-wrapper {
  margin-top: calc(var(--space-6) * -0.5);
}

.home-hero-overlay .home-category-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
}

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

/* Card Base */
.home-category-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  border-radius: 12px;
  text-decoration: none;
  color: #1f2937;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Decorative gradient accent */
.home-category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.home-category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow:
    0 8px 20px rgba(59, 130, 246, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.04);
}

.home-category-card:hover::before {
  opacity: 1;
}

/* Icon Container */
.home-category-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Icon shadow/glow */
.home-category-icon::after {
  content: none;
}

.home-category-card:hover .home-category-icon {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

/* Icon animation on hover */
.home-category-icon i {
  display: inline-block;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-category-card:hover .home-category-icon i {
  transform: scale(1.05);
}

/* Text Content */
.home-category-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.home-category-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  transition: color 0.2s ease;
  letter-spacing: -0.01em;
}

.home-category-card:hover .home-category-title {
  color: #2563eb;
}

.home-category-subtitle {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.3;
}

/* Per-category gradient backgrounds and colors */
.home-category-card:nth-child(1) {
  background: #fff;
}
.home-category-card:nth-child(1) .home-category-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.home-category-card:nth-child(1)::before {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.home-category-card:nth-child(1):hover .home-category-title { color: #2563eb; }

.home-category-card:nth-child(2) {
  background: #fff;
}
.home-category-card:nth-child(2) .home-category-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.home-category-card:nth-child(2)::before {
  background: linear-gradient(135deg, #10b981, #059669);
}
.home-category-card:nth-child(2):hover .home-category-title { color: #059669; }

.home-category-card:nth-child(3) {
  background: #fff;
}
.home-category-card:nth-child(3) .home-category-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.home-category-card:nth-child(3)::before {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
.home-category-card:nth-child(3):hover .home-category-title { color: #16a34a; }

.home-category-card:nth-child(4) {
  background: #fff;
}
.home-category-card:nth-child(4) .home-category-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}
.home-category-card:nth-child(4)::before {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
.home-category-card:nth-child(4):hover .home-category-title { color: #7c3aed; }

.home-category-card:nth-child(5) {
  background: #fff;
}
.home-category-card:nth-child(5) .home-category-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}
.home-category-card:nth-child(5)::before {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}
.home-category-card:nth-child(5):hover .home-category-title { color: #0891b2; }

.home-category-card:nth-child(6) {
  background: #fff;
}
.home-category-card:nth-child(6) .home-category-icon {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}
.home-category-card:nth-child(6)::before {
  background: linear-gradient(135deg, #f97316, #ea580c);
}
.home-category-card:nth-child(6):hover .home-category-title { color: #ea580c; }

.home-category-card:nth-child(7) {
  background: #fff;
}
.home-category-card:nth-child(7) .home-category-icon {
  background: linear-gradient(135deg, #ec4899, #db2777);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}
.home-category-card:nth-child(7)::before {
  background: linear-gradient(135deg, #ec4899, #db2777);
}
.home-category-card:nth-child(7):hover .home-category-title { color: #db2777; }

.home-category-card:nth-child(8) {
  background: #fff;
}
.home-category-card:nth-child(8) .home-category-icon {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.home-category-card:nth-child(8)::before {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}
.home-category-card:nth-child(8):hover .home-category-title { color: #4f46e5; }

/* Responsive */
@media (max-width: 1024px) {
  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-category-grid {
    grid-template-columns: 1fr;
  }
  
  .home-category-card {
    padding: 1.5rem 1.25rem;
  }
  
  .home-category-icon {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════════════════ */

.dark .home-category-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
}

.dark .home-category-card {
  background: transparent;
  border: 1px solid rgba(71, 85, 105, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  color: #f1f5f9;
}

.dark .home-category-card:hover {
  background: transparent;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(59, 130, 246, 0.15);
}

.dark .home-category-title {
  color: #f1f5f9;
}

.dark .home-category-card:hover .home-category-title {
  color: #93c5fd;
}

.dark .home-category-subtitle {
  color: #94a3b8;
}

.dark .home-category-icon {
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.5),
    inset 0 -2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Dark mode category-specific backgrounds */
.dark .home-category-card:nth-child(1) {
  background: transparent;
}
.dark .home-category-card:nth-child(1):hover .home-category-title { color: #93c5fd; }

.dark .home-category-card:nth-child(2) {
  background: transparent;
}
.dark .home-category-card:nth-child(2):hover .home-category-title { color: #6ee7b7; }

.dark .home-category-card:nth-child(3) {
  background: transparent;
}
.dark .home-category-card:nth-child(3):hover .home-category-title { color: #86efac; }

.dark .home-category-card:nth-child(4) {
  background: transparent;
}
.dark .home-category-card:nth-child(4):hover .home-category-title { color: #c4b5fd; }

.dark .home-category-card:nth-child(5) {
  background: transparent;
}
.dark .home-category-card:nth-child(5):hover .home-category-title { color: #67e8f9; }

.dark .home-category-card:nth-child(6) {
  background: transparent;
}
.dark .home-category-card:nth-child(6):hover .home-category-title { color: #fdba74; }

.dark .home-category-card:nth-child(7) {
  background: transparent;
}
.dark .home-category-card:nth-child(7):hover .home-category-title { color: #f9a8d4; }

.dark .home-category-card:nth-child(8) {
  background: transparent;
}
.dark .home-category-card:nth-child(8):hover .home-category-title { color: #c7d2fe; }
