/* Simulations Page Specific Styles */

/**
 * CSS Variables for Simulation Components
 * Using a component-based approach with BEM methodology
 * Block: game-card, game-image, etc.
 * Element: game-card__title, game-card__image, etc.
 * Modifier: game-card--featured, game-card--active, etc.
 */
:root {
    /* Colors */
    --game-card-bg: var(--bg-dark);
    --game-card-border: rgba(255, 255, 255, 0.12);
    --game-card-shadow: rgba(0, 0, 0, 0.12);
    --game-card-hover-shadow: rgba(0, 0, 0, 0.15);
    --game-image-filter-brightness: 0.9;
    --game-image-filter-saturation: 1.2;
    
    /* Sizes */
    --game-card-border-radius: 16px;
    --game-image-height: 220px;
    
    /* Animations */
    --card-transition-speed: 0.4s;
    --card-hover-scale: 1.02;
    
    /* Accessibility */
    --min-contrast-ratio: 4.5;
}

.simulations-hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, rgba(12, 25, 30, 0.95) 100%);
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-out;
}

.simulations-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(237, 108, 58, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(62, 188, 232, 0.1) 0%, transparent 50%);
    opacity: 0.8;
    z-index: 0;
}

.simulations-hero .container {
    position: relative;
    z-index: 1;
}

.simulations-hero h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    animation: fadeIn 1.2s ease-out;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.simulations-hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 24px;
    animation: fadeIn 1.4s ease-out;
    line-height: 1.6;
}

/* Search Bar */
.simulation-search {
    position: relative;
    max-width: 800px;
    margin: 0 auto 20px;
    animation: fadeIn 1.6s ease-out;
}

.simulation-search i {
    position: absolute;
    left: calc(50% - 250px + 18px);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    font-size: 1.1rem;
    z-index: 1;
}

.simulation-search input {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: block;
    padding: 14px 20px 14px 45px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Advanced Filter System */
.advanced-filters {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-lighter);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(-20px);
    z-index: 10;
    position: relative;
}

.advanced-filters.active {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 20px;
    padding: 20px;
}

.filter-toggle {
    background-color: var(--bg-lighter);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px auto 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

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

.filter-toggle.active i {
    transform: rotate(180deg);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1 1 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 15px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--bg-dark);
    color: var(--text-light);
    outline: none;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(237, 108, 58, 0.2);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-filters {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.apply-filters:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.reset-filters {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reset-filters:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.simulation-search input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.simulation-search input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(237, 108, 58, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

.simulation-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    font-size: 1.1rem;
}

.simulation-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    animation: fadeIn 1.8s ease-out;
    position: relative;
    z-index: 5;
    min-height: 40px;
    padding: 5px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.category-btn,
.simulation-categories .category-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
    backdrop-filter: blur(10px);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    justify-content: center;
}

.category-btn::before,
.simulation-categories .category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--category-hover-color);
    transition: all 0.4s ease;
    z-index: -1;
}

.category-btn:hover::before,
.category-btn.active::before,
.simulation-categories .category-btn:hover::before,
.simulation-categories .category-btn.active::before {
    left: 0;
}

.category-btn:hover,
.category-btn.active,
.simulation-categories .category-btn:hover,
.simulation-categories .category-btn.active {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(237, 108, 58, 0.4);
}

/* Add support for category count badges */
.category-btn .category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.category-btn:hover .category-count,
.category-btn.active .category-count {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Add support for subcategory indicators */
.category-btn .subcategory-indicator {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.category-btn:hover .subcategory-indicator,
.category-btn.active .subcategory-indicator {
    transform: rotate(180deg);
}

.games-container {
    padding: 80px 0;
    position: relative;
    background-color: var(--bg-dark);
    /* Improved container for better scalability */
    min-height: 50vh;
    display: flex;
    flex-direction: column;
}

.games-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/pattern-dot.png');
    opacity: 0.05;
    z-index: 0;
}

.games-grid {
    display: grid;
    /* Fixed grid with exactly 3 columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 50px;
    position: relative;
    z-index: 1;
    /* Better support for dynamic content loading */
    min-height: 200px;
    transition: all 0.5s ease-in-out;
    justify-items: stretch;
    width: 100%;
}

/* Responsive adjustments for smaller screens */
@media screen and (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 576px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background-color: var(--game-card-bg);
    border-radius: var(--game-card-border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px var(--game-card-shadow);
    border: 1px solid var(--game-card-border);
    transition: all 0.25s ease;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
    animation-delay: calc(var(--card-index, 0) * 0.1s);
    cursor: pointer;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    will-change: transform, box-shadow;
    outline: none;
    --card-accent-color: var(--primary-color);
    /* Simplified card design */
    max-width: 100%;
    margin: 0;
    text-align: left;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card:hover, .game-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px var(--game-card-hover-shadow);
    z-index: 2;
    border-color: rgba(255, 255, 255, 0.25);
}

.game-card.preview-active {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    border-color: rgba(237, 108, 58, 0.3);
}

.game-image {
    /* Use 16:9 aspect ratio similar to PhET thumbnails */
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    border-bottom: 3px solid rgba(var(--card-accent-color, 237, 108, 58), 0.2);
    contain: paint;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Lazy loading image styles */
.mobile-device .game-image {
    opacity: 0;
    transform: translateY(10px);
}

.mobile-device .game-image.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Placeholder for images while loading */
.mobile-device .game-image-container {
    position: relative;
    background: linear-gradient(to bottom right, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.2));
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.mobile-device .game-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.game-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2), transparent);
    opacity: 0.8;
    transition: opacity 0.3s ease, height 0.3s ease;
    z-index: 1;
}

.game-card:hover .game-image::after {
    opacity: 0.9;
    height: 80%;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--card-transition-speed) ease, filter var(--card-transition-speed) ease;
    filter: brightness(var(--game-image-filter-brightness)) saturate(var(--game-image-filter-saturation));
}

.game-card:hover .game-image img, .game-card:focus .game-image img {
    transform: scale(1.08);
    filter: brightness(calc(var(--game-image-filter-brightness) + 0.15)) saturate(calc(var(--game-image-filter-saturation) + 0.1));
}

.game-difficulty {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 3px 10px var(--game-card-shadow);
    transform: translateY(0);
    transition: all var(--card-transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    /* Improve accessibility */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

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

.difficulty-beginner {
    background-color: rgba(76, 175, 80, 0.85);
    border-left: 3px solid rgba(46, 125, 50, 0.9);
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.25);
}

.difficulty-intermediate {
    background-color: rgba(255, 152, 0, 0.85);
    border-left: 3px solid rgba(230, 81, 0, 0.9);
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.25);
}

.difficulty-advanced {
    background-color: rgba(244, 67, 54, 0.85);
    border-left: 3px solid rgba(183, 28, 28, 0.9);
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.25);
}

/* Enhanced Game Classification System */
/* Removed game-tags section to simplify the design */

/* Subject-specific tag colors with reduced intensity */
.tag-math {
    background-color: rgba(64, 196, 255, 0.15);
    color: rgba(64, 196, 255, 0.9);
}

.tag-science {
    background-color: rgba(46, 204, 113, 0.15);
    color: rgba(46, 204, 113, 0.9);
}

.tag-language {
    background-color: rgba(155, 89, 182, 0.15);
    color: rgba(155, 89, 182, 0.9);
}

.tag-history {
    background-color: rgba(230, 126, 34, 0.15);
    color: rgba(230, 126, 34, 0.9);
}

/* Game type tag colors with reduced intensity */
.tag-puzzle {
    background-color: rgba(241, 196, 15, 0.15);
    color: rgba(241, 196, 15, 0.9);
}

.tag-quiz {
    background-color: rgba(231, 76, 60, 0.15);
    color: rgba(231, 76, 60, 0.9);
}

.tag-adventure {
    background-color: rgba(52, 152, 219, 0.15);
    color: rgba(52, 152, 219, 0.9);
}

/* Level tag colors with reduced intensity */
.tag-level-1 {
    background-color: rgba(46, 204, 113, 0.15);
    color: rgba(46, 204, 113, 0.9);
}

.tag-level-2 {
    background-color: rgba(241, 196, 15, 0.15);
    color: rgba(241, 196, 15, 0.9);
}

.tag-level-3 {
    background-color: rgba(231, 76, 60, 0.15);
    color: rgba(231, 76, 60, 0.9);
}

.game-card:hover .game-tag {
    background-color: rgba(255, 255, 255, 0.12);
}

.game-tag i {
    margin-right: 4px;
    font-size: 0.8rem;
}

/* Subject-specific tags */
.tag-physics {
    background-color: rgba(62, 188, 232, 0.2);
    color: #3EBCE8;
}

.tag-chemistry {
    background-color: rgba(106, 76, 147, 0.2);
    color: #6A4C93;
}

.tag-biology {
    background-color: rgba(80, 200, 120, 0.2);
    color: #50C878;
}

.tag-math {
    background-color: rgba(255, 183, 77, 0.2);
    color: #FFB74D;
}

.tag-astronomy {
    background-color: rgba(121, 80, 242, 0.2);
    color: #7950F2;
}

/* Game type tags */
.tag-quiz {
    background-color: rgba(237, 108, 58, 0.2);
    color: #ED6C3A;
}

.tag-simulation {
    background-color: rgba(0, 150, 136, 0.2);
    color: #009688;
}

.tag-puzzle {
    background-color: rgba(233, 30, 99, 0.2);
    color: #E91E63;
}

.tag-experiment {
    background-color: rgba(156, 39, 176, 0.2);
    color: #9C27B0;
}

.tag-interactive {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

/* Level tags */
.tag-level-1 {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.tag-level-2 {
    background-color: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.tag-level-3 {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.game-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    animation: pulse 2s infinite;
    box-shadow: 0 3px 10px rgba(237, 108, 58, 0.4);
    transform: translateY(0) rotate(0);
    transition: all 0.3s ease;
}

.game-card:hover .game-badge {
    transform: translateY(-3px) rotate(-3deg);
    box-shadow: 0 5px 15px rgba(237, 108, 58, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(237, 108, 58, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(237, 108, 58, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(237, 108, 58, 0);
    }
}

/* Game Preview Styles */
.game-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    overflow: auto;
    backdrop-filter: blur(5px);
    transform: scale(0.95);
}

/* View Toggle System */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-bottom: 20px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-lighter);
    color: var(--text-light);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.view-toggle-btn:hover,
.view-toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* List View Styles */
.games-list {
    display: none;
    flex-direction: column;
    gap: 20px;
    margin-top: 50px;
    position: relative;
    z-index: 1;
}

.games-container.list-view .games-grid {
    display: none;
}

.games-container.list-view .games-list {
    display: flex;
}

.game-list-item {
    display: flex;
    background-color: var(--bg-lighter);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
    animation-delay: calc(var(--card-index, 0) * 0.1s);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 180px;
}

.game-list-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    z-index: 2;
    border-color: rgba(var(--card-accent-color, 237, 108, 58), 0.2);
}

.game-list-image {
    flex: 0 0 180px;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.game-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-list-item:hover .game-list-image img {
    transform: scale(1.1);
}

.game-list-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.game-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.game-list-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.game-list-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-lighter);
}

.game-list-description {
    color: var(--text-lighter);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

.game-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.preview-active .game-preview {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.preview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    z-index: 11;
}

.preview-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.game-preview h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    position: relative;
    padding-bottom: 15px;
}

.game-preview h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.game-preview p {
    color: var(--text-lighter);
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.preview-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.preview-features span {
    display: flex;
    align-items: center;
    color: var(--text-lighter);
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}

.preview-features span:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.preview-features i {
    color: var(--primary-color);
    margin-right: 12px;
    font-size: 1.1rem;
}

.game-content {
    padding: 0.5rem 0.7rem 0.7rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    z-index: 2;
    background-color: var(--bg-lighter);
}

.game-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 3px;
    margin-top: 0;
    color: var(--text-color);
    position: relative;
    padding-bottom: 0;
    line-height: 1.1;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.title-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.game-title::after { content: none; }

.game-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Game stats section removed */

.game-meta {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 6px;
    padding-bottom: 0;
    margin-bottom: 0;
    gap: 6px;
}

.game-subject {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-color);
    font-weight: 600;
    background-color: rgba(var(--primary-rgb), 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.1px;
}

.game-subject:hover {
    background: rgba(var(--primary-rgb), 0.15);
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(var(--primary-rgb), 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* Grade level styles */
.game-level {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-color);
    font-weight: 600;
    background-color: rgba(var(--secondary-rgb), 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    margin-bottom: 0;
}

.game-level:hover {
    background: rgba(var(--secondary-rgb), 0.15);
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(var(--secondary-rgb), 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.game-subject i {
    margin-right: 0.3rem;
    font-size: 0.9rem;
    color: rgba(var(--primary-rgb), 0.8);
}

.game-card:hover .game-meta {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.game-play-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-top: 0;
}

.game-play-btn:hover {
    transform: scale(1.1);
    background-color: var(--secondary-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.game-play-btn i {
    font-size: 1.2rem;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.4s ease;
}

.play-btn i {
    margin-left: 10px;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.play-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 10px 25px rgba(237, 108, 58, 0.5);
    color: white;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn:hover i {
    transform: translateX(5px);
}

/* Game Loading System */
.game-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.game-card.loading .game-loading {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
}

.loading-progress {
    width: 80%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
}

.loading-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-status {
    margin-top: 10px;
    color: var(--text-lighter);
    font-size: 0.85rem;
    text-align: center;
}

/* Game Error State */
.game-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.game-card.error .game-error {
    opacity: 1;
    visibility: visible;
}

.error-icon {
    color: #F44336;
    font-size: 3rem;
    margin-bottom: 15px;
}

.error-title {
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.error-message {
    color: var(--text-lighter);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.retry-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.retry-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Featured Games Section */
.featured-games {
    padding: 80px 0;
    background-color: var(--bg-darker);
    position: relative;
    overflow: hidden;
}

/* Simulations Grid */
.load-more-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 32px;
    padding: 0 16px;
    position: relative;
    z-index: 5;
    justify-items: stretch;
}

.load-more-container .game-card {
    margin-bottom: 0;
    height: auto;
}

.load-more-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    backdrop-filter: blur(10px);
    grid-column: 1 / -1;
    margin: 20px auto 0;
    max-width: 250px;
}



.load-more-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(237, 108, 58, 0.4);
}

.load-more-btn i {
    transition: transform 0.3s ease;
}

.load-more-btn:hover i {
    transform: translateY(3px);
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.load-more-btn.all-loaded {
    background-color: var(--bg-dark);
    color: var(--text-lighter);
    cursor: not-allowed;
}

.load-more-btn.all-loaded:hover {
    transform: none;
    box-shadow: none;
}

.load-more-btn.all-loaded::before {
    display: none;
}

.featured-games::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/pattern-dot.png') repeat;
    opacity: 0.05;
    z-index: 0;
}

.featured-games::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: radial-gradient(circle, rgba(237, 108, 58, 0.1) 0%, rgba(237, 108, 58, 0) 70%);
    z-index: 0;
}

.featured-games .section-title {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.featured-games .section-subtitle {
    position: relative;
    z-index: 1;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.featured-games .container {
    position: relative;
    z-index: 1;
}

.featured-game {
    display: flex;
    align-items: stretch;
    background-color: var(--bg-lighter);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.featured-game:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.featured-game-image {
    flex: 0 0 40%;
    height: 350px;
    overflow: hidden;
    position: relative;
    transition: all 0.5s ease;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
}

.featured-game:nth-child(even) .featured-game-image {
    order: 2;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
}

.featured-games::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

.featured-game-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.1) 0%, rgba(12, 25, 30, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-game:hover .featured-game-image::after {
    opacity: 1;
}

.featured-game:nth-child(even) .featured-game-image::after {
    background: linear-gradient(to left, rgba(0,0,0,0.1) 0%, rgba(12, 25, 30, 0.6) 100%);
}

.featured-game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.9);
}

.featured-game:hover .featured-game-image img {
    transform: scale(1.05);
    filter: brightness(1);
}

.featured-game-content {
    flex: 0 0 60%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-game-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 15px;
}

.featured-game-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.featured-game-description {
    color: var(--text-lighter);
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 90%;
}

.featured-game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--primary-color);
}

.meta-item {
    display: flex;
    align-items: center;
    color: var(--text-lighter);
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.meta-item:hover {
    transform: translateY(-3px);
}

.meta-item i {
    margin-right: 8px;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.featured-play-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 14px 30px;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(237, 108, 58, 0.2);
    z-index: 1;
    align-self: flex-start;
}

.featured-play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--primary-dark);
    transition: all 0.3s ease;
    z-index: -1;
}

.featured-play-btn i {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.featured-play-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(237, 108, 58, 0.4);
}

.featured-play-btn:hover::before {
    left: 0;
}

.featured-play-btn:hover i {
    transform: translateX(5px);
}

/* Testimonials Section */
.testimonials {
    padding: 80px 0;
    background-color: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.testimonials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://ext.same-assets.com/1390073496/hero-pattern.png') no-repeat;
    background-size: cover;
    opacity: 0.03;
    z-index: 0;
}

.testimonial-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.testimonial-slide {
    background-color: var(--bg-lighter);
    border-radius: var(--border-radius-md);
    padding: 30px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(50px);
    cursor: pointer;
    overflow: hidden;
}

.testimonial-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(237, 108, 58, 0.05), rgba(62, 188, 232, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-slide:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-slide:hover::before {
    opacity: 1;
}

.testimonial-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

.testimonial-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 20px;
}

.nav-arrow {
    background-color: var(--bg-lighter);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.nav-arrow:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-arrow i {
    font-size: 1.2rem;
}

.nav-indicators {
    display: flex;
    gap: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-lighter);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Responsive adjustments */
@media screen and (max-width: 992px) {
    .games-hero h1 {
        font-size: 2.8rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .featured-game {
        flex-direction: column;
    }
    
    .featured-game-image,
    .featured-game-content {
        flex: 0 0 100%;
    }
    
    .featured-game-image {
        height: 250px;
    }
    
    .game-search {
        max-width: 80%;
    }
    
    .game-categories {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .category-btn {
        margin-bottom: 10px;
    }
}

@media screen and (max-width: 768px) {
    /* Header and Navigation */
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--bg-dark);
        z-index: 999;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        padding-top: 70px;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .main-nav ul li {
        margin: 15px 0;
        width: 100%;
        text-align: center;
    }
    
    .main-nav ul li a {
        display: block;
        padding: 10px 0;
        font-size: 1.1rem;
    }
    
    .social-icons {
        margin-left: 0;
        position: absolute;
        bottom: 30px;
        width: 100%;
        text-align: center;
    }
    
    /* Hero Section */
    .games-hero h1 {
        font-size: 2.5rem;
    }
    
    .games-hero p {
        font-size: 1.1rem;
        padding: 0 15px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        padding: 0 10px;
    }
    
    .game-search input {
        padding: 12px 20px 12px 45px;
    }
    
    .game-search i {
        font-size: 1rem;
    }
    
    .testimonial-slide {
        padding: 25px;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination-btn {
        width: 35px;
        height: 35px;
    }
    
    .pagination-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        order: 2;
    }
    
    .pagination-size-selector {
        margin-top: 10px;
    }
}

@media screen and (max-width: 576px) {
    /* Header and Navigation */
    .logo span {
        font-size: 1.2rem;
    }
    
    .logo img {
        width: 30px;
        height: 30px;
    }
    
    .mobile-menu-toggle {
        font-size: 1.3rem;
    }
    
    .main-nav {
        width: 80%;
    }
    
    /* Hero Section */
    .games-hero {
        padding: 60px 0;
    }
    
    .games-hero h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .games-hero p {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 20px;
    }
    
    /* Game Grid and Cards */
    .games-grid {
        grid-template-columns: 1fr;
        margin-top: 30px;
    }
    
    .game-search {
        max-width: 90%;
        margin-bottom: 20px;
    }
    
    /* Category Buttons */
    .game-categories {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-top: 20px;
        padding: 0 10px;
    }
    
    .category-btn {
        width: auto;
        padding: 8px 15px;
        font-size: 0.9rem;
        margin-bottom: 5px;
        border-radius: 20px;
    }
    
    /* Game Cards */
    .game-card {
        box-shadow: var(--shadow-sm);
        transition: all 0.3s ease;
    }
    
    .game-card:hover {
        transform: translateY(-5px);
    }
    
    .game-image {
        height: 180px;
    }
    
    .game-content {
        padding: 15px;
    }
    
    /* Testimonials */
    .testimonial-content p {
        font-size: 1rem;
    }
    
    .testimonial-slide {
        padding: 20px;
    }
    
    /* Featured Games */
    .featured-game {
        margin-bottom: 20px;
    }
    
    .featured-game-title {
        font-size: 1.5rem;
    }
    
    .featured-game-content {
        padding: 20px;
    }
    
    .featured-game-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Pagination */
    .pagination-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 30px;
        padding: 15px 0;
    }
    
    /* Touch-friendly improvements */
    .play-btn, .category-btn, .pagination-btn, .nav-arrow {
        min-height: 44px; /* Minimum touch target size */
        min-width: 44px;
    }
}

@media screen and (max-width: 480px) {
    /* Header and Navigation */
    header .container {
        padding: 10px 15px;
    }
    
    .logo span {
        font-size: 1.1rem;
    }
    
    .logo img {
        width: 25px;
        height: 25px;
        margin-right: 5px;
    }
    
    /* Hero Section */
    .games-hero {
        padding: 50px 0 30px;
    }
    
    .games-hero h1 {
        font-size: 1.8rem;
        padding: 0 10px;
    }
    
    .games-hero p {
        font-size: 0.95rem;
        padding: 0 15px;
        line-height: 1.4;
    }
    
    /* Search and Filters */
    .game-search {
        max-width: 95%;
    }
    
    .game-search input {
        padding: 10px 15px 10px 40px;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    
    .game-search i {
        left: 15px;
        font-size: 0.9rem;
    }
    
    .game-categories {
        padding: 0 5px;
        gap: 6px;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        border-radius: 15px;
    }
    
    /* Game Cards */
    .game-card {
        margin: 0 10px 15px;
        border-radius: 14px;
    }
    
    .game-image {
        height: 170px;
    }
    
    .game-title {
        font-size: 1.02rem;
        margin-bottom: 8px;
    }
    
    .game-description {
        font-size: 0.92rem;
        margin-bottom: 10px;
        -webkit-line-clamp: 3; /* Limit to 3 lines on mobile */
        line-height: 1.4;
    }
    
    .game-stats {
        margin-bottom: 10px;
    }
    
    .game-meta {
        padding-top: 12px;
        margin-top: 10px;
        gap: 6px;
    }
    
    .play-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* Testimonials */
    .testimonials {
        padding: 50px 0;
    }
    
    .testimonial-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .testimonial-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .testimonial-rating {
        margin-top: 5px;
    }
    
    .nav-arrow {
        width: 35px;
        height: 35px;
    }
    
    /* Pagination */
    .pagination-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .pagination-size-selector {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .pagination-size-selector label {
        font-size: 0.8rem;
    }
    
    .pagination-size-selector select {
        padding: 6px 10px;
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
    }
    
    /* Featured Games */
    .featured-games {
        padding: 50px 0;
    }
    
    .featured-game-image {
        height: 180px;
    }
    
    .featured-game-description {
        -webkit-line-clamp: 3; /* Limit to 3 lines on mobile */
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        line-height: 1.4;
    }
    
    /* Footer */
    footer .container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* Results Info */
.results-info {
    text-align: center;
    margin: 30px 0 20px;
    color: var(--text-lighter);
    font-size: 0.95rem;
}

/* Enhanced Mobile Responsiveness */
@media screen and (max-width: 992px) {
    .simulations-hero h1 {
        font-size: 2.2rem;
    }
    
    .load-more-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .simulation-search {
        max-width: 90%;
    }
}

@media screen and (max-width: 768px) {
    .simulations-hero {
        padding: 50px 0 30px;
    }
    
    .simulations-hero h1 {
        font-size: 2rem;
        margin-bottom: 12px;
    }
    
    .simulations-hero p {
        font-size: 1rem;
        margin-bottom: 20px;
        padding: 0 20px;
    }
    
    .simulation-search {
        max-width: 90%;
        margin-bottom: 20px;
    }
    
    .simulation-categories {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding: 0 20px 10px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .simulation-categories::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .load-more-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 20px;
    }
    
    #load-more-btn {
        grid-column: 1 / -1;
        margin: 20px auto 0;
        padding: 14px 24px;
        border-radius: 25px;
        font-weight: 600;
    }
}

@media screen and (max-width: 576px) {
    .simulations-hero h1 {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
    
    .simulations-hero p {
        font-size: 1rem;
        margin-bottom: 20px;
        padding: 0 15px;
    }
    
    .load-more-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 15px;
    }
    
    .simulation-search {
        max-width: 95%;
    }
    
    .simulation-search input {
        padding: 12px 16px 12px 40px;
        font-size: 0.95rem;
    }
    
    .simulation-search i {
        left: 18px;
    }
    
    .simulation-categories {
        gap: 8px;
        margin-top: 20px;
        padding: 0 15px;
    }
    
    .category-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .simulations-hero {
        padding: 40px 0 25px;
    }
    
    .simulations-hero h1 {
        font-size: 1.6rem;
        padding: 0 10px;
    }
    
    .simulations-hero p {
        font-size: 0.95rem;
        padding: 0 15px;
    }
    
    .simulation-search {
        max-width: 95%;
    }
    
    .simulation-search input {
        padding: 12px 16px 12px 40px;
        font-size: 0.9rem;
    }
    
    .simulation-search i {
        left: 18px;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .load-more-container {
        padding: 0 15px;
    }
}

/* Mobile Touch Styles */
.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Clear search button */
.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
}

.clear-search-btn:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

/* Mobile-specific styles */
.mobile-device .clear-search-btn {
    width: 44px;
    height: 44px;
    right: 10px;
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* Optimize for mobile devices */
.mobile-device .game-card,
.mobile-device .featured-game,
.mobile-device .testimonial-slide {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Reduce animation complexity on mobile */
.mobile-device .game-card:hover {
    transform: translateY(-5px);
}

.mobile-device .game-image-container:hover .game-image {
    transform: scale(1.05);
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    z-index: 1000;
}

/* Pagination System for Games */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 5;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-lighter);
    color: var(--text-light);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination-btn:hover,
.pagination-btn.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.pagination-size-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-size-selector label {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.pagination-size-selector select {
    background-color: var(--bg-lighter);
    color: var(--text-light);
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove default styling on iOS */
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    min-height: 44px; /* Minimum touch target size */
}

.pagination-size-selector select:hover {
    background-color: var(--bg-light);
}