/* =========================================
   Play BekpaGames - Moderní Gaming Design
   ========================================= */

/* CSS Variables */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f2b4d;

    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);

    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #64748b;

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-play {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-bekpa {
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-selector select {
    appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 35px 8px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.lang-selector select:hover {
    border-color: var(--accent-primary);
}

.lang-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, rgba(15, 15, 26, 0.85) 0%, rgba(15, 15, 26, 0.95) 100%),
                url('../images/hero-bg.png') center/cover no-repeat;
    position: relative;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* AdSense Containers */
.ad-container {
    margin: 30px auto;
    text-align: center;
}

.ad-banner {
    min-height: 90px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filters */
.filters {
    padding: 20px 0;
    position: sticky;
    top: 65px;
    background: var(--bg-primary);
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.category-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    min-width: 250px;
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Games Grid */
.main {
    padding: 40px 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Game Card */
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 212, 255, 0.15);
    border-color: var(--accent-primary);
}

.game-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.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.1);
}

.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.play-button {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: var(--transition);
}

.game-card:hover .play-button {
    transform: scale(1);
}

.play-button svg {
    margin-left: 4px;
}

.game-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent-gradient);
    color: white;
    padding: 5px 12px;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
}

.game-card-content {
    padding: 20px;
}

.game-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-card-category {
    background: var(--bg-primary);
    color: var(--accent-primary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.game-card-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* About Section */
.about {
    padding: 80px 0;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.92) 0%, rgba(26, 26, 46, 0.95) 100%),
                url('../images/about-bg.png') center/cover no-repeat;
    position: relative;
}

.about h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
}

.about > .container > p {
    text-align: center;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

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

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo-play,
.footer-brand .logo-bekpa {
    font-size: 1.3rem;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 10px;
}

.footer-links h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 0;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 5px 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
}

.modal-body {
    padding: 20px;
}

.game-frame-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.game-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-fullscreen {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

.btn-fullscreen:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .filter-row {
        flex-direction: column;
    }

    .categories {
        justify-content: center;
    }

    .search-box {
        width: 100%;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .hero {
        padding: 40px 0 30px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}
