/* ===== Home Page Specific Styles ===== */

.hub-header {
  text-align: center;
  margin-bottom: 25px;
  padding: 15px 0;
}

.hub-header h1 {
  margin: 0 0 10px 0;
  font-size: 42px;
  background: linear-gradient(135deg, #2f61f3 0%, #45B7D1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.hub-header .tagline {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0;
  font-weight: 500;
}

/* Search Container */
.search-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.search-bar {
  width: 100%;
  max-width: 500px;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  font-family: inherit;
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 97, 243, 0.15);
}

.search-bar::placeholder {
  color: var(--ink-soft);
}

/* Categories Grid - 6 columns for precise centering */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 25px auto 40px;
  max-width: 810px;
  padding: 0 20px;
}

/* Top 3 cards - each spans 2 columns */
.categories-grid .category-card:nth-child(1),
.categories-grid .category-card:nth-child(2),
.categories-grid .category-card:nth-child(3) {
  grid-column: span 2;
}

/* Bottom 2 cards - centered with empty space on both sides */
.categories-grid .category-card:nth-child(4) {
  grid-column: 2 / span 2;
}

.categories-grid .category-card:nth-child(5) {
  grid-column: 4 / span 2;
}

.category-card {
  display: block;
  position: relative;
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  transition: all 0.3s ease;
  aspect-ratio: 3 / 4;
  width: 100%;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-color);
  transition: height 0.3s ease;
  z-index: 3;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.category-card:hover::before {
  height: 6px;
}

/* Image Cards */
.category-card.image-card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card.image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.category-card.image-card .fallback-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: 45px;
  display: none;
}

.card-arrow {
  font-size: 16px;
  color: #fff;
  opacity: 0;
  transition: all 0.3s ease;
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--accent-color);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.category-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Hub Footer */
.hub-footer {
  text-align: center;
  padding: 30px 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* Responsive - Tablet */
@media (max-width: 1100px) {
  .categories-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
  }
}

/* Responsive - Small tablet / large phone */
@media (max-width: 900px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    gap: 14px;
  }
  
  .categories-grid .category-card:nth-child(1),
  .categories-grid .category-card:nth-child(2),
  .categories-grid .category-card:nth-child(3),
  .categories-grid .category-card:nth-child(4),
  .categories-grid .category-card:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .hub-header h1 {
    font-size: 36px;
  }

  .hub-header .tagline {
    font-size: 15px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  
  .categories-grid .category-card:nth-child(1),
  .categories-grid .category-card:nth-child(2),
  .categories-grid .category-card:nth-child(3),
  .categories-grid .category-card:nth-child(4),
  .categories-grid .category-card:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
  }

  .hub-header h1 {
    font-size: 28px;
  }
  
  .categories-grid .category-card:nth-child(1),
  .categories-grid .category-card:nth-child(2),
  .categories-grid .category-card:nth-child(3),
  .categories-grid .category-card:nth-child(4),
  .categories-grid .category-card:nth-child(5) {
    grid-column: auto;
  }
}
