/* Game Slider */
.game-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 0 10px;
  box-sizing: border-box; /* Include padding within the width calculation */
}

/* Slider Container */
.slider-container {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.slider {
  display: flex;
  gap: 10px; /* Gap between the items */
  transition: transform 0.3s ease-out;
}

.slider-item {
  flex: 0 0 150px; /* Set the width to match .game-card width */
  height: 200px; /* Set the height to match .game-card height */
  background-color: #ffffff;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Game Name Container and Badge - Positioned over the image */
.game-name-container {
  padding: 10px;
  background: rgba(231, 230, 230, 0.507);
  text-align: center;
  border-radius: 15px;
  z-index: 2;
  width: 80%;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Game Name */
.game-name {
  margin: 0;
  font-size: 1rem;
  font-weight: bold;
  color: #070707;
  text-transform: capitalize;
}

/* Badge for "Popular" or "On Sale" */
.badge {
  position: relative;
  margin-top: 5px;
  background-color: #FF6347;
  color: white;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  border: 2px solid white;
  overflow: hidden;
  z-index: 0;
}

.badge::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: #32CD32;
  border-radius: 10px;
  opacity: 0;
  animation: blink 1.5s infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* Slider Item Image */
.slider-item img {
  width: 140px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

/* Mobile Navbar */
.mobile-navbar {
  display: none;
  background-color: #4CAF50;
  padding: 10px 0;
  width: 100%;
  z-index: 999;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.mobile-navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin: 0 auto;
  gap: 6px;
}

#login-btn {
  background-color: #FF5252;
  border-radius: 10px;
  padding: 10px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

#login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
}

#login-btn .mobile-item-icon svg {
  width: 20px;
  height: 20px;
}

#search-btn,
#notification-btn {
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
}

#search-btn {
  background: linear-gradient(135deg, #cecdcd, #ffffff);
  margin-right: -120px;
}

#notification-btn {
  background: linear-gradient(135deg, #4CAF50, #81C784);
}

#search-btn:hover,
#notification-btn:hover {
  transform: scale(1.1);
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
}

#search-btn .mobile-item-icon svg,
#notification-btn .mobile-item-icon svg {
  width: 22px;
  height: 22px;
}

#search-btn .mobile-item-icon svg { color: #4CAF50; }
#notification-btn .mobile-item-icon svg { color: white; }

.mobile-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-item-text {
  font-size: 14px;
  color: #ffffff;
}

.mobile-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Title Container for 'Our Categories' */
.categories-title-container {
  background-color: #ffffff;
  border-radius: 25px;
  padding: 10px 20px;
  position: absolute;
  top: -75px;
  left: 0px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

/* Game Grid Section */
.game-grid {
  padding: 20px;
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  text-align: center;
  max-width: 1200px;
  width: 90%;
  top: -120px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* Grid container styling */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  justify-items: center;
  margin-top: 50px;
}

/* Game Card */
.game-card {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  width: 150px;
  height: 175px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.game-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.game-card p {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #070707;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hidden categories */
.hidden-categories {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 25px;
  margin: 0 auto;
  max-width: 100%;
  justify-items: center;
}

/* View All Button */
.view-all {
  display: inline-block;
  margin-top: 20px;
  font-size: 1rem;
  color: #00f9ff;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid #00f9ff;
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.view-all:hover {
  background-color: #00f9ff;
  color: #1b0b26;
}

/* Category Buttons */
.category-buttons {
  display: none;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #e9f4e5;
}

.navigation-button-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 20px;
  background-color: #d0e8cc;
  margin-top: -10px;
}

.navigation-button {
  text-align: center;
}

.navigation-button-div {
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  margin-bottom: 10px;
  margin-left: 7px;
}

.navigation-button-div svg {
  width: 32px;
  height: 32px;
  padding: 4px;
  box-sizing: border-box;
}

.navigation-button-name {
  font-size: 14px;
  color: #333;
}

.add-icon {
  font-size: 24px;
  color: #70b452;
}

/* Media Queries */
@media (max-width: 768px) {
  .navbar { display: none; }
  .mobile-navbar { display: block; }
  .categories-title-container { display: none; font-size: 1rem; padding: 8px 15px; top: -20px; left: 10px; }
  .game-slider { display: block; margin-top: 20px; background-color: transparent; margin-bottom: 30px; }
  .view-all { display: none; }
  .game-grid {
    background-color: transparent;
    box-shadow: none;
    top: 0;
    margin: -35px 0 0 0;
    display: block;
  }
  .game-card a {
    text-decoration: none;
    color: inherit;
    display: block;
  }
  .category-buttons {
    display: flex;
    justify-content: flex-start;
    margin: 30px -60px 20px 0;
    overflow-x: auto;
    padding: 5px 0;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-buttons::-webkit-scrollbar { display: none; }
  .category-btn {
    background-color: #00ab07;
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    min-width: 120px;
    text-align: center;
    flex-shrink: 0;
  }
  .category-btn:hover { background-color: #45a049; transform: scale(1.05); }
  .category-btn.selected { background-color: #45a049; transform: scale(1.1); }
  .category-btn:active { background-color: #45a049; }
}

@media (min-width: 769px) {
  .game-slider { display: none; }
  .navigation-button-container { display: none; }
}

@media (max-width: 480px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .game-card {
    width: 80px;
    height: auto;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .game-card img {
    height: 70px;
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
  }
  .game-card p {
    margin-top: 5px;
    font-size: 0.65rem;
    line-height: 1.2;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.4em;
    white-space: normal;
  }
}
