/* ====================================================== */
/* MODIFIKASI CSS OLEH GEMINI (VIBRANT THEME)      */
/* ====================================================== */

/* =================================
   1. GLOBAL & ROOT VARIABLES (PALET WARNA BARU)
   ================================= */

:root {
    --primary-color: #9D4EDD;      /* Ungu Elektrik */
    --secondary-color: #FCA311;    /* Aksen Emas/Oranye */
    --dark-bg: #1A1625;            /* Latar Belakang Gelap (Nuansa Ungu) */
    --light-bg: #2C2A3A;           /* Latar Belakang Elemen (Abu-abu Ungu) */
    --text-primary: #F5F5F5;       /* Putih Gading (Lebih lembut dari putih murni) */
    --text-secondary: #B4ADCF;     /* Abu-abu Lavender */
    --border-color: #4A465B;       /* Warna Border */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Gradien latar belakang baru yang lebih halus */
    background: linear-gradient(160deg, #1A1625 0%, #211D30 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    text-align: center;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 0px 0;
    background-color: transparent;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: none; /* Dihapus underline agar lebih modern */
}

/* =================================
   2. TYPOGRAPHY (DENGAN EFEK GLOW)
   ================================= */

h1 {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    font-weight: 800;
    margin: 20px 0 15px 0;
    text-shadow: 0 0 20px rgba(157, 78, 221, 0.4); /* Efek glow ungu */
}

h2 {
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    margin-bottom: 50px;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.3); /* Efek glow ungu halus */
}

p {
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ====================================================== */
/* 2. HEADER & NAVIGASI (MOBILE-FRIENDLY) */
/* ====================================================== */
header {
    padding: 15px 0;
    background-color: rgba(26, 22, 37, 0.85); /* Warna header baru */
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color); /* Garis bawah halus */
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo a { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-primary); text-decoration: none; }
.nav-menu { display: none; }
@media (min-width: 992px) { .nav-menu { display: flex; } }
.nav-menu a { color: var(--text-primary); margin-left: 25px; font-weight: 600; transition: color 0.3s ease; }
.nav-menu a:hover { color: var(--primary-color); }
.hamburger-menu { display: block; cursor: pointer; z-index: 1001; width: 30px; height: 30px; }
@media (min-width: 992px) { .hamburger-menu { display: none; } }
.mobile-nav-overlay { height: 100%; width: 0; position: fixed; z-index: 1002; top: 0; left: 0; background-color: rgba(26, 22, 37, 0.98); overflow-x: hidden; transition: 0.3s ease-in-out; backdrop-filter: blur(10px); }
.mobile-nav-content { position: relative; top: 2%; width: 100%; text-align: center; margin-top: 10px; }
.mobile-nav-content a { padding: 15px; text-decoration: none; font-size: 1.6rem; color: var(--text-secondary); display: block; transition: 0.3s; }
.mobile-nav-content a:hover, .mobile-nav-content a:focus { color: var(--primary-color); }
.mobile-nav-overlay .close-btn { position: absolute; top: 20px; right: 45px; font-size: 3rem; color: #fff; text-decoration: none !important; }

/* Menu di mobile overlay */
.main-menu-item { display: block; background: var(--light-bg); padding: 20px; border-radius: 12px; margin-bottom: 20px; text-align: center; font-size: 1.5rem; font-weight: 600; color: var(--text-primary); text-decoration: none; transition: background-color 0.3s ease; }
.main-menu-item:hover { background-color: var(--primary-color); text-decoration: none; color: white; }
.main-menu-item i { margin-right: 10px; }
.category-grid-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.category-menu-item { background: var(--light-bg); border-radius: 12px; padding: 15px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--text-secondary); transition: background-color 0.3s ease, color 0.3s ease; }
.category-menu-item:hover { background-color: var(--primary-color); color: white; text-decoration: none; }
.category-menu-item i { font-size: 1.8rem; margin-bottom: 8px; }
.category-menu-item span { font-size: 0.8rem; font-weight: 600; }
.category-menu-item.all-cats { background-color: var(--dark-bg); border: 1px solid var(--border-color); }
.mobile-nav-footer { width: 100%; padding: 20px 0 0 0; display: flex; justify-content: center; align-items: center; }
.mobile-nav-footer a { font-size: 1rem; padding: 10px 15px; color: var(--text-secondary); }

/* =================================
   4. HERO SECTION & ANIMATION
   ================================= */

#hero {
    padding: 40px 20px 80px 20px;
}

.animated-hero-svg {
    width: 180px;
    height: auto;
    margin-bottom: -20px;
    animation: floatAnimation 4s ease-in-out infinite;
}

@keyframes floatAnimation {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.text-logo {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    /* Gradien Teks Baru */
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================
   5. BUTTONS & FORMS (GAYA BARU)
   ================================= */

#search-container {
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

#search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 30px; /* Sedikit lebih besar */
    font-size: 1.1rem;
    border: 2px solid var(--border-color); /* Border lebih tebal */
    border-radius: 50px;
    background-color: var(--light-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.5); /* Efek glow saat aktif */
}

.cta-button {
    display: inline-block;
    /* Gradien tombol baru */
    background: linear-gradient(90deg, var(--primary-color) 0%, #B862F8 100%);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.cta-button:hover,
.cta-button:focus {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(157, 78, 221, 0.4); /* Efek glow hover baru */
    text-decoration: none;
    color: white;
}

.cta-button-secondary {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 16px 35px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    margin-top: 25px;
}

.cta-button-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* ====================================================== */
/* 3. GRID & KARTU (EFEK GLOW BARU) */
/* ====================================================== */
.card-grid {
    display: grid;
    gap: 20px;
    margin-top: 40px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Grid lebih responsif */
}

.game-card, .category-card, .related-card {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Sedikit lebih tajam */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    display: flex;
    flex-direction: column;
}

.game-card:hover, .category-card:hover, .related-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-color); /* EFEK GLOW BARU */
    border-color: var(--primary-color);
}

.game-card a, .category-card a, .related-card a {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.thumbnail-container {
    width: 100%;
    padding-top: 75%; /* Aspect ratio 4:3 */
    position: relative;
    background-color: #333;
}

.thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover img, .category-card:hover img, .related-card:hover img {
    transform: scale(1.1);
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(26, 22, 37, 0.9) 0%, rgba(26, 22, 37, 0) 60%);
}

.category-card h3, .related-card h3 {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    margin: 0;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.game-card .details { position: absolute; bottom: 0; left: 0; right: 0; padding: 15px; text-align: left; }
.game-card h3 { margin: 0 0 5px 0; font-size: 1.1rem; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.game-card .category { font-size: 0.8rem; color: var(--text-secondary); font-weight: 400; }
.game-card .play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8); width: 60px; height: 60px; background-color: rgba(157, 78, 221, 0.8); border-radius: 50%; display: flex; justify-content: center; align-items: center; opacity: 0; transition: all 0.3s ease; }
.game-card:hover .play-icon { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.game-card .play-icon svg { width: 30px; height: 30px; fill: #fff; margin-left: 5px; }

/* Menghapus duplikasi style .category-grid agar lebih konsisten */
#game-showcase { padding-bottom: 40px; }
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

/* ====================================================== */
/* 4. HALAMAN PERMAINAN (PLAY.PHP) & LAINNYA */
/* ====================================================== */
.play-area-container { max-width: 1280px; margin: 20px auto; }
.play-container { width: 100%; padding-top: 56.25%; position: relative; background-color: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); }
.play-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
#fullscreen-icon-btn { position: absolute; bottom: 15px; right: 15px; z-index: 10; background-color: rgba(28, 28, 36, 0.7); border: 1px solid var(--border-color); color: var(--text-primary); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: all 0.3s ease; display: flex; justify-content: center; align-items: center; }
#fullscreen-icon-btn:hover { background-color: var(--primary-color); border-color: var(--primary-color); }
#fullscreen-icon-btn svg { width: 20px; height: 20px; fill: #fff; }
.share-container { display: flex; gap: 10px; justify-content: center; margin: 30px 0; }
.share-button { background-color: var(--light-bg); border: 1px solid var(--border-color); color: var(--text-secondary); width: 45px; height: 45px; border-radius: 50%; cursor: pointer; transition: all 0.3s ease; display: inline-flex; justify-content: center; align-items: center; font-size: 1.1rem; text-decoration: none; }
.share-button:hover { background-color: var(--primary-color); border-color: var(--primary-color); color: white; transform: translateY(-3px); }
.game-details-grid { display: grid; grid-template-columns: 1fr; gap: 40px; text-align: left; margin-top: 40px; }
@media (min-width: 768px) { .game-details-grid { grid-template-columns: 2fr 1fr; } }
.detail-box h3 { font-size: 1.5rem; color: var(--primary-color); margin-top: 0; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.detail-box p { max-width: 100%; margin-left: 0; font-size: 0.95rem; }

/* ====================================================== */
/* 8. LAYOUT ADMIN DENGAN SIDEBAR (DESAIN BARU) */
/* ====================================================== */
.admin-body { background: var(--dark-bg); }
.admin-sidebar {
    width: 260px;
    background-color: var(--light-bg);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px 0;
    border-right: 1px solid var(--border-color);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}
.admin-sidebar .sidebar-logo { padding: 0 25px 25px 25px; text-align: center; border-bottom: 1px solid var(--border-color); }
.admin-sidebar .sidebar-logo a { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; color: var(--text-primary); text-decoration: none; }
.admin-sidebar .sidebar-nav { list-style: none; padding: 0; margin: 20px 0; flex-grow: 1; }
.admin-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    padding: 15px 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative; /* Untuk pseudo-element */
}
.admin-sidebar .sidebar-nav a:hover {
    background-color: rgba(157, 78, 221, 0.1); /* Latar belakang hover ungu transparan */
    color: var(--text-primary);
}
.admin-sidebar .sidebar-nav a.active {
    background: linear-gradient(to right, rgba(157, 78, 221, 0.2), transparent); /* Gradien untuk status aktif */
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
}
.admin-sidebar .sidebar-nav a i { margin-right: 15px; width: 25px; text-align: center; font-size: 1.1rem; }
.admin-sidebar .sidebar-footer { padding: 20px 0; border-top: 1px solid var(--border-color); }
.admin-sidebar .sidebar-footer a { display: block; text-align: center; padding: 10px 0; color: var(--text-secondary); }
.admin-content { padding: 25px; margin-left: 60px; } /* Penyesuaian padding & margin */

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .admin-sidebar.active { transform: translateX(0); }
    .admin-content { margin-left: 0; }
}

/* ====================================================== */
/* 8. HALAMAN IMPORTER & TABEL ADMIN */
/* ====================================================== */
.importer-step {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    text-align: left;
}
.importer-step h3 { margin-top: 0; font-size: 1.5rem; color: var(--primary-color); margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.9rem; table-layout: fixed; }
.admin-table th, .admin-table td { padding: 12px 15px; border: 1px solid var(--border-color); text-align: left; vertical-align: middle; word-wrap: break-word; }
.admin-table th { background-color: var(--dark-bg); font-weight: 600; }
.admin-table tr:nth-child(even) { background-color: rgba(0,0,0,0.2); } /* Zebra striping */
.admin-table img { max-width: 100px; border-radius: 8px; display: block; }


/* =================================
   10. STATIC PAGE & FOOTER
   ================================= */
.static-page {
    text-align: left;
    background-color: var(--light-bg);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--border-color);
    margin-top: 40px;
}
.static-page h1 { margin-top: 0; }
.footer {
    padding: 60px 20px 40px 20px;
    background-color: var(--dark-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}
.footer-nav { margin: 20px 0; }
.footer-nav a { margin: 0 15px; color: var(--text-secondary); }
#load-more-container { margin-top: 40px; }