/*

Custom style

You can override the default class or style here

This file will not be overwritten by the updater

*/

/* Game Title Styling for Trending Games */
.trending-games .game-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: 2.4em;
    word-wrap: break-word;
    hyphens: auto;
}

.trending-games .game-title:hover {
    color: #a855f7 !important; /* violet-400 */
}

/* Language Switcher - Dropdown Style for Astro Theme */
.language-switcher-astro {
    position: relative;
    display: inline-block;
}

.language-switcher-astro .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #9CA3AF;
    backdrop-filter: blur(10px);
}

.language-switcher-astro .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.language-switcher-astro .dropdown-toggle:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.language-switcher-astro .flag-icon {
	width: 18px;
	height: 14px;
	border-radius: 2px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	object-fit: cover;
}

.language-switcher-astro .lang-text {
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-switcher-astro .dropdown-arrow {
    font-size: 8px;
    color: #9CA3AF;
    transition: transform 0.3s ease;
}

.language-switcher-astro.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile Language Switcher - Flag Only Style */
.language-switcher-mobile {
    position: relative;
    display: none; /* Hidden by default */
}

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

.language-switcher-mobile .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-switcher-mobile .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.language-switcher-mobile .flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.language-switcher-mobile .lang-text,
.language-switcher-mobile .dropdown-arrow {
    display: none;
}

/* Footer Language Switcher - Compact Style */
.language-switcher-footer {
    position: relative;
    display: inline-block;
}

.language-switcher-footer .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    color: #9CA3AF;
    backdrop-filter: blur(10px);
}

.language-switcher-footer .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.language-switcher-footer .flag-icon {
	width: 16px;
	height: 12px;
	border-radius: 2px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	object-fit: cover;
}

.language-switcher-footer .lang-text {
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.language-switcher-footer .dropdown-arrow {
    font-size: 7px;
    color: #9CA3AF;
    transition: transform 0.3s ease;
}

.language-switcher-footer.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.language-switcher-astro .dropdown-menu,
.language-switcher-footer .dropdown-menu,
.language-switcher-mobile .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    margin-top: 8px;
    z-index: 1002; /* Higher than other elements */
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
}

.language-switcher-astro:hover .dropdown-menu,
.language-switcher-astro.dropdown-open .dropdown-menu,
.language-switcher-footer:hover .dropdown-menu,
.language-switcher-footer.dropdown-open .dropdown-menu,
.language-switcher-mobile:hover .dropdown-menu,
.language-switcher-mobile.dropdown-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher-astro .dropdown-item,
.language-switcher-mobile .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #9CA3AF;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.language-switcher-astro .dropdown-item:hover,
.language-switcher-mobile .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.language-switcher-astro .dropdown-item.active,
.language-switcher-mobile .dropdown-item.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    font-weight: 600;
}

.language-switcher-astro .dropdown-item .flag-icon,
.language-switcher-mobile .dropdown-item .flag-icon {
	width: 20px;
	height: 15px;
	border-radius: 3px;
	object-fit: cover;
}

.language-switcher-astro .dropdown-item .lang-name,
.language-switcher-mobile .dropdown-item .lang-name {
    font-size: 13px;
    font-weight: 500;
}

/* Footer Language Switcher Items */
.language-switcher-footer .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #9CA3AF;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.language-switcher-footer .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.language-switcher-footer .dropdown-item.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    font-weight: 600;
}

.language-switcher-footer .dropdown-item .flag-icon {
	width: 18px;
	height: 13px;
	border-radius: 2px;
	object-fit: cover;
}

.language-switcher-footer .dropdown-item .lang-name {
    font-size: 12px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .language-switcher-astro .dropdown-menu,
    .language-switcher-footer .dropdown-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 280px;
    }
    
    /* Mobile language switcher will be positioned by JavaScript */
    .language-switcher-mobile .dropdown-menu {
        position: fixed;
        z-index: 1002;
        width: 90%;
        max-width: 280px;
    }
    
    .language-switcher-astro .dropdown-toggle {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .language-switcher-astro .flag-icon {
		width: 16px;
		height: 12px;
		object-fit: cover;
	}
    
    .language-switcher-footer .dropdown-toggle {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .language-switcher-footer .flag-icon {
		width: 14px;
		height: 10px;
		object-fit: cover;
	}
    
    /* Special positioning for footer language switcher on mobile */
    .language-switcher-footer .dropdown-menu {
        position: fixed;
        bottom: 20px; /* Position from bottom instead of center */
        top: auto; /* Override top positioning */
        left: 50%;
        transform: translateX(-50%); /* Only center horizontally */
        max-height: 60vh; /* Limit height to 60% of viewport */
        overflow-y: auto; /* Add scroll if needed */
        z-index: 1001; /* Ensure it's above other elements */
        transition: none; /* Disable CSS transitions for dynamic positioning */
    }
    
    /* Ensure dropdown doesn't go below viewport */
    .language-switcher-footer .dropdown-menu {
        max-height: calc(100vh - 40px); /* Viewport height minus margins */
    }
    
    /* When JavaScript takes control of positioning */
    .language-switcher-footer .dropdown-menu.js-positioned,
    .language-switcher-mobile .dropdown-menu.js-positioned {
        transition: none !important;
        animation: none !important;
    }
}

/* Categories Menu Bar Styles */
.categories-menu-bar {
    border-top: 1px solid #2A364F;
}

.categories-menu-bar .category-item {
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    border-radius: 0.375rem;
}

.categories-menu-bar .category-item:hover {
    color: #ffffff;
    background-color: rgba(139, 92, 246, 0.1);
}

.categories-menu-bar .more-dropdown {
    max-height: 320px;
    overflow-y: auto;
}

.categories-menu-bar .more-dropdown::-webkit-scrollbar {
    width: 6px;
}

.categories-menu-bar .more-dropdown::-webkit-scrollbar-track {
    background: #1E2A45;
}

.categories-menu-bar .more-dropdown::-webkit-scrollbar-thumb {
    background: #4C566A;
    border-radius: 3px;
}

.categories-menu-bar .dropdown-item {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    margin: 0.125rem 0;
}

.categories-menu-bar .dropdown-item:hover {
    background-color: #3A465F;
    color: #ffffff;
}

/* Desktop Categories Menu - Larger text and icons */
.categories-desktop {
    display: none;
}

.categories-desktop.flex {
    display: flex;
    flex-wrap: wrap;
}

.categories-desktop .category-link {
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem; /* Tăng kích thước chữ */
    padding: 0.5rem 1rem; /* Tăng padding */
}

.categories-desktop .category-link span:first-child {
    font-size: 1.3rem; /* Tăng kích thước emoji/icon */
    margin-right: 0.5rem;
}

/* Mobile Categories Menu - Prevent overflow */
.categories-mobile {
    display: flex;
}

.categories-mobile .category-links-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.categories-mobile .category-links-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.categories-mobile .category-link {
    flex-shrink: 0;
    font-size: 0.9rem; /* Kích thước chữ hợp lý cho mobile */
    padding: 0.4rem 0.8rem;
    margin-right: 0.5rem;
}

.categories-mobile .category-link span:first-child {
    font-size: 1.1rem;
    margin-right: 0.4rem;
}

.categories-mobile .more-dropdown-button {
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

/* Scrollbar hide for mobile (backup) */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Responsive - Show desktop version on medium screens and up */
@media (min-width: 768px) {
    .categories-mobile {
        display: none;
    }
    
    .categories-desktop {
        display: flex;
    }
}

/* Responsive - Show mobile version on small screens */
@media (max-width: 767px) {
    .categories-desktop {
        display: none;
    }
    
    .categories-mobile {
        display: flex;
    }
    
    /* Đảm bảo container không vượt quá chiều rộng màn hình */
    .categories-menu-bar .max-w-7xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Extra safety for very small screens */
@media (max-width: 480px) {
    .categories-mobile .category-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .categories-mobile .category-link span:first-child {
        font-size: 1rem;
    }
    
    .categories-mobile .more-dropdown-button {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Multi-site Navigation Styling */
.multi-site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.multi-site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db;
  transition: color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.multi-site-nav a:hover {
  color: #ffffff;
}

/* Mobile multi-site navigation */
@media (max-width: 768px) {
  .multi-site-nav {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .multi-site-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    color: #d1d5db;
    transition: all 0.2s ease;
  }
  
  .multi-site-nav a:hover {
    color: #ffffff;
    background-color: #374151;
  }
}