/* Educational Games CSS */
.games-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Points Counter Area */
.points-counter-area {
    background-color: white !important;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.points-counter-area h3 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-primary);
    font-weight: 600;
}

.points-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.games-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.games-title {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--primary-color), #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.games-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Filters */
.games-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

/* Hide mobile-specific elements on desktop */
.filter-header {
    display: none;
}

.filter-content {
    display: contents;
}

.filter-group {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.filter-button {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-button:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.filter-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.search-box {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    width: 100%;
    max-width: 300px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    width: 100%;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Game Cards Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.game-card {
    background-color: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-card-image {
    width: 100%;
    height: 160px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .game-card-image img {
    transform: scale(1.05);
}

.game-card-icon {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.game-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: 10;
}

.badge-new {
    background-color: #e74c3c;
    color: white;
}

.badge-featured {
    background-color: #f39c12;
    color: white;
}

.game-card-content {
    padding: var(--spacing-md);
}

.game-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.game-card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.game-tag {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
    font-weight: 600;
}

.difficulty-tag {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.difficulty-easy {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.difficulty-medium {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.difficulty-hard {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.przedmiot-tag {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.przedmiot-angielski {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.przedmiot-polski {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.przedmiot-matematyka {
    background-color: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.progress-wrapper {
    margin-top: var(--spacing-sm);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Empty state styling */
.empty-game-card {
    background-color: white;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    cursor: default;
}

.empty-game-card:hover {
    transform: none;
}

.empty-game-icon {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: var(--spacing-sm);
}

.empty-game-text {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* Back Button Styles */
.back-button {
    position: fixed;
    top: 110px;
    left: 20px;
    z-index: 1000;
    background-color: white;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    box-shadow: none;
}

.back-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-button i {
    font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .games-filters {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        background: transparent;
        border-radius: 0;
        padding: var(--spacing-md);
        box-shadow: none;
        margin-bottom: var(--spacing-md);
        overflow: hidden;
    }
    
    /* Show filter header on mobile */
    .filter-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        padding: 0;
        background: none;
        border: none;
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 0;
    }
    
    .filter-header i {
        transition: transform 0.3s ease;
        color: var(--text-secondary);
        font-size: 1.2rem;
    }
    
    .filter-header.expanded i {
        transform: rotate(180deg);
    }
    
    /* Override global focus styles for filter header */
    .filter-header:focus-visible {
        outline: none;
    }
    
    /* Prevent blue color on click and focus */
    .filter-header:focus {
        outline: none;
        background: none;
        color: var(--text-secondary);
        border: none;
        box-shadow: none;
    }
    
    .filter-header:active {
        background: none;
        color: var(--text-secondary);
        transform: none;
        border: none;
        box-shadow: none;
    }
    
    .filter-header:hover {
        background: none;
        color: var(--text-secondary);
        border: none;
        box-shadow: none;
    }
    
    /* Filter content container - collapsed by default */
    .filter-content {
        display: block !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding-top: 0;
    }
    
    .filter-content.expanded {
        max-height: 500px;
        padding-top: var(--spacing-md);
    }
    
    .filter-group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: var(--spacing-xs);
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
    
    .filter-group:last-child {
        margin-bottom: 0;
    }
    
    .filter-button {
        padding: 12px 8px;
        font-size: 0.9rem;
        border-radius: var(--radius-md);
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .filter-button:active {
        transform: scale(0.95);
    }
    
    .filter-button.active {
        box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
        transform: translateY(-1px);
    }
    
    /* Search box always visible */
    .search-box {
        max-width: 100%;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        min-height: 48px;
        margin-bottom: var(--spacing-sm);
    }
    
    .search-box input {
        font-size: 1rem;
        padding: 0;
    }
    

    
    /* Active filter indicators */
    .active-filters {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
        border-top: 1px solid var(--border-color);
    }
    
    .active-filter-tag {
        background: var(--primary-color);
        color: white;
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        font-size: 0.8rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .active-filter-tag .remove-filter {
        cursor: pointer;
        font-size: 0.9rem;
        opacity: 0.8;
    }
    
    .active-filter-tag .remove-filter:hover {
        opacity: 1;
    }
    
    .games-title {
        font-size: 2.5rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .back-button {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .games-filters {
        padding: var(--spacing-sm);
        margin: 0 calc(-1 * var(--spacing-sm)) var(--spacing-md) calc(-1 * var(--spacing-sm));
        border-radius: 0;
        box-shadow: none;
    }
    
    .filter-group {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    .filter-button {
        padding: 14px 6px;
        font-size: 0.85rem;
        min-height: 48px;
    }
    
    .search-box {
        min-height: 52px;
        padding: 14px 16px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .games-title {
        font-size: 2rem;
    }
    
    .games-subtitle {
        font-size: 1rem;
    }
    
    .games-container {
        padding: var(--spacing-md);
    }
}

 