:root {
    /* Color Variables */
    --primary-color: #3498db;
    --secondary-color: #e74c3c;
    --accent-color: #2ecc71;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-start: #3498db;
    --gradient-end: #8e44ad;
    
    /* Spacing Variables */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Animation Variables */
    --transition-fast: 0.15s;
    --transition-normal: 0.25s;
    --transition-slow: 0.4s;

    /* Game Card Variables */
    --card-width: 160px;
    --card-height: 180px;
    --card-scale: 1.05;
    
    /* Font Variables */
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Open Sans', sans-serif;
}

/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Open+Sans:wght@400;600&display=swap');

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: var(--body-font);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Header styles */
header {
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 2px 10px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

header h1 {
    font-family: var(--heading-font);
    font-weight: 700;
    margin: 0;
    font-size: 1.5rem;
}

header button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color var(--transition-fast);
}

header button:hover, header button:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Category Section */
.category-section {
    margin: 1.5rem 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.category-title {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.category-header a {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.category-header a:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Game Card */
.game-card {
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.game-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.game-image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .game-image {
    transform: scale(1.1);
}

.game-info {
    padding: 1rem;
    flex-grow: a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-family: var(--heading-font);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.8rem;
}

.stars {
    display: flex;
    color: #f39c12;
}

.stars i {
    font-size: 0.8rem;
}

.rating-value {
    color: var(--text-secondary);
    font-weight: 600;
}

.game-plays {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.game-plays span {
    font-weight: 600;
    color: var(--accent-color);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Side Menu */
#sideMenu {
    background: rgba(52, 73, 94, 0.98);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    z-index: 40;
    overflow-y: auto;
}

#menuCategories {
    margin-top: 2rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

#menuCategories a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}

#menuCategories a:hover {
    background: rgba(255, 255, 255, 0.2);
}

#menuCategories a i {
    font-size: 1.2rem;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 25, 34, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    transition: opacity 0.3s;
    padding: 1rem;
}

.search-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.search-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-family: var(--body-font);
}

.search-input::placeholder {
    color: #a0a0a0;
    opacity: 0.8;
}

.search-close-btn {
    background: none;
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 1.5rem;
    color: #777;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-close-btn:hover {
    color: var(--secondary-color);
    background: rgba(0, 0, 0, 0.05);
}

.search-results {
    width: 100%;
    color: white;
    padding-bottom: 2rem;
}

.search-results-title {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
}

.search-results .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.search-results .game-card {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.search-results .game-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.search-results .game-image-container {
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.search-results .game-badge {
    background: var(--accent-color);
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.search-results .game-title {
    color: white;
    font-weight: 600;
}

.search-results .game-plays,
.search-results .rating-value {
    color: rgba(255, 255, 255, 0.8);
}

.search-results .stars {
    color: #f1c40f;
}

.search-results .game-plays span {
    color: #2ecc71;
}

/* Game Info Page */
.game-info-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.game-preview {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.game-details {
    flex: 1;
}

.game-details h1 {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#gameCategory {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

#gameDescription {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

#playButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

#playButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
}

#playButton:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.2);
}

.game-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.rating {
    display: flex;
    align-items: center;
}

.plays {
    font-weight: 500;
    color: var(--text-secondary);
}

.plays span {
    color: var(--accent-color);
    font-weight: 600;
}

/* Footer */
footer {
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    padding: 2rem 0;
    color: white;
    margin-top: 3rem;
    text-align: center;
}

.foot-agreement {
    margin: 1.5rem 0;
}

.foot-agreement a {
    color: white;
    margin: 0 0.75rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

.foot-agreement a:hover {
    opacity: 1;
}

footer p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0.5rem 0;
}

/* Footer Categories */
#footer-categories {
    margin-bottom: 2rem;
}

#footer-categories h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: var(--heading-font);
}

.footer-category-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 800px;
    margin: 0 auto;
}

.footer-category-links a {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.footer-category-links a:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.footer-category-links a i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .footer-category-links {
        gap: 0.5rem;
    }
    
    .footer-category-links a {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Related Games Section */
#relatedGames {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.mt-12 h2 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.mt-12 h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-now {
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateY(10px);
    transition: transform 0.3s;
}

.game-card:hover .play-now {
    transform: translateY(0);
}

.game-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 1;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 1rem;
}

.no-results p {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* Game Controls Section */
.game-controls-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.game-controls-section .section-title {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-controls-section .section-title i {
    color: var(--primary-color);
}

.controls-grid {
    display: grid;
    gap: 1.5rem;
    /* grid-template-columns: 1fr; */
}

.control-card {
    background: var(--background-color);
    border-radius: 12px;
    padding: 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.control-card h3 {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-card h3 i {
    color: var(--primary-color);
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.key-command {
    background: var(--card-background);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    font-weight: 500;
}

.key-action {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.control-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.mobile-tip {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.mobile-tip i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.mobile-tip p {
    font-size: 0.9rem;
    margin: 0;
}

/* Media Queries */
@media (min-width: 768px) {
    .game-info-container {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .game-preview {
        flex: 0 0 40%;
    }
    
    .game-details {
        padding-left: 2rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    /* .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    } */
}

@media (min-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    #relatedGames {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .category-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .category-title {
        font-size: 1rem;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .category-header a {
        flex-shrink: 0;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .game-details h1 {
        font-size: 1.5rem;
    }
    
    #playButton {
        width: 100%;
    }
}

/* About Us Page Styles */
.tech-badge {
    background: var(--background-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: transform var(--transition-fast);
}

.tech-badge:hover {
    transform: translateY(-2px);
}

.tech-badge i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.tech-badge span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--background-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.contact-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.contact-button i {
    font-size: 1.1rem;
}

/* Friend Links Section */
.friend-links {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.friend-links h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    max-width: 600px;
    margin: 0 auto;
}

.links-grid a {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: all var(--transition-fast);
    text-align: center;
}

.links-grid a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
} 