/*
Theme Name: Games
*/

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #fff0f6;
    color: #333;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  /* Header */
  .site-header {
    background: linear-gradient(to right, #ff69b4, #ffb6c1);
    padding: 1rem;
    top: 0;
    z-index: 1000;
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }
  
  .header-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .site-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  
  .site-logo img {    
    width: auto;
    display: block;
    margin: 0 auto;
  }
  
  .site-logo-link {
    display: inline-block;
  }
  
  .site-logo h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
  }
  
  /* Navigation */
  .main-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 1100;
  }
  
  .nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: block;
    transition: all 0.3s ease;
  }
  
  .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
  
  /* Mobile Menu Toggle */
  .menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: white;
    font-size: 2rem;
    line-height: 1;
    z-index: 2000;
  }
  
  .menu-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    text-align: center;
  }
  
  .menu-icon i {
    font-size: 32px;
    color: white;
    display: inline-block;
    vertical-align: middle;
  }
  
  .menu-toggle:hover {
    transform: scale(1.1);
  }
  
  .menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    border-radius: 4px;
  }
  
  /* Menu Overlay */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
  }
  
  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Mobile Styles */
  @media (max-width: 768px) {
    .header-vertical {
      gap: 0.25rem;
    }
    .site-logo {
      margin-bottom: 0.25rem;
    }
    .main-nav {
      width: 100%;
    }
    .menu-toggle {
      display: inline-block;
      position: absolute;
      top: 1rem;
      right: 1rem;
    }
  
    .nav-menu {
      position: fixed;
      top: 0;
      right: -280px;
      width: 280px;
      height: 100vh;
      background: #ff69b4;
      flex-direction: column;
      padding: 4rem 1rem 1rem;
      transition: right 0.3s ease;
      z-index: 999;
    }
  
    .nav-menu.active {
      right: 0;
    }
  
    .nav-menu a {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
  
    .nav-menu a:hover {
      background: rgba(255, 255, 255, 0.1);
    }
  
    /* Submenu Styles */
    .nav-menu .sub-menu {
      position: static;
      background: rgba(255, 255, 255, 0.1);
      padding: 0;
      margin: 0;
      display: none;
    }
  
    .nav-menu .menu-item-has-children.active > .sub-menu {
      display: block;
    }
  
    .nav-menu .sub-menu a {
      padding-left: 2rem;
    }
  
    .editors-picks {
      display: none !important;
    }
  }
  
  /* Desktop Styles */
  @media (min-width: 769px) {
    .nav-menu {
      display: flex;
      list-style: none;
      margin: 0;
      padding: 0;
      gap: 1rem;
    }
  
    .nav-menu a {
      color: white;
      text-decoration: none;
      font-weight: 500;
      padding: 0.5rem 1rem;
      display: block;
      transition: all 0.3s ease;
    }
  
    .nav-menu a:hover {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
    }
  
    .nav-menu .sub-menu {
      position: absolute;
      top: 100%;
      left: 0;
      background: white;
      min-width: 200px;
      padding: 0.5rem 0;
      border-radius: 4px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      display: none;
    }
  
    .nav-menu .menu-item-has-children:hover > .sub-menu {
      display: block;
    }
  
    .nav-menu .sub-menu a {
      color: #333;
      padding: 0.5rem 1rem;
    }
  
    .nav-menu .sub-menu a:hover {
      background: #f5f5f5;
    }
  
    .slider {
      overflow-x: hidden;
      justify-content: center;
    }
  }
  
  /* Homepage Layout */
  .homepage-wrapper {
    padding: 1rem;
    max-width: 1200px;
    margin: auto;
  }
  
  /* Section Titles */
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #d63384;
    text-align: center;
  }
  
  /* Editor's Picks Section */
  .editors-picks {
    padding: 2rem 0;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .editors-picks-flex {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 50px;
  }
  
  #editors-picks-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 20px;
    padding: 10px 0;
    width: 100%;
    min-height: auto;
  }
  
  #editors-picks-slider::-webkit-scrollbar {
    display: none;
  }
  
  .slide {
    flex: 0 0 calc(25% - 15px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Override any transform that might be applied by inline scripts */
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }
  
  .slide:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  
  .slide-link {
    display: block;
    height: 100%;
    position: relative;
  }
  
  .slide-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
  }
  
  .slide-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: linear-gradient(to bottom right, #ffb6c1, #ff69b4);
    border-radius: 16px 16px 0 0;
  }
  
  .slide-no-image i {
    font-size: 48px;
    color: white;
  }
  
  .slide-title {
    padding: 10px 15px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: white;
    border-radius: 0 0 16px 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  
  .placeholder-title {
    color: #aaa;
    font-style: italic;
  }
  
  .slider-arrow {
    background: #ff69b4;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 1.2rem;
  }
  
  .slider-arrow:hover {
    background: #ff1493;
    transform: scale(1.1);
  }
  
  .slider-arrow-left {
    left: 0;
  }
  
  .slider-arrow-right {
    right: 0;
  }
  
  /* Responsive adjustments for the editors picks slider */
  @media (max-width: 1024px) {
    .slide {
      flex: 0 0 calc(33.333% - 14px);
    }
  }
  
  @media (max-width: 768px) {
    .slide {
      flex: 0 0 calc(50% - 10px);
    }
    
    .editors-picks-flex {
      padding: 0 40px;
    }
    
    .slider-arrow {
      width: 36px;
      height: 36px;
    }
  }
  
  @media (max-width: 480px) {
    .slide {
      flex: 0 0 calc(100% - 10px);
    }
    
    .editors-picks-flex {
      padding: 0 30px;
    }
    
    .slider-arrow {
      width: 32px;
      height: 32px;
    }
  }
  
  /* Games Grid */
  .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
  }
  .game-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s ease;
  }
  .game-card:hover {
    transform: scale(1.03);
  }
  .game-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
  }
  .game-card h3 {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    margin: 0;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Footer */
  .site-footer {
    background: #ffe4ec;
    padding: 2rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #444;
  }
  
  .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
  }
  
  .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-copyright p {
    margin: 0;
  }
  
  .footer-menu-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  
  
  .footer-menu-list li a:hover:after {
    width: 100%;
  }
  
  @media (min-width: 768px) {
    .footer-content {
      flex-direction: row;
      justify-content: space-between;
      text-align: left;
    }
  }
  
  /* Responsive Tweaks */
  @media (max-width: 480px) {
    .games-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  @media (min-width: 1024px) {
    .games-grid {
      grid-template-columns: repeat(6, 1fr);
    }
  }

  .single-game-layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding: 0 1rem;
  }
  
  .single-game-wrapper {
    flex: 1 1 0;
    margin-top: 2rem;
  }
  
  .game-sidebar {
    width: 100px;
    min-width: 100px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    position: sticky;
    top: 90px;
    height: 80vh;
    max-height: 600px;
    z-index: 1;
  }
  
  .sidebar-icons-wrapper {
    flex: 1 1 0;
    overflow-y: auto;
    width: 100%;
    margin: 1rem 0;
  }
  
  .sidebar-icons-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .sidebar-game-icon {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    object-fit: cover;
    transition: transform 0.2s;
  }
  .sidebar-game-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(214,51,132,0.15);
  }
  
  .sidebar-arrow {
    background: #ff69b4;
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0.25rem 0;
    cursor: pointer;
    transition: background 0.2s;
  }
  .sidebar-arrow:hover {
    background: #d63384;
  }
  
  /* Hide sidebar on mobile */
  @media (max-width: 900px) {
    .single-game-layout {
      flex-direction: column;
      gap: 0;
    }
    .game-sidebar {
      display: none;
    }
    .single-game-wrapper {
      margin-top: 1rem;
    }
  }
  
  .game-title {
    font-size: 2rem;
    color: #d63384;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .game-player {
    background: #000;
    text-align: center;
    padding: 0.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
  }
  .game-player iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 10px;
  }
  
  .game-description {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
  }
  
  .game-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
  }
  
  .related-games h2 {
    font-size: 1.25rem;
    color: #d63384;
    margin-bottom: 1rem;
  }
  
  /* Center nav menu horizontally on desktop */
  .main-nav {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1100;
  }

  .nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-menu li {
    position: relative;
  }

  .nav-menu a {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1rem;
    padding: 0.5rem 0;
    display: block;
  }

  .nav-menu li ul {
    display: none;
    position: absolute;
    top: 2.5rem;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 1200;
    padding: 0.5rem 0;
  }

  .nav-menu li:hover > ul {
    display: block;
  }

  .nav-menu li ul li a {
    color: #333;
    padding: 0.5rem 1rem;
    font-weight: 400;
  }

  /* Mobile Drawer Menu */
  .menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1300;
  }

  .menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1200;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* Drawer nav panel */
  .drawer-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -3px 0 8px rgba(0,0,0,0.15);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: right 0.3s ease;
    z-index: 1300;
  }

  .drawer-nav.open {
    right: 0;
  }

  .drawer-nav .nav-menu {
    flex-direction: column;
    gap: 1rem;
  }

  .drawer-nav .nav-menu li ul {
    position: static;
    box-shadow: none;
    background: transparent;
    padding-left: 1rem;
  }

  .drawer-nav .nav-menu li:hover > ul {
    display: block; /* optional to enable submenus on mobile */
  }

  /* Show menu-toggle only on mobile */
  @media (max-width: 768px) {
    .menu-toggle {
      display: block;
    }

    .main-nav > ul.nav-menu {
      display: none;
    }
  }

  .slider-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .slide-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  .slider {
    scroll-behavior: smooth;
    padding-left: 48px;
    padding-right: 48px;
    scroll-snap-type: x mandatory;
  }
  .slide,
  .placeholder-slide {
    box-sizing: border-box;
    scroll-snap-align: start;
  }
  @media (max-width: 600px) {
    .slider-arrow {
      display: flex;
      width: 28px;
      height: 28px;
      font-size: 1rem;
    }
    .slider {
      padding-left: 36px;
      padding-right: 36px;
    }
  }

  .category-nav-flex {
    display: flex;
    align-items: center;
    gap: 2.5rem;
  }

  .category-nav-arrow {
    position: static;
    transform: none;
    z-index: 1;
    flex-shrink: 0;
  }

  .category-nav-wrapper {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
  }

  .category-nav-wrapper .category-item:first-child {
    margin-left: 0;
  }
  .category-nav-wrapper .category-item:last-child {
    margin-right: 0;
  }

  /* Performance Optimizations for Images */
  img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
  }

  img.loaded {
    opacity: 1;
  }

  /* Fix for Cumulative Layout Shift (CLS) */
  .slide-image, 
  .game-card img {
    aspect-ratio: 16/9;
    width: 100%;
    background-color: #f5f5f5;
  }

  /* Preload animation */
  .slide-image::before,
  .game-card img::before {
    content: "";
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
  }

  @keyframes loading {
    0% {
      background-position: 0% 0;
    }
    100% {
      background-position: -200% 0;
    }
  }

  /* Add focus styles for better accessibility */
  .slide-link:focus,
  .game-card a:focus {
    outline: 3px solid #ff69b4;
    outline-offset: 3px;
  }

  .slider-arrow:focus {
    outline: 3px solid #ff69b4;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.3);
  }

  /* Reduce motion for users with preferences */
  @media (prefers-reduced-motion: reduce) {
    .slide {
      transition: none !important;
    }
    
    .slider {
      scroll-behavior: auto !important;
    }
    
    img[data-src] {
      transition: none !important;
    }
  }
