/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    font-size: 1.1rem;
}

.clear-search {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Filters Section */
.filters-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.view-btn {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #a0aec0;
}

.view-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.view-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.view-btn.active:hover {
    color: white;
}

.results-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.9rem;
}

/* Games Container */
.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.games-container.list-view {
    grid-template-columns: 1fr;
}

/* Game Card */
.game-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

.game-card.list-view {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.game-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 10px 10px 0 0;
}

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

/* Loading animation for game images */
.game-image img {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fallback icon when image fails to load */
.game-image i {
    font-size: 3rem;
    color: white;
    opacity: 0.8;
}

.game-card.list-view .game-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.game-card.list-view .game-image img {
    border-radius: 10px;
}

.game-info {
    padding: 1.5rem;
}

.game-card.list-view .game-info {
    flex: 1;
    padding: 0;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.game-description {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card.list-view .game-description {
    -webkit-line-clamp: 2;
}

.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.game-card:hover .play-button {
    opacity: 1;
}

/* Loading and No Results */
.loading, .no-results {
    text-align: center;
    padding: 3rem;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    height: calc(100% - 80px);
    padding: 0;
}

.game-frame-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
    text-align: center;
    color: #718096;
}

/* Game Detail Page Styles */
.game-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.game-detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-detail-image {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

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

.game-detail-image:hover img {
    transform: scale(1.05);
}

.game-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.game-detail-description {
    font-size: 1.1rem;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.game-detail-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.game-detail-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.play-game-btn, .back-to-home-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.play-game-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.play-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.back-to-home-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.back-to-home-btn:hover {
    background: #f7fafc;
    border-color: #667eea;
    color: #667eea;
}

.game-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.game-screenshots, .game-info-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-screenshots h3, .game-info-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.screenshots-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.screenshots-grid img:hover {
    transform: scale(1.05);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
}

.info-value {
    color: #718096;
}

/* Fullscreen Game Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.fullscreen-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fullscreen-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

.fullscreen-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.fullscreen-controls {
    display: flex;
    gap: 1rem;
}

.fullscreen-btn, .close-fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover, .close-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-modal-body {
    flex: 1;
    padding: 0;
}

#fullscreenGameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Recommended Games Section */
.recommended-games-section {
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.recommended-games-section h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.recommended-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.recommended-game-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.recommended-game-image {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

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

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

.recommended-game-info {
    padding: 1rem;
}

.recommended-game-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.category-tag.small {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 3rem;
    color: white;
}

.error-container i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.error-container h3 {
    margin-bottom: 0.5rem;
}

/* Responsive Design for Game Detail */
@media (max-width: 768px) {
    .game-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .game-detail-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .game-detail-title {
        font-size: 2rem;
    }
    
    .game-detail-actions {
        justify-content: center;
    }
    
    .game-detail-content {
        grid-template-columns: 1fr;
    }
    
    .recommended-games-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .fullscreen-modal-header {
        padding: 1rem;
    }
    
    .fullscreen-modal-header h2 {
        font-size: 1.2rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-toggle {
        margin-left: 0;
        justify-content: center;
    }
    
    .games-container {
        grid-template-columns: 1fr;
    }
    
    .game-card.list-view {
        flex-direction: column;
        text-align: center;
    }
    
    .game-card.list-view .game-image {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .filters-section {
        padding: 1rem;
    }
    
    .game-info {
        padding: 1rem;
    }
} 