/* ================================================
   GameEdukasi.com - Main Stylesheet
   ================================================ */

/* CSS Variables (Default - overridden by theme) */
:root {
    --primary: #4FC3F7;
    --primary-dark: #0288D1;
    --secondary: #66BB6A;
    --accent: #FFB74D;
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Global ---- */
* { box-sizing: border-box; }
body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; }
a { color: var(--primary-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }

.skip-link {
    position: absolute; top: -100px; left: 0; background: var(--primary); color: #fff; padding: 8px 16px; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ---- Navbar ---- */
#mainNavbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 0;
    z-index: 1030;
    transition: var(--transition);
}
.navbar-brand { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: var(--text-primary) !important; }
.brand-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 10px; color: #fff; font-size: 1.1rem; }
.brand-text { background: linear-gradient(135deg, var(--primary-dark), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-link { font-weight: 500; color: var(--text-secondary) !important; padding: 0.5rem 1rem !important; border-radius: var(--radius-sm); transition: var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--primary-dark) !important; background: rgba(79,195,247,0.1); }

/* Search bar */
.nav-search-wrapper { position: relative; width: 280px; }
.search-input { border-radius: 25px !important; padding-left: 16px; border: 2px solid var(--border-color); background: var(--bg-secondary); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(79,195,247,0.2); background: #fff; }
.btn-search { border-radius: 0 25px 25px 0 !important; background: var(--primary); color: #fff; border: 2px solid var(--primary); }
.btn-search:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.search-autocomplete {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); display: none; z-index: 1050; overflow: hidden; margin-top: 4px;
}
.autocomplete-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text-primary); }
.autocomplete-item:hover { background: var(--bg-secondary); }
.autocomplete-item img { width: 40px; height: 30px; object-fit: cover; border-radius: 6px; margin-right: 12px; }
.lang-switch { border-radius: 20px; font-size: 0.85rem; }

/* ---- Hero Section ---- */
.hero-section {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff; padding: 4rem 0 3rem;
}
.hero-bg-shapes { position: absolute; inset: 0; overflow: hidden; }
.shape { position: absolute; border-radius: 50%; opacity: 0.1; background: #fff; }
.shape-1 { width: 300px; height: 300px; top: -100px; right: -50px; animation: float 8s ease-in-out infinite; }
.shape-2 { width: 200px; height: 200px; bottom: -60px; left: 10%; animation: float 6s ease-in-out infinite reverse; }
.shape-3 { width: 150px; height: 150px; top: 40%; right: 30%; animation: float 10s ease-in-out infinite; }

.hero-title { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-emoji { font-size: 2.5rem; }
.hero-subtitle { font-size: 1.15rem; opacity: 0.9; margin-bottom: 1.5rem; max-width: 500px; }
.btn-hero-primary { background: #fff; color: var(--primary-dark); border: none; padding: 12px 28px; border-radius: 30px; font-weight: 600; font-size: 1rem; transition: var(--transition); }
.btn-hero-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); color: var(--primary-dark); }
.btn-hero-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.5); padding: 10px 28px; border-radius: 30px; font-weight: 600; }
.btn-hero-outline:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }

.hero-stats { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; }
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 1.6rem; font-weight: 800; font-family: var(--font-heading); }
.stat-label { font-size: 0.8rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.3); }

.hero-game-icons { position: relative; width: 300px; height: 300px; margin: 0 auto; }
.hero-game-icons i { position: absolute; font-size: 2.5rem; opacity: 0.3; color: #fff; }
.icon-1 { top: 20%; left: 10%; animation: float 4s ease-in-out infinite; }
.icon-2 { top: 10%; right: 20%; animation: float 5s ease-in-out infinite 0.5s; }
.icon-3 { top: 50%; left: 5%; animation: float 6s ease-in-out infinite 1s; }
.icon-4 { top: 60%; right: 10%; animation: float 4.5s ease-in-out infinite 1.5s; }
.icon-5 { top: 35%; left: 45%; font-size: 3.5rem; opacity: 0.5; animation: float 5s ease-in-out infinite 0.3s; }
.icon-6 { bottom: 15%; left: 30%; animation: float 5.5s ease-in-out infinite 0.8s; }

/* ---- Sections ---- */
.section-games { padding: 3rem 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.section-popular { background: var(--bg-secondary); }
.category-name { font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; }
.category-icon { color: var(--accent); }

/* Page header */
.page-header { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 2rem 0; }
.page-title { font-size: 1.8rem; font-weight: 700; margin: 0; }
.page-subtitle { opacity: 0.8; margin: 0.5rem 0 0; }

/* ---- Game Card ---- */
.game-card { background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); height: 100%; }
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.game-card-link { text-decoration: none; color: inherit; display: block; }
.game-card-thumbnail { position: relative; overflow: hidden; aspect-ratio: 16/10; background: var(--bg-secondary); }
.game-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.game-card:hover .game-card-img { transform: scale(1.08); }
.game-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--text-muted); }
.game-card-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition); }
.game-card:hover .game-card-overlay { opacity: 1; }
.play-icon { width: 50px; height: 50px; background: rgba(255,255,255,0.95); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--primary-dark); transform: scale(0.8); transition: transform 0.3s; }
.game-card:hover .play-icon { transform: scale(1); }
.game-card-badge { position: absolute; top: 10px; left: 10px; font-size: 0.7rem; }
.badge-featured { background: var(--accent); color: #333; }
.game-card-body { padding: 1rem; }
.game-card-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-card-categories { margin-bottom: 0.5rem; }
.badge-category { background: rgba(79,195,247,0.15); color: var(--primary-dark); font-weight: 500; font-size: 0.72rem; }
.badge-tag { background: rgba(102,187,106,0.15); color: #2E7D32; font-weight: 500; font-size: 0.72rem; }
.game-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); }
.game-card-rating .stars-mini { display: inline-flex; gap: 1px; }
.stars-mini i { font-size: 0.65rem; color: #FFB74D; }
.rating-value { margin-left: 4px; font-weight: 600; }
.game-card-views i { margin-right: 3px; }

/* ---- Game Detail ---- */
.game-detail-header { border-bottom: 2px solid var(--border-color); padding-bottom: 1rem; }
.game-detail-title { font-size: 1.8rem; }
.game-detail-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9rem; }
.game-detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.game-embed-wrapper { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 1rem; }
.game-embed-container { width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.game-iframe { width: 100%; height: 100%; }
.description-content { line-height: 1.8; }
.description-content img { border-radius: var(--radius-sm); margin: 1rem 0; }
.screenshot-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: 0.6; transition: var(--transition); border: 2px solid transparent; }
.screenshot-thumb:hover, .screenshot-thumb.active { opacity: 1; border-color: var(--primary); }

/* Game Info */
.game-info-list li { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border-color); }
.game-info-list li:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 0.85rem; }
.info-value { font-weight: 500; text-align: right; }

/* Related Games */
.related-game-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--text-primary); transition: var(--transition); }
.related-game-item:last-child { border-bottom: none; }
.related-game-item:hover { color: var(--primary-dark); }
.related-game-thumb img { width: 60px; height: 45px; object-fit: cover; border-radius: 6px; }
.thumb-placeholder { width: 60px; height: 45px; background: var(--bg-secondary); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.related-game-info h6 { margin: 0; font-size: 0.85rem; }

/* ---- Share Buttons ---- */
.share-buttons { margin: 1.5rem 0; }
.share-title { font-size: 1rem; }
.share-btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 25px; font-size: 0.85rem; font-weight: 500; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; color: #fff; }
.share-whatsapp { background: #25D366; } .share-whatsapp:hover { background: #1DA851; color: #fff; }
.share-facebook { background: #1877F2; } .share-facebook:hover { background: #1565C0; color: #fff; }
.share-twitter { background: #1DA1F2; } .share-twitter:hover { background: #1A8CD8; color: #fff; }
.share-telegram { background: #0088CC; } .share-telegram:hover { background: #006DA3; color: #fff; }
.share-copy { background: #6c757d; } .share-copy:hover { background: #5a6268; color: #fff; }

/* ---- Rating Widget ---- */
.rating-big-number { font-size: 2.5rem; font-weight: 800; font-family: var(--font-heading); color: var(--primary-dark); }
.rating-display { text-align: center; }
.rating-display .rating-stars { font-size: 1.3rem; color: #FFB74D; }
.rating-count { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.star-rating { display: inline-flex; gap: 4px; }
.star-btn { background: none; border: none; font-size: 1.6rem; color: #ddd; cursor: pointer; transition: var(--transition); padding: 2px; }
.star-btn:hover, .star-btn.active { color: #FFB74D; transform: scale(1.15); }
.star-btn.hover-active { color: #FFB74D; }

/* ---- Comments ---- */
.comment-item { display: flex; gap: 14px; padding: 1rem 0; border-bottom: 1px solid var(--border-color); }
.comment-item:last-child { border-bottom: none; }
.avatar-circle { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.comment-author { color: var(--text-primary); }
.comment-date { font-size: 0.75rem; color: var(--text-muted); }
.comment-text { margin: 0; color: var(--text-secondary); line-height: 1.6; }

/* ---- Filter Sidebar ---- */
.filter-sidebar { position: sticky; top: 80px; }
.filter-group { margin-bottom: 1.5rem; }
.filter-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-primary); }
.filter-sidebar .list-group-item { border-radius: 0; border-left: 3px solid transparent; font-size: 0.9rem; transition: var(--transition); }
.filter-sidebar .list-group-item:hover { border-left-color: var(--primary); background: rgba(79,195,247,0.05); }
.filter-sidebar .list-group-item.active { border-left-color: var(--primary); background: rgba(79,195,247,0.1); color: var(--primary-dark); }

/* ---- Footer ---- */
.site-footer { background: var(--text-primary); color: rgba(255,255,255,0.8); padding: 3rem 0 1rem; margin-top: 3rem; }
.footer-brand { display: flex; align-items: center; }
.footer-brand .brand-icon { width: 32px; height: 32px; font-size: 0.9rem; }
.footer-brand .brand-text { font-size: 1.2rem; font-weight: 700; color: #fff; }
.footer-desc { font-size: 0.9rem; opacity: 0.7; max-width: 400px; }
.footer-credit { font-size: 0.85rem; opacity: 0.8; }
.footer-title { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 1rem; position: relative; padding-bottom: 0.5rem; }
.footer-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: var(--primary); border-radius: 2px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.footer-badge { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); font-weight: 400; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; transition: var(--transition); }
.footer-badge:hover { background: var(--primary); color: #fff; }
.footer-divider { border-color: rgba(255,255,255,0.1); margin: 2rem 0 1rem; }
.footer-bottom { text-align: center; font-size: 0.85rem; opacity: 0.6; }

/* ---- Back to Top ---- */
.btn-back-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px;
    background: var(--primary); color: #fff; border: none; border-radius: 50%;
    display: none; align-items: center; justify-content: center; font-size: 1rem;
    box-shadow: var(--shadow-md); cursor: pointer; transition: var(--transition); z-index: 999;
}
.btn-back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }
.btn-back-to-top.visible { display: flex; }

/* ---- About ---- */
.about-content { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.about-content h2, .about-content h3 { color: var(--primary-dark); margin-top: 1.5rem; }

/* ---- Animations ---- */
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-15px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.delay-1 { animation-delay: 0.15s; opacity: 0; }
.delay-2 { animation-delay: 0.3s; opacity: 0; }
.delay-3 { animation-delay: 0.45s; opacity: 0; }
.animate-float { animation: float 6s ease-in-out infinite; }

/* ---- Cards ---- */
.card { border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--border-color); font-weight: 600; }

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .nav-search-wrapper { width: 100%; margin-top: 0.5rem; }
}
@media (max-width: 767px) {
    .hero-section { padding: 2.5rem 0 2rem; }
    .hero-title { font-size: 1.7rem; }
    .hero-stats { gap: 1rem; }
    .stat-number { font-size: 1.3rem; }
    .section-games { padding: 2rem 0; }
    .game-detail-title { font-size: 1.4rem; }
    .share-btn span { display: none; }
}
@media (max-width: 575px) {
    .hero-actions .btn { width: 100%; margin-bottom: 0.5rem; }
}

/* ---- Error Page ---- */
.error-page { padding: 3rem 0; }
.error-page .display-1 { font-size: 8rem; }

/* ---- Pagination override ---- */
.pagination .page-link { border-radius: var(--radius-sm); margin: 0 2px; border: none; color: var(--text-secondary); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
