/* CSS Variables for theming */
:root {
  --background-color: #11171e;
  --navbar-bg: #161a2b;
  --text-color: #ffffff;
  --btn-hover: #2a2f45;
  --border-color: #ffffff33;
  --translucent-bg: #ffffff1a;
  --search-border-color: rgba(255, 255, 255, 0.2);
  --active-bg: #ffffff40;
  --subscribe-gradient: linear-gradient(
    180deg,
    rgba(255, 204, 8, 0.8) 99.98%,
    rgba(255, 255, 255, 0.8) 99.99%
  );
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-button-bg: rgba(255, 255, 255, 0.8);
}

:root[data-theme="light"] {
  /* Light theme */
  --background-color: #d9d9d9;
  --navbar-bg: #f8f9fa;
  --text-color: #333333;
  --btn-hover: #f5f5f5;
  --border-color: #33333333;
  --translucent-bg: #3333331a;
  --search-border-color: rgba(0, 0, 0, 0.2);
  --active-bg: #33333340;
  --sidebar-border: rgba(0, 0, 0, 0.6);
  --sidebar-button-bg: rgba(0, 0, 0, 0.6);
}

/* Add body styles for theming */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}
* {
  font-family: "Inter", Helvetica, Arial, sans-serif !important;
}

.container {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 5fr;
  min-height: 100vh;
}

/* Sidebar styles */
.sidebar {
  background-color: var(--navbar-bg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid var(--sidebar-border);
}

.search-container {
  position: relative;
  margin-bottom: 1rem;
}

.search-container input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-color: var(--navbar-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-color: var(--search-border-color);
  border-radius: 12px;
  color: var(--text-color);
}

.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 35%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

.nav-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-item {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  background-color: var(--translucent-bg);
  border-radius: 4px;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s;
  background-repeat: no-repeat;
  background-position: 0rem center;
  background-size: cover;
  text-decoration: none;
}

/* Individual background images */
.trending-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/streamline-trending-content-solid.svg");
}

.new-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/material-symbols-star.svg");
}

.popular-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/mingcute-love-fill.svg");
}

.premium-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/fluent-premium-12-filled.svg");
}

.filter-item span {
  font-size: 0.9rem;
}

.filter-item.active {
  background-color: #ffcc08;
}

.filter-item.premium {
  background-color: rgba(188, 209, 0, 0.8);
}

.filter-item:hover {
  background-color: var(--btn-hover);
}

.filter-item.active:hover {
  background-color: #a8bb00;
}

.divider {
  height: 1px;
  width: 100%;
  background-color: var(--border-color);
  margin: 1rem 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.nav-item:hover {
  background-color: var(--translucent-bg);
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  border-left: 3px solid #ffcc08;
}

.nav-item img {
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
}

.nav-item span {
  color: var(--text-color);
}

.nav-item.active span {
  color: #ffcc08;
}

/* Main content styles */
.main-content {
  padding: 1rem;
  overflow-y: auto;
}

.hero-banner {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  height: 300px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
  background-image: url("../images/background.png") !important;
  background-size: cover !important;
  background-position: center !important;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 2rem;
  width: 60%;
  z-index: 2;
}

.hero-banner img {
  position: absolute;
  top: 0;
  right: 0;
  max-height: 100%;
  z-index: 1;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffcc08;
  margin-bottom: 1rem;
}

.hero-description {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.7;
}

.subscribe-button {
  padding: 0.5rem 1.5rem;
  background-color: #ffcc08;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.subscribe-button:hover {
  background-color: #9eae00;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.section-title img {
  width: 24px;
  height: 24px;
}

.games-grid {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.2rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  cursor: grab; /* Shows a grab cursor to indicate draggable */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.games-grid::-webkit-scrollbar {
  display: none;
}

.games-grid:active {
  cursor: grabbing; /* Changes cursor while dragging */
}

.game-card {
  flex: 0 0 200px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1/1.2;
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.5rem 1.5rem;
  background-color: #ffcc08; /* For premium badges */
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 30px;
  color: #fff;
  transform: rotate(45deg) translateX(30%) translateY(-35%);
  transform-origin: top right;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.game-badge.new {
  background-color: #006bc3;
}

.game-badge.premium {
  background-color: #ffcc08;
}

/* For RTL languages like Arabic */
html[lang="ar"] .game-badge {
  right: auto;
  left: 0;
  transform: rotate(-45deg) translateX(-30%) translateY(-35%);
  transform-origin: top left;
}

html[lang="ar"] .nav-item img {
  margin-right: 0;
  margin-left: 0.75rem;
}

html[lang="ar"] .nav-item.active {
  border-right: 3px solid #ffcc08;
  border-left: 0px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: #1a1a1a;
  }

  .hero-content {
    width: 100%;
  }

  .hero-banner img {
    opacity: 0.3;
  }

  .game-card {
    flex: 0 0 160px;
  }
}

/* For tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    grid-template-columns: 200px 1fr;
  }

  .hero-content {
    width: 80%;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

.slider-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.1rem;
}

.nav-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--translucent-bg);
  transition: all 0.3s ease;
}

.dot.active {
  background-color: #ffcc08;
}

.nav-arrow {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  /* width: 20px;
    height: 20px; */
}
.nav-arrow:hover {
  color: var(--text-color);
}

.nav-arrow:disabled {
  color: var(--text-color);
  cursor: not-allowed;
}

/* Mobile Bottom Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--navbar-bg);
  border-top: 1px solid var(--border-color);
  padding: 0 10px;
  z-index: 1000;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 12px;
  gap: 4px;
  cursor: pointer;
  opacity: 0.6;
}

.mobile-nav-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.mobile-nav-btn.active {
  color: #ffcc08;
}

.mobile-nav-btn.active svg {
  stroke: #ffcc08;
}

.mobile-nav-btn.active img {
  filter: brightness(1.2);
}

.mobile-nav-btn span {
  font-size: 10px;
}

/* Mobile Sidebar Modifications */
.sidebar {
  transition: transform 0.3s ease;
}

/* Update your existing media query */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding-bottom: 60px; /* Make room for bottom bar */
  }

  .sidebar {
    display: block; /* Change from none to block */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px; /* Leave space for bottom bar */
    width: 100%;
    z-index: 999;
    transform: translateX(-100%);
    overflow-y: auto;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .mobile-bottom-bar {
    display: flex;
  }

  /* Adjust sidebar nav items for mobile */
  .sidebar-nav .nav-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Make search container full width on mobile */
  .search-container {
    width: 100%;
    padding: 15px;
  }
}

/* Mobile Search Overlay */
.mobile-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px; /* Leave space for bottom bar */
  background-color: var(--navbar-bg);
  z-index: 1000;
  padding: 10px;
}

.mobile-search-overlay.active {
  display: block;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.mobile-search-back {
  background: none;
  border: none;
  color: var(--text-color);
  padding: 8px;
  cursor: pointer;
}

.mobile-search-overlay .search-container {
  flex: 1;
}

.mobile-search-overlay .search-container input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  background-color: var(--translucent-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 16px;
}

.mobile-search-overlay .search-container .search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

/* Update sidebar media query */
@media (max-width: 768px) {
  .sidebar .search-container {
    display: none; /* Hide search in sidebar on mobile */
  }
}

/* Update the active state color for mobile nav buttons */
.mobile-nav-btn.active {
  color: #ffcc08; /* Replace the previous color with #ffcc08 */
}

.mobile-nav-btn.active svg {
  stroke: #ffcc08; /* For SVG icons */
}

.mobile-nav-btn.active img {
  /* If you need to apply any special styling to active image icons */
  filter: brightness(
    1.2
  ); /* Optional: makes the image slightly brighter when active */
}

/* Add the mobile nav button styles here */
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 12px;
  gap: 4px;
  cursor: pointer;
  opacity: 0.6;
}

.mobile-nav-btn.active {
  color: #ffcc08;
}

.mobile-nav-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.mobile-filters {
  display: none; /* Hidden by default on desktop */
  gap: 2px;
  padding: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .mobile-filters {
    display: flex;
    justify-content: space-between;
  }

  /* Hide the filters in sidebar on mobile */
  .sidebar .nav-filters {
    display: none;
  }

  /* Make filter items smaller on mobile */
  .mobile-filters .filter-item {
    min-width: 80px;
    padding: 8px 12px;
    background-color: var(--translucent-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }
  .hero-banner {
    height: 153px;
    padding-top: 0;
  }
  .hero-content {
    height: 153px;
    padding: 0.4rem;
  }
  .hero-title {
    font-size: 15px;
    margin-bottom: 2px;
  }
  .hero-subtitle {
    font-size: 15;
    margin-bottom: 1px;
  }
  .hero-description {
    font-size: 8px;
    width: 65%;
    margin-bottom: 0.5rem;
  }

  .subscribe-button {
    padding: 0.3rem 0.8rem;
  }
}

/* Individual background images */
.trending-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/streamline-trending-content-solid.svg");
}

.new-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/material-symbols-star.svg");
}

.popular-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/mingcute-love-fill.svg");
}

.premium-icon {
  background-image: url("https://c.animaapp.com/ZOKpjuCJ/img/fluent-premium-12-filled.svg");
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-all-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.2s;
}

.view-all-btn:hover {
  opacity: 0.8;
}

.view-all-icon {
  width: 16px;
  height: 16px;
}

/* Modify games-grid only when in category view */
.games-grid.category-view {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 0rem;
  padding-bottom: 0.2rem;
  justify-content: space-between;
}

.games-grid.category-view .game-card {
  flex: 0 0 160px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1/1.2;
}

/* For tablets and mobile */
@media (max-width: 768px) {
  .games-grid.category-view .game-card {
    flex: 0 0 160px;
  }
}

/* Add smooth transitions for all theme elements */
.sidebar,
.search-container input,
.filter-item,
.nav-item,
.mobile-bottom-bar,
.mobile-nav-btn,
.mobile-search-overlay,
.dot,
.nav-arrow,
.view-all-btn {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, opacity 0.3s ease;
}

/* Hero Slider Styles */
.hero-slider {
  position: relative;
  width: 100%;
  height: 500px;
  margin-bottom: 2rem;
  overflow: hidden;
  border-radius: 8px;
}

.slider-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.slide.active {
  opacity: 1;
}

.slide-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
  z-index: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding: 2rem;
  color: white;
}

.slide-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  max-width: 70%;
}

.play-button {
  padding: 0.75rem 1.5rem;
  background: var(--subscribe-gradient);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  font-size: 1rem;
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.slider-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dot.active {
  background-color: white;
}

/* Responsive styling for the slider */
@media (max-width: 768px) {
  .hero-slider {
    height: 300px;
  }

  .slide-title {
    font-size: 1.8rem;
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .hero-slider {
    height: 220px;
  }

  .slide-title {
    font-size: 1.4rem;
  }

  .play-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Style the search button to look like just the icon */
.search-submit-btn {
  background: none;
  border: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  padding: 0;
}

html[lang="ar"] .search-submit-btn {
  right: auto;
  left: 10px;
}

/* Hide the default icon since we're using it in the button */
.search-container .search-icon {
  position: static;
  transform: none;
}

/* Make sure the search container has position relative */
.search-container {
  position: relative;
}

/* Make the input take full width except for the icon space */
.search-container input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
}

html[lang="ar"] .search-container input {
  padding: 0.75rem 1rem 0.75rem 2.5rem;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px; /* Fixed height instead of covering the whole screen */
  background-color: var(--navbar-bg);
  z-index: 1000;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  transform: translateY(-100%);
}

.mobile-search-overlay.active {
  display: block;
  transform: translateY(0);
}

.mobile-search-header {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
}

.mobile-search-back {
  background: none;
  border: none;
  color: var(--text-color);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-search-overlay .search-container {
  flex: 1;
  margin: 0 5px;
  padding: 0;
}

.mobile-search-overlay .search-container input {
  width: 100%;
  height: 40px;
  padding: 8px 40px 8px 15px;
  background-color: var(--translucent-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-color);
  font-size: 16px;
}

.mobile-search-overlay .search-container .search-submit-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-search-overlay .search-container .search-icon {
  width: 20px;
  height: 20px;
}

/* Update RTL styles for the search bar */
html[lang="ar"] .mobile-search-overlay .search-container .search-submit-btn {
  right: auto;
  left: 10px;
}

html[lang="ar"] .mobile-search-overlay .search-container input {
  padding: 8px 15px 8px 40px;
}
.sidebar.active {
  transform: translateX(0);
}
