/* Additional header customizations with white background */
.site-header {
  background-color: #ffffff;
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1000; /* Ensure dropdown appears above other content */
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 15px; /* Spacing between elements */
}

/* Site branding - logo only */
.site-branding {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.site-logo {
  width: 40px;
  height: 40px;
  margin-right: 0;
}

/* Home button styling - circular pink button */
.home-button {
  width: 48px;
  height: 48px;
  background-color: #ff4d7d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background-color 0.3s ease;
  margin-right: 10px;
  flex-shrink: 0;
}

.home-button:hover {
  background-color: #ff3366;
}

/* Categories button - teal with grid icon */
.categories-button {
  background-color: #30c9c9;
  border-radius: 30px;
  padding: 0 20px;
  height: 48px;
  color: white;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
  border: none;
  cursor: pointer;
  margin-right: 10px;
  flex-shrink: 0;
  position: relative;
}

.categories-button:hover {
  background-color: #28b5b5;
}

.categories-button svg {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.categories-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* New Games button - purple with grid icon */
.new-games-button {
  background-color: #7b68ee;
  border-radius: 30px;
  padding: 0 20px;
  height: 48px;
  color: white;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  font-size: 16px;
  text-decoration: none;
  margin-right: 10px;
  flex-shrink: 0;
}

.new-games-button:hover {
  background-color: #6a5acd;
}

.new-games-button svg {
  margin-left: 8px;
}

/* Categories dropdown */
.categories-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 280px;
  padding: 16px 0;
  margin-top: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
}

.categories-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 500px; /* Large enough to fit content */
}

/* Category list styling */
.categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
  width: 100%;
}

.categories-list::-webkit-scrollbar {
  width: 6px;
}

.categories-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.categories-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.categories-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.categories-list li {
  padding: 0;
  margin: 0;
  width: 100%;
  display: block;
}

.categories-list a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  width: 100%;
}

.categories-list a:hover {
  background-color: #f5f5f5;
  color: #30c9c9;
  padding-left: 24px;
}

.categories-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background-color: #30c9c9;
  transition: width 0.2s ease;
}

.categories-list a:hover::before {
  width: 4px;
}

.categories-list a .category-icon {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #30c9c9;
}

.categories-list a .category-count {
  margin-left: auto;
  background-color: #f0f0ff;
  color: #7b68ee;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

/* Search within categories */
.categories-search {
  padding: 0 16px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.categories-search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background-color: #f9f9f9;
  font-size: 14px;
  transition: all 0.2s ease;
}

.categories-search-input:focus {
  outline: none;
  border-color: #30c9c9;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(48, 201, 201, 0.1);
}

/* Featured categories section */
.featured-categories {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.featured-categories-title {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}

.featured-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.featured-category {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #333;
}

.featured-category:hover {
  background-color: #e8f8f8;
  color: #30c9c9;
  transform: translateY(-2px);
}

.featured-category-icon {
  display: block;
  margin: 0 auto 5px;
  width: 24px;
  height: 24px;
  color: #30c9c9;
}

.featured-category-name {
  font-size: 12px;
  font-weight: 500;
}

/* Search form styling - light purple/lavender */
.search-form {
  position: relative;
  flex-grow: 1;
  max-width: 500px;
  margin-left: auto;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: 30px;
  border: none;
  background-color: #f0f0ff;
  font-size: 16px;
  color: #333;
}

.search-input::placeholder {
  color: #666;
}

.search-submit {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
}

/* Mobile Header Styles */
.mobile-header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.mobile-site-branding {
  display: flex;
  align-items: center;
  height: 40px; /* Consistent height */
}

.mobile-logo-link {
  display: flex;
  align-items: center;
  height: 100%;
}

.mobile-action-buttons {
  display: flex;
  gap: 10px;
  height: 40px; /* Consistent height */
}

.mobile-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: white;
  cursor: pointer;
}

.mobile-action-btn.home-btn {
  background-color: #ff4d7d;
}

.mobile-action-btn.categories-btn {
  background-color: #30c9c9;
}

.mobile-search-form {
  position: relative;
  flex-grow: 1;
  max-width: 100%;
  height: 40px; /* Consistent height */
  display: flex;
  align-items: center;
}

.mobile-search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 15px;
  border-radius: 20px;
  border: none;
  background-color: #f0f0ff;
  font-size: 14px;
}

.mobile-search-submit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  width: 24px;
}

/* Responsive styles */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .site-branding {
    flex-basis: auto;
    margin-right: auto;
  }

  .home-button,
  .categories-dropdown,
  .new-games-button {
    height: 38px; /* Slightly smaller on mobile */
  }

  .categories-button,
  .new-games-button {
    height: 38px;
    padding: 0 15px;
    font-size: 13px;
  }

  .search-form {
    order: 3;
    flex-basis: 100%;
    margin-top: 10px;
  }

  .search-input {
    height: 38px;
  }

  .dropdown-menu {
    position: fixed;
    top: 60px;
    left: 10px;
    right: 10px;
    width: calc(100% - 20px);
    max-width: none;
  }
}

@media (max-width: 576px) {
  .mobile-header-inner {
    padding: 5px 0;
  }

  .mobile-site-branding,
  .mobile-action-buttons,
  .mobile-action-btn,
  .mobile-search-form,
  .mobile-search-input {
    height: 36px; /* Even smaller on very small screens */
  }

  .mobile-search-form {
    margin-top: 5px;
  }

  .featured-categories-grid {
    grid-template-columns: 1fr;
  }
}

/* Animation for dropdown */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu {
  animation-duration: 0.3s;
  animation-fill-mode: both;
}

.categories-dropdown.active .dropdown-menu {
  animation-name: fadeInDown;
}

/* Backdrop for mobile */
.categories-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.categories-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Active category indicator */
.categories-list a.active {
  background-color: #e8f8f8;
  color: #30c9c9;
  font-weight: 600;
}

.categories-list a.active::before {
  width: 4px;
}
