/* =========================================
   1. General Site Layout & Background
   ========================================= */
body {
  background-image: url("https://totoyaplay.com/wp-content/uploads/2025/11/back.png");
  background-attachment: fixed;
  background-size: cover;
  color: #fff; /* Text visibility */
  margin: 0;
  padding: 0;
}

/* =========================================
   2. Header Styling
   ========================================= */
header, .site-header, #topbar {
  background-color: #0096c7 !important; /* Night Blue */
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Header Links */
header a, .site-header a, #topbar a {
  color: #fff !important;
  text-decoration: none;
}

header a:hover, .site-header a:hover, #topbar a:hover {
  color: #00d4ff !important; /* Light Blue on hover */
  font-weight: bold;
}

/* =========================================
   3. Categories Section
   ========================================= */
.category-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 15px;
}

.category-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0b1e3f; /* Midnight Blue background */
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Category Image */
.category-grid-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

/* Category Name Overlay */
.category-grid-item .category-name {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  padding: 8px;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  width: 100%;
}

/* Category Hover Effect */
.category-grid-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* =========================================
   4. Games Grid & Posts
   ========================================= */

/* Shared Styles for Game Containers */
#home-post, .games {
  background: #0b1e3f;
  color: #fff;
}

/* Main Games Grid Container */
#games {
  display: grid;
  /* Auto-fit creates responsive columns based on min-width */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  
  /* Overrides to cancel potential JS inline styles */
  position: static !important;
  height: auto !important;
  width: auto !important;
}

/* Individual Game Card Styling */
#games game.games,
#games game.featured-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  
  /* Reset positioning for grid items */
  position: static !important;
  left: auto !important;
  top: auto !important;
}

/* Featured Item (Spans 2 rows/cols) */
.featured-item,
#games .featured-item {
  grid-column: span 2;
  grid-row: span 2;
}

/* Thumbnails & Images */
#games .games a,
#games .games .thumb,
#games .games .thumb img,
#games .featured-item .thumb,
.featured-item .thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
}

/* Hover Effect on Game Thumbnails */
.games .thumb img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5); /* Subtle glow */
}

/* Responsive Adjustments for Games Grid */
@media (max-width: 1200px) {
  #games { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  #games { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  #games { grid-template-columns: repeat(3, 1fr); }
}


.games {
  float: left;
  width: 93px;
  height: 93px;
  margin: 7px;
  padding: 0px;
  border: 1px solid rgba(250,250,250,0.1);
  box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
  -moz-box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
  -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
  border-radius: 10px;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
	
	overflow: visible;
}

.games:hover {
	 width: 100%;
  transition: transform 0.3s ease;
  background-color: #fff;
	transform: scale(1.1);
	
	z-index: 99;
}



/* =========================================
   5. Content Description (Game Details)
   ========================================= */
.description {
  padding: 20px 25px;
  background: linear-gradient(180deg, rgba(33, 25, 76, 0.95), rgba(66, 55, 128, 0.8)); /* Dark Violet Gradient */
  border: 1px solid rgba(250, 250, 250, 0.15);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  margin: 20px 0;
  color: #fff;
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  line-height: 1.7em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.description:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(221, 32, 51, 0.4); /* Reddish shadow */
}

/* Table of Contents Block */
.description div[style*="border: 1px solid #ddd"] {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(250, 250, 250, 0.2);
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 1.5em;
}

.description div[style*="border: 1px solid #ddd"] p {
  font-size: 1.2em;
  font-weight: 700;
  color: #dd2033; /* Theme Red */
  margin-bottom: 0.8em;
  text-transform: uppercase;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.description div[style*="border: 1px solid #ddd"] ul {
  padding-left: 1.5em;
}

.description div[style*="border: 1px solid #ddd"] li {
  list-style-type: disc;
  margin-bottom: 0.6em;
  font-size: 1em;
  color: #fff;
}

.description div[style*="border: 1px solid #ddd"] a {
  color: #dd2033;
  text-decoration: none;
  transition: color 0.3s ease;
}

.description div[style*="border: 1px solid #ddd"] a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Paragraphs */
.description p {
  margin-bottom: 1.3em;
  font-size: 16px;
  text-align: justify;
  color: rgba(255, 255, 255, 0.9);
}

.description p:last-child {
  margin-bottom: 0;
}

/* Headings */
.description h2, .description h3, .description h4 {
  color: #dd2033;
  margin: 1.2em 0 0.6em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.description h2 { font-size: 22px; }
.description h3 { font-size: 18px; }
.description h4 { font-size: 16px; }

/* Lists */
.description ul, .description ol {
  margin: 1.5em 0;
  padding-left: 2em;
  list-style-position: outside;
}

.description ul li {
  list-style-type: disc;
  margin-bottom: 0.8em;
  color: #fff;
  position: relative;
  padding-left: 12px;
}

.description ol li {
  list-style-type: decimal;
  margin-bottom: 0.8em;
  color: #fff;
}

/* Custom List Bullet (Icon) */
.description li:before {
  content: "\f3c5"; /* Placeholder icon from iconfont.css */
  font-family: 'iconfont'; 
  color: #dd2033;
  position: absolute;
  left: -12px;
  font-size: 14px;
}

/* Formatting: Bold & Italic */
.description strong, .description b {
  color: #fff;
  font-weight: 800;
  background: linear-gradient(90deg, #dd2033, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.description em, .description i {
  font-style: italic;
  color: #ff6b6b;
  text-shadow: 0 0 5px rgba(221, 32, 51, 0.5);
}

/* Links inside Description */
.description a {
  color: #ffd700;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

.description a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: #dd2033;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.description a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.description a:hover {
  color: #fff;
}

/* Line Breaks */
.description br {
  display: block;
  content: "";
  margin-bottom: 0.8em;
}

/* Images & Iframes (YouTube) */
.description img,
.description iframe {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5em auto;
  display: block;
  border: 2px solid #423780;
  box-shadow: 0 0 10px rgba(66, 55, 128, 0.5);
  transition: transform 0.3s ease;
}

.description iframe {
  aspect-ratio: 16 / 9;
}

.description img:hover,
.description iframe:hover {
  transform: scale(1.02);
}

/* Blockquotes */
.description blockquote {
  border-left: 5px solid #dd2033;
  padding: 10px 20px;
  margin: 1.5em 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
}

.description blockquote:before {
  content: "\f10d"; /* Quote icon from iconfont */
  font-family: 'iconfont';
  color: #dd2033;
  position: absolute;
  top: 10px;
  left: -15px;
  font-size: 20px;
}

/* Responsive for Description */
@media only screen and (max-width: 767px) {
  .description {
    padding: 15px 20px;
    border-radius: 8px;
  }

  .description p {
    font-size: 15px;
    text-align: left; /* Better readability on mobile */
  }

  .description h2 { font-size: 20px; }
  .description h3 { font-size: 17px; }
  .description h4 { font-size: 15px; }

  .description img, .description iframe {
    border-radius: 8px;
    margin: 1em auto;
  }

  .description div[style*="border: 1px solid #ddd"] {
    padding: 10px 15px;
  }
}

.menu-footer {
    display: none !important;
}

/* Video Hover Effect for Games */
.thumb {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 10px; /* Match existing thumb border-radius */
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease; /* Match existing hover */
}

.hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
    border-radius: 10px; /* Match thumb */
}

.thumb:hover .thumb-img {
    opacity: 1;
}

.thumb:hover .hover-video {
    opacity: 1;
    transform: scale(1.05); /* Match existing img:hover scale */
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5); /* Match glow */
}


/* Ensure featured items scale appropriately */
.featured-item .thumb,
.featured-item .thumb-img,
.featured-item .hover-video {
    width: 100%;
    height: 100%;
}

/* Mobile: hide videos for performance */
@media (max-width: 768px) {
    .hover-video {
        display: none;
    }
}
.game_title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 95%;
    padding: 5px;

    color: white; /* Main text color */
    text-align: left;
    z-index: 10;

    /* Optional: make it more readable */
    text-shadow: 1px 1px 2px black; /* Shadow dyal text, kayb9a readable f kol image */
    font-weight: bold; /* Khalli lktba b bold */
    font-family: Arial, sans-serif; /* Font zwin */
    font-size: 11px; /* Adjust as needed */
    letter-spacing: 0.5px; /* Space between letters */

    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Show on hover */
.games:hover .game_title {
    opacity: 1;
}
