/* Modern CSS Variables & Design Tokens */
:root {
    --bg-dark: #0a0c16;
    --bg-card: rgba(18, 22, 40, 0.75);
    --bg-card-hover: rgba(28, 35, 64, 0.9);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(124, 58, 237, 0.4);
    
    --primary: #7c3aed;
    --primary-glow: rgba(124, 58, 237, 0.5);
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-amber: #f59e0b;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
body.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border-color: rgba(0, 0, 0, 0.08);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dark: #94a3b8;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

/* AD BANNERS STYLING */
.ad-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(236, 72, 153, 0.08));
    border: 1px dashed rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.ad-badge {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-amber);
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.ad-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.ad-728x90 {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

.ad-300x250 {
    width: 100%;
    height: 250px;
    margin-top: 24px;
}

.ad-responsive {
    width: 100%;
    height: 60px;
}

.ad-top-wrapper {
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 22, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* SEARCH BOX */
.search-box {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-box input {
    width: 100%;
    padding: 12px 18px 12px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.clear-search {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--text-muted);
    display: none;
    font-size: 1rem;
}

.clear-search:hover {
    color: var(--text-main);
}

/* NAV ACTIONS */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-highlight);
}

.favorites-btn i {
    color: var(--accent-pink);
}

.badge {
    background: var(--accent-pink);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

/* HERO SECTION */
.hero-section {
    max-width: 1400px;
    margin: 24px auto 0;
    padding: 0 24px;
}

.hero-card {
    position: relative;
    height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.hero-card:hover .hero-bg {
    transform: scale(1.03);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 12, 22, 0.95) 10%, rgba(10, 12, 22, 0.4) 60%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    max-width: 600px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-pink));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-meta i {
    color: var(--accent-amber);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #9333ea);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* MAIN LAYOUT */
.main-layout {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
}

/* CATEGORIES SIDEBAR */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.cat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.cat-item.active {
    background: rgba(124, 58, 237, 0.15);
    color: #fff;
    border-color: var(--border-highlight);
}

.cat-item i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.cat-item.active i {
    color: var(--primary);
}

/* CONTENT AREA */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.current-cat-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
}

.games-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* GAMES GRID */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-highlight);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25);
    background: var(--bg-card-hover);
}

.card-thumb {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .card-thumb img {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}

.badge-hot { background: var(--accent-pink); }
.badge-new { background: var(--accent-cyan); }
.badge-top { background: var(--accent-amber); }

.card-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(10, 12, 22, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.card-fav-btn:hover, .card-fav-btn.active {
    background: var(--accent-pink);
    color: #fff;
}

.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-rating i {
    color: var(--accent-amber);
    margin-right: 3px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.empty-state.hidden {
    display: none;
}

/* GAME MODAL PLAYER */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 13, 0.88);
    backdrop-filter: blur(12px);
}

.modal-container {
    position: relative;
    z-index: 2;
    width: 92%;
    max-width: 980px;
    background: var(--bg-dark);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-wrap h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
}

.modal-game-cat {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

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

.modal-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.modal-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-action-btn.btn-fullscreen {
    background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
    color: #fff;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.modal-action-btn.btn-exit {
    background: linear-gradient(135deg, var(--accent-pink), #ef4444);
    color: #fff;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

.modal-action-btn.btn-exit:hover {
    transform: scale(1.05);
}

/* IFRAME WRAPPER */
.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 540px;
    background: #000;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* FLOATING IN-GAME CONTROL BAR */
.floating-control-bar {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-btn-exit {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(236, 72, 153, 0.9));
}

.floating-btn-exit:hover {
    background: #ef4444;
    transform: translateY(-2px) scale(1.04);
}

.floating-btn-fullscreen {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(6, 182, 212, 0.9));
}

.floating-btn-fullscreen:hover {
    background: var(--primary);
    transform: translateY(-2px) scale(1.04);
}

/* ULTRA WOW PRE-ROLL OVERLAY */
.ad-preroll-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0a0c16 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-preroll-overlay.hidden {
    display: none;
}

.preroll-bg-blur {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(25px) opacity(0.3);
    transform: scale(1.1);
}

.preroll-box {
    position: relative;
    z-index: 5;
    text-align: center;
    background: rgba(18, 22, 40, 0.85);
    backdrop-filter: blur(20px);
    padding: 35px 50px;
    border-radius: 24px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    box-shadow: 0 0 50px rgba(124, 58, 237, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.05);
    max-width: 440px;
    width: 90%;
}

.preroll-game-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 0 25px var(--primary-glow);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 25px var(--primary-glow); }
    50% { transform: scale(1.06); box-shadow: 0 0 40px var(--accent-pink); }
}

.preroll-tag {
    color: var(--accent-amber);
    font-weight: 800;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.15);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.preroll-box h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.preroll-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* PROGRESS BAR STYLING */
.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent-pink), var(--accent-cyan));
    border-radius: 10px;
    transition: width 1s linear;
}

.btn-wow-play {
    background: linear-gradient(135deg, var(--accent-pink), var(--primary));
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 12px 36px;
    border-radius: var(--radius-full);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.btn-wow-play:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-wow-play:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.8);
}

.modal-footer {
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.controls-guide {
    font-size: 0.85rem;
    color: var(--text-main);
}

.controls-guide i {
    color: var(--accent-cyan);
}

/* FOOTER */
.footer {
    margin-top: 80px;
    background: rgba(5, 7, 13, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 40px 24px 20px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 12px;
    max-width: 400px;
}

.footer-info h4 {
    font-family: var(--font-heading);
    color: var(--accent-amber);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deploy-steps {
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.deploy-steps li {
    margin-bottom: 6px;
}

.deploy-steps a {
    color: var(--accent-cyan);
    text-decoration: underline;
}

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

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-categories {
        overflow-x: auto;
    }

    .category-list {
        flex-direction: row;
        white-space: nowrap;
    }

    .ad-300x250 {
        display: none;
    }

    .iframe-wrapper {
        height: 400px;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .search-box {
        display: none;
    }

    .hero-card {
        height: 260px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .iframe-wrapper {
        height: 300px;
    }

    .floating-control-bar {
        top: 8px;
        right: 8px;
    }

    .floating-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}
