/* Theme-related styles */
body {
    background-color: #121212;
    color: #fff;
    transition: background-color 0.3s, color 0.3s;
    direction: ltr;
    text-align: left;
}

body.light-theme {
    background-color: #f0f0f0;
    color: #000;
}

body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.header {
    background-color: #1e1e1e;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.light-theme .header {
    background-color: #ddd;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}

.logo .lb {
    color: #1e90ff;
}

.logo .x {
    color: #fff;
}

body.light-theme .logo .x {
    color: #000;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #fff;
    pointer-events: none;
}

body.light-theme .search-icon {
    color: #000;
}

.search-bar {
    width: 100%;
    padding: 16px 16px 16px 40px;
    border: none;
    border-radius: 8px;
    background-color: #2a2a2a;
    color: #fff;
    font-size: 18px;
}

body.light-theme .search-bar {
    background-color: #ccc;
    color: #000;
}

.header-link {
    font-size: 16px;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
}

body.light-theme .header-link {
    color: #000;
}

.header-link:hover {
    color: #1e90ff;
}

body.light-theme .header-link:hover {
    color: #0d74d9;
}

.header-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #1e90ff;
    transition: width 0.3s ease-in-out;
}

body.light-theme .header-link::after {
    background-color: #0d74d9;
}

.cart-icon {
    position: relative;
    color: #fff;
    font-size: 20px;
    text-decoration: none;
}

body.light-theme .cart-icon {
    color: #000;
}

.cart-icon:hover {
    color: #1e90ff;
}

body.light-theme .cart-icon:hover {
    color: #0d74d9;
}

/* Toggle switch styles */
.toggle-switch {
    display: inline-block;
}

.switch-label {
    display: block;
    width: 50px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

.checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.checkbox:checked + .slider {
    background-color: #1e90ff;
}

.checkbox:checked + .slider:before {
    transform: translateX(26px);
}

body.light-theme .slider {
    background-color: #999;
}

body.light-theme .checkbox:checked + .slider {
    background-color: #0d74d9;
}

/* Language menu styles */
.language-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

body.light-theme .language-menu {
    background-color: #fff;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.language-option {
    padding: 10px;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

body.light-theme .language-option {
    color: #000;
}

.language-option:hover {
    background-color: #1e90ff;
}

body.light-theme .language-option:hover {
    background-color: #0d74d9;
}

.language-menu h2 {
    margin: 0 0 15px;
    font-size: 20px;
}

.language-menu .modal-close {
    margin-top: 15px;
    padding: 10px;
    background-color: #dc3545;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    width: 100%;
}

.language-menu .modal-close:hover {
    background-color: #c82333;
}

/* Product-specific styles */
.game-grid, .category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    justify-content: flex-start;
}

.game-item, .category-item {
    text-align: center;
    background-color: transparent;
    padding: 0;
    position: relative;
    transition: transform 0.2s;
    flex: 0 0 80px;
    border-radius: 8px;
}

.game-item:hover, .category-item:hover {
    transform: scale(1.05);
}

body.light-theme .category-item {
    background-color: transparent;
}

.category-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-image-container {
    position: relative;
    display: block;
    width: 100%;
    height: 80px;
}

.game-item img, .category-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.product-name {
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
    color: #fff;
}

body.light-theme .product-name {
    color: #000;
}

.out-of-stock .out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 8px;
}

.out-of-stock:hover .out-of-stock-overlay {
    opacity: 1;
}

.out-of-stock-icon {
    color: #dc3545;
    font-size: 24px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 50%;
    text-shadow: none;
}

/* Category counter styles */
.category-counter {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #1e90ff;
    border-radius: 12px;
    font-size: 14px;
    color: #fff;
}

body.light-theme .category-counter {
    background-color: #0d74d9;
}

/* Profile page styles */
.profile-page-container {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.profile-sidebar {
    flex: 0 0 200px;
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
}

body.light-theme .profile-sidebar {
    background-color: #ddd;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    padding: 10px;
    background-color: #2a2a2a;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
}

body.light-theme .menu-item {
    background-color: #ccc;
    color: #000;
}

.menu-item:hover, .menu-item.active {
    background-color: #1e90ff;
}

body.light-theme .menu-item:hover, body.light-theme .menu-item.active {
    background-color: #0d74d9;
}

.profile-content {
    flex: 1;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.profile-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group span {
    display: block;
    padding: 10px;
    background-color: #2a2a2a;
    border-radius: 4px;
}

body.light-theme .form-group span {
    background-color: #ccc;
}