/* --- Variables & Reset --- */
:root {
    --volt: #c1fd5b;
    --bg: #121212;
    --card-bg: #202020;
    --text: #f5f5f5;
    --text-muted: #a1a1a1;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { 
    background-color: var(--bg); 
    color: var(--text); 
    overflow-x: hidden; 
}

/* --- Navbar --- */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; height: 80px; 
    background: rgba(18, 18, 18, 0.95);
    position: sticky; top: 0; z-index: 100; 
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo { 
    font-weight: 900; font-size: 1.2rem; letter-spacing: 1px; 
    margin-right: 20px; cursor: pointer; transition: transform 0.2s ease;
}
.logo:hover { transform: scale(1.05); }
.logo span { color: var(--volt); }

/* --- Search Elements --- */

/* 1. Desktop Search Container */
.search-container { position: relative; width: 300px; }
.search-icon {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%); color: var(--text-muted);
}
.search-container input {
    width: 100%; padding: 12px 15px 12px 45px;
    background: #2a2a2a; border: 1px solid transparent;
    border-radius: 30px; color: white; font-size: 0.9rem;
    transition: all 0.3s ease;
}
.search-container input:focus {
    background: #333; border-color: var(--volt);
    box-shadow: 0 0 10px rgba(193, 253, 91, 0.2); outline: none;
}

/* 2. Mobile Search Trigger Icon (Default Hidden) */
.mobile-search-trigger {
    display: none; /* Hidden on Desktop */
    color: var(--text); cursor: pointer; padding: 10px;
}

/* 3. Mobile Search POP-UP Overlay */
#search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(18, 18, 18, 0.98); 
    backdrop-filter: blur(5px);
    z-index: 200; /* Di atas navbar */
    display: flex; justify-content: center; align-items: flex-start;
    padding-top: 100px;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.search-bar-wrapper {
    position: relative; width: 90%; max-width: 500px;
}
.search-icon-overlay {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    color: var(--volt);
}
#mobile-search-input {
    width: 100%; padding: 20px 50px 20px 55px;
    background: #2a2a2a; border: 2px solid var(--volt);
    border-radius: 50px; color: white; font-size: 1.1rem;
    box-shadow: 0 0 30px rgba(193, 253, 91, 0.15); outline: none;
}
.close-search-btn {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    font-size: 2rem; cursor: pointer; color: #fff; line-height: 1;
}

/* --- Hero & Grid --- */
.hero { padding: 40px 5%; margin-bottom: 20px; }
.hero h1 { font-size: 2.5rem; font-weight: 800; text-transform: uppercase; }
.highlight { color: var(--volt); }

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px; padding: 0 5% 80px;
    perspective: 1000px; 
}

/* --- Card Styling --- */
.card {
    background: var(--card-bg); border-radius: 16px; overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.3s; cursor: pointer;
    border: 1px solid transparent;
    transform-style: preserve-3d;
}
.card:hover { 
    box-shadow: 0 10px 30px rgba(193, 253, 91, 0.15); 
    border-color: var(--volt);
}
.card-image { height: 260px; background-size: cover; background-position: center; }
.card-content { padding: 20px; transform: translateZ(20px); }
.category { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.card h3 { margin: 8px 0; font-size: 1.1rem; }

/* --- Tech Badges --- */
.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 15px 0; }
.tech-badge {
    font-size: 0.7rem; padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444; border-radius: 4px;
    color: var(--text-muted); cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10; 
}
.tech-badge:hover {
    border-color: var(--volt); color: var(--volt);
    background: rgba(193, 253, 91, 0.1); transform: translateY(-2px);
}

/* --- Detail View --- */
.hidden { display: none !important; }

#detail-view {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg); z-index: 50; overflow-y: auto;
    padding: 0 5%; animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.detail-header { padding: 30px 0; display: flex; justify-content: space-between; align-items: center; }
.back-btn {
    background: none; border: none; color: var(--text-muted);
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-weight: 600; font-size: 1rem; transition: color 0.3s;
}
.back-btn:hover { color: var(--volt); }
.mobile-hint { display: none; color: #444; font-size: 0.8rem; text-transform: uppercase; }

.detail-content { display: flex; gap: 40px; margin-top: 10px; align-items: flex-start; padding-bottom: 50px; }

/* Styles untuk Game Preview di Detail */
.game-preview {
    flex: 1.2; height: 400px; background: #333; border-radius: 12px;
    background-size: cover; background-position: center;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    border: 1px solid #333;
    cursor: zoom-in; 
    transition: transform 0.3s ease;
}
.game-preview:hover { transform: scale(1.02); border-color: var(--volt); }

.game-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.game-info h1 { font-size: 2.5rem; margin-bottom: 15px; line-height: 1.1; color: var(--volt); }
.description { color: var(--text-muted); line-height: 1.6; margin-bottom: 30px; font-size: 1rem; }

/* Buttons */
.button-group { display: flex; gap: 15px; margin-top: 20px; }
button { flex: 1; padding: 16px; border-radius: 8px; font-weight: 700; cursor: pointer; border: none; text-transform: uppercase; letter-spacing: 1px; }
.btn-primary { background: var(--volt); color: #000; transition: transform 0.2s; }
.btn-primary:hover { transform: scale(1.02); }
.btn-secondary { background: #333; color: white; transition: background 0.2s; }
.btn-secondary:hover { background: #444; }

/* --- LIGHTBOX (FULLSCREEN IMAGE) --- */
#lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    animation: fadeIn 0.3s ease; cursor: zoom-out;
}
#lightbox img {
    max-width: 90%; max-height: 90%;
    border: 2px solid var(--volt);
    box-shadow: 0 0 50px rgba(193, 253, 91, 0.3);
    border-radius: 8px; object-fit: contain;
}
.close-lightbox {
    position: absolute; top: 30px; right: 40px;
    font-size: 3rem; color: white; cursor: pointer;
    font-weight: bold; transition: color 0.3s;
}
.close-lightbox:hover { color: var(--volt); }

/* --- Warp Effect --- */
.warp-effect {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, var(--volt) 0%, #000 100%);
    z-index: 999; transform: scale(0); opacity: 0; pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.8s ease;
}
.warp-effect.active { transform: scale(4); opacity: 1; pointer-events: all; }

/* --- RESPONSIVE FIX (MOBILE) --- */
@media (max-width: 768px) {
    
    .back-btn {
        display: none !important; 
    }

    /* 2. Layout Detail */
    .detail-content { 
        flex-direction: column; 
        padding-bottom: 80px; 
    }
    
    .detail-header {
        padding: 10px 0;
        justify-content: center; 
        min-height: 40px; 
    }

    .game-preview { 
        width: 100%; 
        height: 300px; 
        flex: none; 
        margin-bottom: 25px; 
    }

    .desktop-search { display: none; }
    .mobile-search-trigger { display: block; }
    
    .mobile-hint { 
        display: block; 
        margin-top: 0; 
        opacity: 0.8; 
        font-size: 0.85rem; 
        text-align: center;
    }
    
    .hero h1 { font-size: 1.8rem; line-height: 1.2; }
    .game-info h1 { font-size: 2rem; }
    .button-group { flex-direction: column; gap: 10px; }
    
    #lightbox img { width: 95%; height: auto; }
}