/* 50-GAME NEXT GENERATION - Bright, Cheerful, Modern Gaming Design System */
:root {
  --bg-main: #f0f4f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-nav: #ffffff;
  --accent: #ff4757;
  --accent-hover: #ff6b81;
  --accent-glow: rgba(255, 71, 87, 0.35);
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.25);
  --secondary: #10b981;
  --secondary-glow: rgba(16, 185, 129, 0.25);
  --blue: #0284c7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 18px 40px rgba(79, 70, 229, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

[dir="rtl"] {
  --font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #f0f4f9 !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(244, 63, 94, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%) !important;
  background-attachment: fixed !important;
  color: #0f172a !important;
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* NAVBAR */
.navbar-next {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff !important;
  border-bottom: 2px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #0f172a !important;
}

.brand-logo .badge-50 {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #ffffff !important;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* SEARCH BAR */
.search-container {
  position: relative;
  flex: 1;
  max-width: 540px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1.4rem;
  padding-left: 2.85rem;
  background: #f8fafc !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 50px;
  color: #0f172a !important;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

.search-input::placeholder {
  color: #94a3b8;
  font-weight: normal;
}

[dir="rtl"] .search-input {
  padding-left: 1.4rem;
  padding-right: 2.85rem;
}

.search-input:focus {
  border-color: #4f46e5 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  color: #64748b;
  pointer-events: none;
  font-size: 1rem;
}

[dir="rtl"] .search-icon {
  left: auto;
  right: 1.1rem;
}

/* SEARCH AUTOCOMPLETE DROPDOWN */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 1050;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  transition: var(--transition);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f8fafc;
}

.search-result-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.search-result-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  color: #0f172a;
  font-weight: 700;
}

.search-result-info span {
  font-size: 0.8rem;
  color: #4f46e5;
  font-weight: 600;
}

/* NAV LINKS & ACTIONS */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn-accent {
  background: linear-gradient(135deg, #ff4757, #ff6b81) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.nav-btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.nav-btn-ghost {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.nav-btn-ghost:hover {
  background: #f8fafc !important;
  border-color: #4f46e5 !important;
  color: #4f46e5 !important;
  transform: translateY(-1px);
}

/* LANGUAGE SELECTOR DROPDOWN (Pure CSS Hover & Focus + JS Click) */
.lang-selector-wrapper {
  position: relative;
  display: inline-block;
}

.lang-selector-wrapper:hover .lang-menu-dropdown,
.lang-selector-wrapper:focus-within .lang-menu-dropdown,
.lang-menu-dropdown.active,
.lang-menu-dropdown.is-open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.lang-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25) !important;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 9999999 !important;
  padding: 0.85rem;
}

[dir="rtl"] .lang-menu-dropdown {
  right: auto;
  left: 0;
}
.lang-grid-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.lang-item-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  transition: var(--transition);
  text-decoration: none;
}
.lang-item-btn:hover {
  background: #eef2ff;
  color: #4f46e5;
}
.lang-item-btn.active {
  background: #4f46e5;
  color: #ffffff !important;
}

/* CATEGORY SCROLLER / PILLS */
.category-bar {
  background: #ffffff !important;
  padding: 0.75rem 1.75rem;
  border-bottom: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.category-bar::-webkit-scrollbar {
  height: 4px;
}
.category-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155 !important;
  transition: var(--transition);
}

.cat-pill:hover, .cat-pill.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-2px);
}

/* MAIN LAYOUT */
.main-content {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* SECTION TITLES */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #0f172a !important;
  letter-spacing: -0.3px;
}

.section-title span.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(244, 63, 94, 0.12));
  font-size: 1.15rem;
}

/* GAME GRID */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

@media (max-width: 640px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 0.85rem;
  }
}

/* GAME CARD (Crisp, Bright, Playful) */
.game-card {
  position: relative;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #4f46e5 !important;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.15) !important;
}

.game-card-thumb-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f1f5f9;
  overflow: hidden;
}

.game-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover .game-card-img {
  transform: scale(1.08);
}

.game-card-play-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.2) 0%, rgba(15, 23, 42, 0.6) 100%);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.game-card:hover .game-card-play-overlay {
  opacity: 1;
}

.play-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 18px var(--accent-glow);
  transform: scale(0.8);
  transition: var(--transition);
}

.game-card:hover .play-icon-circle {
  transform: scale(1);
}

.game-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #ffffff !important;
}

.game-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
}

.game-card-cat {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: capitalize;
}

.game-card-rating {
  color: #eab308;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* HERO SECTION (Clean White & Cheerful) */
.hero-showcase {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .hero-showcase {
    grid-template-columns: 1fr;
  }
}

.hero-main-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ffffff !important;
  border: 2px solid #e2e8f0 !important;
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 2rem;
  text-decoration: none;
}

@media (max-width: 600px) {
  .hero-main-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
}

.hero-main-card .hero-thumb-large {
  width: 170px;
  height: 170px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.18);
  flex-shrink: 0;
  border: 2px solid #e2e8f0;
}

.hero-main-card .hero-content-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .hero-side-grid {
    grid-template-columns: 1fr;
  }
}

/* SEO CONTENT BOX (Clean, Light, Readable) */
.seo-intro-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-top: 3.5rem;
  color: #334155 !important;
  box-shadow: var(--shadow-sm);
}

.seo-intro-card h2 {
  color: #0f172a !important;
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.seo-intro-card h3 {
  color: #0f172a !important;
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.seo-intro-card p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #475569 !important;
}

/* FOOTER (Clean Slate Dark) */
.site-footer {
  background: #0f172a !important;
  border-top: 1px solid #1e293b;
  padding: 3.5rem 1.75rem 2rem;
  margin-top: auto;
  color: #94a3b8 !important;
  font-size: 0.95rem;
}

.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  color: #ffffff !important;
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
  font-weight: 800;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a:hover {
  color: #ffffff !important;
  padding-left: 6px;
}
[dir="rtl"] .footer-links a:hover {
  padding-left: 0;
  padding-right: 6px;
}

.footer-bottom {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}
