/* ========================================
   HOMEPAGE CATEGORIES - ENHANCED STYLES
   Three modern layout options
   Uses consistent flat design system with cyan theme from modern-frontend.css
   ======================================== */

/* ========================================
   OPTION 1: FEATURED GRID WITH GRADIENTS
   ======================================== */

.categories-featured-section {
  padding: 4rem 0;
  background: var(--color-white);
}

.categories-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Large cards span 2 columns on desktop */
@media (min-width: 768px) {
  .categories-featured-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .category-featured-card-large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.category-featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 200px;
  padding: 2rem;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-featured-card-large {
  min-height: 420px;
}

.category-featured-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0.7) 100%);
  transition: background 0.3s ease;
}

.category-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.1);
  text-decoration: none;
}

.category-featured-card:hover .category-featured-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 70%, rgba(0,0,0,0.8) 100%);
}

.category-featured-content {
  position: relative;
  z-index: 2;
}

.category-featured-image-wrapper {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 0.5rem;
}

.category-featured-card-large .category-featured-image-wrapper {
  width: 120px;
  height: 120px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.category-featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.category-featured-icon {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 3rem;
  opacity: 0.3;
}

.category-featured-card-large .category-featured-icon {
  font-size: 5rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.category-featured-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white;
}

.category-featured-card-large .category-featured-name {
  font-size: 2rem;
}

.category-featured-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  color: rgba(255,255,255,0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.category-featured-count {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.category-featured-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.category-featured-card:hover .category-featured-arrow {
  background: rgba(255,255,255,0.3);
  transform: translateX(4px);
}


/* ========================================
   OPTION 2: SLIDER/CAROUSEL LAYOUT
   ======================================== */

.categories-slider-section {
  padding: 4rem 0;
  background: var(--color-gray-50);
  position: relative;
}

.categories-slider-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
  padding: 0 1rem;
}

.categories-slider-btn {
  pointer-events: all;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: var(--color-gray-700);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.categories-slider-btn:hover {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transform: scale(1.05);
}

.categories-slider-btn:active {
  transform: scale(0.95);
}

.categories-slider-wrapper {
  overflow: hidden;
  margin: 2rem 0;
}

.categories-slider-track {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-slider-track::-webkit-scrollbar {
  display: none;
}

.category-slider-card {
  flex: 0 0 auto;
  width: 200px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.category-slider-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.1);
  text-decoration: none;
}

.category-slider-visual {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.category-slider-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-slider-card:hover .category-slider-image {
  transform: scale(1.1);
}

.category-slider-icon {
  font-size: 4rem;
  color: var(--color-gray-400);
  transition: all 0.3s ease;
}

.category-slider-card:hover .category-slider-icon {
  color: var(--color-primary);
  transform: scale(1.1);
}

.category-slider-content {
  padding: 1.25rem;
  text-align: center;
}

.category-slider-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-slider-count {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  font-weight: 500;
}


/* ========================================
   OPTION 3: ICON GRID WITH STATS
   ======================================== */

.categories-icons-section {
  padding: 4rem 0;
  background: var(--color-white);
}

.categories-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-icon-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-icon-card:hover {
  border-color: #17a2b8;
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.category-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
  transition: all 0.2s ease;
}

.category-icon-card:hover .category-icon-wrapper {
  transform: scale(1.1) rotate(5deg);
}

.category-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.category-icon-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.category-icon-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-gray-50);
  border-radius: 6px;
  margin-top: auto;
}

.category-icon-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.category-icon-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
  font-weight: 600;
}

.category-icon-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--color-gray-500);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.category-icon-card:hover .category-icon-arrow {
  opacity: 1;
  transform: translateX(0);
  background: var(--color-primary);
  color: white;
}


/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
  .categories-featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .category-featured-card {
    min-height: 160px;
    padding: 1.5rem;
  }
  
  .category-featured-card-large {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 200px;
  }
  
  .category-featured-name {
    font-size: 1.125rem;
  }
  
  .category-featured-card-large .category-featured-name {
    font-size: 1.5rem;
  }
  
  .category-featured-description {
    display: none;
  }
  
  .categories-slider-controls {
    display: none;
  }
  
  .category-slider-card {
    width: 160px;
  }
  
  .category-slider-visual {
    height: 120px;
  }
  
  .categories-icons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .category-icon-card {
    padding: 1.5rem 1rem;
  }
  
  .category-icon-wrapper {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
  
  .category-icon-name {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .categories-featured-grid {
    grid-template-columns: 1fr;
  }
  
  .category-featured-card-large {
    grid-column: span 1;
  }
  
  .category-slider-card {
    width: 140px;
  }
  
  .categories-icons-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-featured-card,
.category-slider-card,
.category-icon-card {
  animation: slideInUp 0.5s ease both;
}

.category-featured-card:nth-child(1) { animation-delay: 0.05s; }
.category-featured-card:nth-child(2) { animation-delay: 0.1s; }
.category-featured-card:nth-child(3) { animation-delay: 0.15s; }
.category-featured-card:nth-child(4) { animation-delay: 0.2s; }
.category-featured-card:nth-child(5) { animation-delay: 0.25s; }
.category-featured-card:nth-child(6) { animation-delay: 0.3s; }
.category-featured-card:nth-child(7) { animation-delay: 0.35s; }
.category-featured-card:nth-child(8) { animation-delay: 0.4s; }

.category-icon-card:nth-child(1) { animation-delay: 0.05s; }
.category-icon-card:nth-child(2) { animation-delay: 0.1s; }
.category-icon-card:nth-child(3) { animation-delay: 0.15s; }
.category-icon-card:nth-child(4) { animation-delay: 0.2s; }
.category-icon-card:nth-child(5) { animation-delay: 0.25s; }
.category-icon-card:nth-child(6) { animation-delay: 0.3s; }
.category-icon-card:nth-child(7) { animation-delay: 0.35s; }
.category-icon-card:nth-child(8) { animation-delay: 0.4s; }


/* ========================================
   UTILITIES
   ======================================== */

.mt-6 { margin-top: 3rem; }
.mt-8 { margin-top: 4rem; }
.mb-8 { margin-bottom: 4rem; }
.ml-2 { margin-left: 0.5rem; }

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
}

.text-center {
  text-align: center;
}


/* ========================================
   OPTION 4: PASTEL CAROUSEL (INSPIRED)
   Horizontal scrolling with soft pastel backgrounds
   ======================================== */

.categories-pastel-section {
  padding: 4rem 0;
  background: var(--color-white);
  overflow: hidden;
}

.categories-pastel-wrapper {
  position: relative;
  margin: 2rem 0;
}

.categories-pastel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1rem 0;
}

.categories-pastel-track::-webkit-scrollbar {
  display: none;
}

.category-pastel-card {
  flex: 0 0 auto;
  width: 150px;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.category-pastel-card:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.category-pastel-visual {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.category-pastel-card:hover .category-pastel-visual {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Pastel background colors */
.category-pastel-visual.pastel-cream { background: #FFF9E6; }
.category-pastel-visual.pastel-green { background: #E8F5E9; }
.category-pastel-visual.pastel-pink { background: #FCE4EC; }
.category-pastel-visual.pastel-purple { background: #F3E5F5; }
.category-pastel-visual.pastel-blue { background: #E3F2FD; }
.category-pastel-visual.pastel-peach { background: #FFE0B2; }
.category-pastel-visual.pastel-mint { background: #E0F2F1; }
.category-pastel-visual.pastel-lavender { background: #EDE7F6; }

.category-pastel-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.3s ease;
}

.category-pastel-card:hover .category-pastel-image {
  transform: scale(1.1);
}

.category-pastel-icon {
  font-size: 3.5rem;
  color: rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.category-pastel-card:hover .category-pastel-icon {
  transform: scale(1.1);
  color: rgba(0,0,0,0.4);
}

.category-pastel-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6rem;
}

.category-pastel-count {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
  font-weight: 500;
}

/* Scroll indicators */
.categories-pastel-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
  padding: 0 0.5rem;
}

.categories-pastel-btn {
  pointer-events: all;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  color: var(--color-gray-700);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.categories-pastel-btn:hover {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transform: scale(1.05);
}

.categories-pastel-btn:active {
  transform: scale(0.95);
}

.categories-pastel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
  .category-pastel-card {
    width: 120px;
  }
  
  .category-pastel-visual {
    width: 120px;
    height: 120px;
  }
  
  .category-pastel-name {
    font-size: 0.875rem;
  }
  
  .categories-pastel-controls {
    display: none;
  }
}


/* ========================================
   OPTION 5: BOOTSTRAP GRID LAYOUT
   Simple 6-per-row grid (2 rows, max 12)
   ======================================== */

.categories-grid-section {
  padding: 3rem 0;
  background: #f8f9fa;
}

.category-grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.5s ease-out backwards;
}

/* Stagger animation for each card */
.category-grid-card:nth-child(1) { animation-delay: 0.05s; }
.category-grid-card:nth-child(2) { animation-delay: 0.1s; }
.category-grid-card:nth-child(3) { animation-delay: 0.15s; }
.category-grid-card:nth-child(4) { animation-delay: 0.2s; }
.category-grid-card:nth-child(5) { animation-delay: 0.25s; }
.category-grid-card:nth-child(6) { animation-delay: 0.3s; }
.category-grid-card:nth-child(7) { animation-delay: 0.35s; }
.category-grid-card:nth-child(8) { animation-delay: 0.4s; }
.category-grid-card:nth-child(9) { animation-delay: 0.45s; }
.category-grid-card:nth-child(10) { animation-delay: 0.5s; }
.category-grid-card:nth-child(11) { animation-delay: 0.55s; }
.category-grid-card:nth-child(12) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-grid-card:hover {
  transform: translateY(-8px);
  text-decoration: none;
}

.category-grid-visual {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 150px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-grid-card:hover .category-grid-visual {
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 0 3px rgba(255,255,255,0.8);
  transform: scale(1.08) translateY(-4px);
}

/* Vibrant gradient background colors */
.category-grid-visual.pastel-cream { 
  background: linear-gradient(135deg, #FFE5B4 0%, #FFEAA7 100%);
}
.category-grid-visual.pastel-green { 
  background: linear-gradient(135deg, #A8E6CF 0%, #74D99F 100%);
}
.category-grid-visual.pastel-pink { 
  background: linear-gradient(135deg, #FFB6D9 0%, #FF8ED4 100%);
}
.category-grid-visual.pastel-purple { 
  background: linear-gradient(135deg, #D4A5FF 0%, #B794F6 100%);
}
.category-grid-visual.pastel-blue { 
  background: linear-gradient(135deg, #89CFF0 0%, #5DADE2 100%);
}
.category-grid-visual.pastel-peach { 
  background: linear-gradient(135deg, #FFBE98 0%, #FF9A76 100%);
}
.category-grid-visual.pastel-mint { 
  background: linear-gradient(135deg, #98E4D8 0%, #6DD5C3 100%);
}
.category-grid-visual.pastel-lavender { 
  background: linear-gradient(135deg, #C5B9E6 0%, #A294D9 100%);
}

.category-grid-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-grid-card:hover .category-grid-image {
  transform: scale(1.1);
}

.category-grid-icon {
  font-size: 3.5rem;
  color: rgba(255,255,255,0.9);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: all 0.3s ease;
}

.category-grid-card:hover .category-grid-icon {
  color: rgba(255,255,255,1);
  transform: scale(1.15) rotate(-5deg);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.category-grid-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.category-grid-card:hover .category-grid-name {
  color: #2563eb;
  transform: translateY(-2px);
}

.category-grid-count {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 600;
  background: rgba(100, 116, 139, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  display: inline-block;
  transition: all 0.2s ease;
}

.category-grid-card:hover .category-grid-count {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  /* 4 per row on tablets */
  .category-grid-visual {
    max-width: 120px;
  }
  
  .category-grid-icon {
    font-size: 3rem;
  }
}

@media (max-width: 767px) {
  /* 3 per row on small tablets */
  .category-grid-visual {
    max-width: 100px;
  }
  
  .category-grid-icon {
    font-size: 2.5rem;
  }
  
  .category-grid-name {
    font-size: 0.875rem;
  }
  
  .category-grid-count {
    font-size: 0.75rem;
  }
}

@media (max-width: 575px) {
  /* 2 per row on mobile */
  .categories-grid-section {
    padding: 2rem 0;
  }
  
  .category-grid-visual {
    max-width: 110px;
  }
}
