:root {
    --primary-bg: #121827;
    --secondary-bg: #1a2235;
    --accent-1: #6c5ce7;
    --accent-2: #ff6b6b;
    --accent-3: #00cec9;
    --accent-4: #fdcb6e;
    --text-primary: #f8f9fa;
    --text-secondary: #dadada;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

.sidebar {
    background-color: var(--secondary-bg);
    height: 100%;
    width: 80px;
    position: fixed;
    z-index: 30;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

.sidebar:not(.sidebar--collapsed):hover {
    width: 250px;
}

.sidebar--collapsed {
    width: 64px;
}

.sidebar--collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar-toggle-btn {
    height: 32px;
    margin: 8px auto;
    border-radius: 4px;
    width: 32px;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-btn i {
    transition: transform 0.3s ease;
}

.sidebar-section {
    margin-bottom: 1rem;
}

.sidebar-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: none;
}

.sidebar:not(.sidebar--collapsed):hover .sidebar-section-title {
    display: block;
}

.sidebar-item {
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.sidebar:not(.sidebar--collapsed) .sidebar-item {
    justify-content: flex-start;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active {
    background-color: rgba(108, 92, 231, 0.2);
    border-left: 4px solid var(--accent-1);
}

.sidebar-item.active i {
    color: var(--accent-1) !important;
}

.sidebar-item.active span {
    color: var(--accent-1);
    font-weight: 600;
}

.sidebar-item i {
    min-width: 64px;
    text-align: center;
    font-size: 1.25rem;
}

.sidebar:not(.sidebar--collapsed) .sidebar-item i {
    min-width: 80px;
}

.sidebar-item span,
.sidebar-text {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar:not(.sidebar--collapsed):hover .sidebar-item span,
.sidebar:not(.sidebar--collapsed):hover .sidebar-text {
    opacity: 1;
    max-width: 200px;
    margin-left: 0.5rem;
}

.sidebar-header {
    display: none;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.sidebar-footer {
    padding-bottom: 0.5rem;
}

.sidebar-footer nav {
    display: none;
}

.sidebar:not(.sidebar--collapsed):hover .sidebar-footer nav {
    display: flex;
    flex-direction: column;
}

.sidebar-footer h3 {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar:not(.sidebar--collapsed):hover .sidebar-footer h3 {
    opacity: 1;
}

/* Contact button in collapsed mode */
.sidebar--collapsed .contact-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar--collapsed .contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.5);
}

.sidebar--collapsed .contact-btn i {
    margin: 0;
    min-width: auto;
    font-size: 1rem;
}

/* Language selector in collapsed mode */
.sidebar--collapsed .language-selector {
    width: 40px;
    height: 40px;
    margin: 12px auto 0;
    transition: all 0.3s ease;
}

.sidebar--collapsed .language-display {
    justify-content: center;
    padding: 0;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sidebar--collapsed .language-display:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.sidebar--collapsed .language-display i.fa-chevron-down {
    display: none;
}

.sidebar--collapsed .language-display .flex {
    justify-content: center;
}

.sidebar--collapsed .language-display i.fa-globe {
    margin: 0;
    font-size: 1rem;
}

/* Tooltip for collapsed sidebar */
.sidebar--collapsed .sidebar-item:hover::after,
.sidebar--collapsed .contact-btn:hover::after,
.sidebar--collapsed .language-display:hover::after,
.sidebar--collapsed .sidebar-footer a:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    margin-left: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-50%) translateX(-5px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.main-content {
    margin-left: 80px;
    padding: 1rem 1rem;
    transition: all 0.3s ease;
}

.sidebar--collapsed ~ .main-content {
    margin-left: 64px;
}

.mobile-menu-toggle {
    display: none;
    z-index: 40;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover, .mobile-menu-toggle:focus {
    background-color: var(--accent-1);
    outline: none;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 25;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.search-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--accent-1);
}

.search-input {
    background-color: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
}

.game-card {
    background-color: var(--secondary-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.game-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.game-card .title {
    padding: 0.75rem 0.75rem 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.game-card .game-info {
    padding: 0 0.75rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-card .rating {
    color: #fdcb6e;
    letter-spacing: 1px;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem 0;
}

.game-card .category {
    opacity: 0.8;
}

.game-category {
    margin-bottom: 2rem;
}

.game-category h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .game-category h2 {
        font-size: 1.5rem;
    }
}

.game-category h2::after {
    content: '';
    flex-grow: 1;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
}

.category-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding-bottom: 1rem;
}

@media (min-width: 768px) {
    .category-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .category-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .category-row {
        grid-template-columns: repeat(6, 1fr);
    }
}

.featured-slider {
    position: relative;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 2;
}

.slider-control {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-control:hover {
    background-color: var(--accent-1);
}

.slides {
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.badge.new {
    background-color: var(--accent-2);
    color: white;
}

.badge.top {
    background-color: var(--accent-4);
    color: #333;
}

.game-page {
    display: none;
}

.game-page.active {
    display: block;
}

.game-iframe {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: black;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.game-info {
    background-color: var(--secondary-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent-1);
    color: white;
}

.btn-primary:hover {
    background-color: #5a49e0;
}

.btn-outline {
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Game overlay for expanded mode */
.game-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 99;
}

.game-overlay.active {
    display: block;
}

/* Expanded iframe styling */
#gameFrame.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95% !important;
    height: 90vh !important;
    max-height: none !important;
    z-index: 100;
}

/* Toast notification for share feedback */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
}

.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature {
    background-color: var(--secondary-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature i {
    font-size: 1.5rem;
    color: var(--accent-1);
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
        top: 0;
        left: 0;
        box-shadow: none;
    }

    .sidebar.active {
        width: 280px;
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-close {
        color: var(--text-secondary);
        font-size: 1.25rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: all 0.2s ease;
    }

    .sidebar-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .sidebar-section-title {
        display: block;
    }

    .sidebar-item {
        padding: 0.75rem 1.5rem;
    }

    .sidebar-item i {
        min-width: 30px;
        font-size: 1.1rem;
    }

    .sidebar-item span {
        opacity: 1;
        font-size: 0.95rem;
    }

    .sidebar-footer {
        display: block;
        padding: 1rem 0;
    }

    .sidebar-footer h3 {
        opacity: 1;
        margin-left: 1rem;
    }

    .sidebar-footer nav {
        display: flex;
        flex-direction: column;
        padding: 0 1rem;
    }

    /* Ensure bottom controls are visible on mobile */
    .sidebar .mt-auto {
        margin-top: auto;
        padding: 1rem;
    }

    /* Make contact button full width on mobile */
    .sidebar.active .contact-btn {
        width: 100%;
        border-radius: 8px;
        padding: 0.75rem;
        margin: 0;
        justify-content: flex-start;
    }

    .sidebar.active .contact-btn i {
        min-width: 30px;
        margin-right: 0.5rem;
    }

    /* Make language selector full width on mobile */
    .sidebar.active .language-selector {
        width: 100%;
        height: auto;
        margin: 0.75rem 0 0;
    }

    .sidebar.active .language-display {
        width: 100%;
        height: auto;
        border-radius: 8px;
        padding: 0.75rem;
        justify-content: space-between;
    }

    .mobile-menu-toggle {
        display: block;
        margin-right: 0.75rem;
    }

    .sticky-header {
        position: sticky;
        top: 0;
        z-index: 20;
        background-color: var(--primary-bg);
        padding: 0.75rem 1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        margin-left: 0;
        padding: 0 0.75rem 1rem;
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .game-card {
        max-width: none;
    }

    .game-card .title {
        font-size: 0.85rem;
    }

    .game-card .game-info {
        font-size: 0.7rem;
    }

    .game-card .rating {
        font-size: 0.75rem;
    }

    .featured-slider .slide img {
        height: 250px;
    }

    .slide-content h2 {
        font-size: 1.5rem;
    }

    .slide-content p {
        font-size: 0.9rem;
    }

    .search-container {
        width: 100%;
    }
}
