/* Global Custom Styles */
:root {
  --dark-blue: #1a1c2c;
  --purple: #7B61FF;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark-blue);
  min-height: 100vh;
  margin: 0;
}

/* Game Card Styles */
.game-card {
  transition: transform 0.3s ease;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  display: block;
  text-decoration: none;
  color: white;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  z-index: 5;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.game-card:hover::before {
  background: rgba(0, 0, 0, 0.2);
}

.game-card:active {
  transform: translateY(-2px);
}

.game-card img {
  transition: transform 0.3s ease;
}

.game-card:hover img {
  transform: scale(1.05);
}

/* Game Tag Styles */
.tag-new, .tag-hot, .tag-updated, .tag-top-rated, .tag-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10;
}

.tag-new {
  background-color: #7B61FF;
  color: white;
}

.tag-hot {
  background-color: #FF4B4B;
  color: white;
}

.tag-updated {
  background-color: #4CAF50;
  color: white;
}

.tag-top-rated {
  background-color: #FFC107;
  color: #333;
}

.tag-discount {
  background-color: #FF5722;
  color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1c2c;
}

::-webkit-scrollbar-thumb {
  background: #3d3d5c;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Color Helpers */
.purple {
  color: #7B61FF;
}

.bg-purple {
  background-color: #7B61FF;
}

/* Navigation Styles */
.nav-item.active {
  background-color: #2d3748; /* Dark gray background */
}

.nav-item.active a {
  color: white;
}

/* Language Selector Styles */
#language-selector {
    position: relative;
    z-index: 40;
    transition: background-color 0.2s;
    min-width: 100px;
}

#language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    transform-origin: top;
    transition: all 0.2s ease-in-out;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 120px;
}

#language-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

#language-dropdown:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

#language-dropdown a {
    transition: background-color 0.15s;
    padding: 0.75rem 1rem;
    display: block;
}

#language-dropdown a:hover {
    background-color: #4a5568;
}

/* Game Card Tag Styles */
.tag-hot, .tag-new, .tag-top-rated {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #ff4757;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    z-index: 1;
}

.tag-new {
    background-color: #2ed573;
}

.tag-top-rated {
    background-color: #ffa502;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #7B61FF;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.3s, background-color 0.3s;
    z-index: 10;
}

.back-to-top-btn:hover {
    background-color: #6a4eff;
}

/* Focus states for accessibility */
a:focus, button:focus {
    outline: 2px solid #7B61FF;
    outline-offset: 2px;
}

/* Loading Animation */
.loading-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    text-align: center;
}

.loading-content:after {
    content: "Loading...";
    font-size: 1.5rem;
    color: #7B61FF;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Mobile Sidebar Styles */
    #mobile-sidebar {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        overflow-y: auto;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
        transform: translateX(-100%);
        background-color: rgba(26, 28, 44, 0.95);
        opacity: 0;
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
        width: 75%;
        max-width: 280px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        max-height: calc(100vh - 72px);
    }
    
    #mobile-sidebar.show {
        transform: translateX(0);
        opacity: 1;
    }
    
    #mobile-sidebar.hidden {
        display: block !important;
        transform: translateX(-100%);
        opacity: 0;
    }
    
    /* Mobile Sidebar Scrollbar */
    #mobile-sidebar::-webkit-scrollbar {
        width: 4px;
    }
    
    #mobile-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
    
    #mobile-sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
    
    #mobile-sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Mobile Navigation Items */
    #mobile-sidebar .nav-item {
        margin: 0.5rem 0.75rem;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        transition: background-color 0.2s;
    }
    
    #mobile-sidebar .nav-item:active {
        background-color: #3d3d5c;
        transform: scale(0.98);
    }
    
    #mobile-sidebar .nav-item.active {
        background-color: #2d3748;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    #mobile-sidebar .nav-item a {
        display: flex;
        align-items: center;
    }
    
    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Game Grid Adjustments */
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    @media (min-width: 480px) and (max-width: 768px) {
        .game-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }
    }
    
    /* Text Sizing Adjustments */
    .page-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
        font-weight: bold;
        line-height: 1.2;
    }
    
    .category-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    /* Adjust Back to Top Button for Mobile */
    .back-to-top-btn {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0.5rem;
    }
    
    /* Navigation Adjustments */
    .nav-item {
        padding: 0.75rem 1rem;
        margin-bottom: 0.25rem;
        border-radius: 0.375rem;
    }
    
    /* Language Selector Adjustments */
    #language-selector {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
        min-width: 80px;
    }
    
    #language-selector .ml-1 {
        margin-left: 0.25rem;
    }
    
    #language-dropdown {
        min-width: 100px;
        right: 0;
    }
    
    /* Mobile Sidebar Overlay */
    #mobile-sidebar {
        top: 64px;
        max-height: calc(100vh - 64px);
        width: 80%;
        max-width: 280px;
    }
    
    #mobile-sidebar:not(.hidden) {
        display: block;
        opacity: 1;
    }
    
    /* Sidebar Scrollbar on Mobile */
    #mobile-sidebar::-webkit-scrollbar {
        width: 3px;
        background-color: transparent;
    }
    
    /* Prevent Background Scrolling When Sidebar Open */
    body.overflow-hidden {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* Mobile Navigation Items */
    .nav-item {
        padding: 0.5rem 0.75rem;
    }
    
    .nav-item.active {
        background-color: rgba(45, 55, 72, 0.8);
    }
    
    .nav-item a {
        font-size: 0.9375rem;
    }
}

/* Game Container Specific Styles */
@media (max-width: 768px) {
    .game-container {
        aspect-ratio: 3/4;
        max-height: none;
    }
    
    .game-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .control-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .control-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast focus for keyboard users */
.keyboard-user *:focus {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px !important;
}

/* SEO image optimization */
.game-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
} 