/* BrightForge Games Hub - Core Styles */

:root {
    --primary-color: #ff9800; /* Bright Orange */
    --secondary-color: #2196f3; /* Bright Blue */
    --accent-color: #ffc107; /* Yellow */
    --bg-dark: #121212;
    --bg-light: #1e1e1e;
    --bg-card: #2c2c2c;
    --text-main: #e0e0e0;
    --text-dim: #9e9e9e;
    --text-white: #ffffff;
    --border-color: #333333;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.4);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --header-height: 70px;
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

ul {
    list-style: none;
}

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

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 152, 0, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 100px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.main-header {
    height: var(--header-height);
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

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

.logo {
    display: flex;
    flex-direction: column;
    font-weight: 800;
    line-height: 1;
}

.logo-bright {
    color: var(--primary-color);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-forge {
    color: var(--secondary-color);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-bar {
    position: relative;
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 4px 8px;
    border: 1px solid var(--border-color);
}

.search-bar input {
    flex: 1;
    background: transparent;
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 0.9rem;
}

.search-bar button {
    background: transparent;
    padding: 0 10px;
    font-size: 1.1rem;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-item:hover {
    background: var(--bg-card);
}

.search-item img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    margin-right: 12px;
    object-fit: cover;
}

.search-item-info h5 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.search-item-info span {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    color: var(--text-main);
    font-size: 1.5rem;
}

/* Category Navigation */
.category-nav {
    background-color: var(--bg-card);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.category-nav::-webkit-scrollbar {
    height: 4px;
}

.category-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

#category-list {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding: 0 15px;
}

#category-list li:first-child {
    padding-left: 5px;
}

#category-list li:last-child {
    padding-right: 20px;
}

.category-btn {
    background: var(--bg-light);
    color: var(--text-main);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    display: inline-block;
}

.category-btn:hover, .category-btn.active {
    background: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%), var(--bg-light);
    padding: 60px 0;
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 15px;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 30px;
}

.cta-btn {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: var(--text-white);
    padding: 14px 32px;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    transition: var(--transition);
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}

/* Game Grid Section */
.main-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.main-grid-header h2 {
    font-size: 1.8rem;
    position: relative;
    padding-left: 15px;
}

.main-grid-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 70%;
    background: var(--primary-color);
    border-radius: 3px;
}

#sort-select {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Game Card */
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-thumb {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

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

.play-icon {
    font-size: 3rem;
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: var(--text-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: var(--transition);
}

.fav-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.fav-btn.active {
    color: #ff4081;
}

.card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
}

.badge-hot { background: #f44336; }
.badge-new { background: #4caf50; }

.card-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.game-cat {
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.game-rating {
    color: var(--accent-color);
}

/* Featured Sections */
.featured-section {
    margin-bottom: 40px;
}

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

.section-header h3 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 20px;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-container .game-card {
    flex: 0 0 180px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 60px;
}

.page-btn {
    background: var(--bg-card);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.page-btn:hover, .page-btn.active {
    background: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
}

/* Tag Cloud */
.tag-cloud-section {
    background: var(--bg-light);
    padding: 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 60px;
    text-align: center;
}

.tag-cloud-section h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tag-btn {
    background: var(--bg-card);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.tag-btn:hover {
    background: var(--bg-dark);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Game Detail View */
/* Detail View Navigation */
.detail-nav {
    margin: 20px 0;
}

.back-btn {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.back-btn:hover {
    background: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
}

.detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.detail-thumb {
    width: 250px;
    height: 250px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.detail-info {
    flex: 1;
}

.detail-info h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--text-dim);
}

.detail-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.play-now-btn {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 12px 30px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    white-space: nowrap;
}

.play-now-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.4);
}

.external-btn {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.external-btn:hover {
    background: var(--bg-light);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.game-iframe-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

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

.detail-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.detail-main h3 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
    color: var(--secondary-color);
}

.detail-main p {
    color: var(--text-dim);
    margin-bottom: 20px;
}

.how-to-play-list li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.how-to-play-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.detail-sidebar {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--radius-lg);
    height: fit-content;
    border: 1px solid var(--border-color);
}

.sidebar-widget {
    margin-bottom: 30px;
}

.sidebar-widget h4 {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Static Content View */
.static-content-box {
    background: var(--bg-light);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 60px;
}

.static-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.static-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

.static-body {
    line-height: 1.8;
}

.static-body h3 {
    margin: 30px 0 15px;
    color: var(--secondary-color);
}

.static-body p {
    margin-bottom: 20px;
    color: var(--text-dim);
}

/* SEO Content Section */
.seo-content-section {
    margin: 60px 0;
    padding: 40px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.seo-content-wrapper h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.seo-content-wrapper h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 35px 0 15px;
}

.seo-content-wrapper h4 {
    font-size: 1.2rem;
    color: var(--text-white);
    margin: 25px 0 10px;
}

.seo-content-wrapper p {
    color: var(--text-dim);
    margin-bottom: 15px;
    line-height: 1.8;
}

.seo-content-wrapper strong {
    color: var(--primary-color);
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.stats-label { color: var(--text-dim); }

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.footer-links h4 {
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--text-dim);
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--text-white);
    padding-left: 5px;
}

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

/* Mobile Menu */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.mobile-menu {
    width: 300px;
    height: 100%;
    background: var(--bg-light);
    padding: 20px;
    position: relative;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-overlay:not(.hidden) .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#close-menu {
    background: none;
    color: var(--text-main);
    font-size: 1.5rem;
}

.mobile-search-container {
    margin-bottom: 20px;
}

.mobile-search-container input {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.mobile-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-cat-btn {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    text-align: left;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-content h1 { font-size: 2.5rem; }
    .footer-grid { gap: 30px; }
}

@media (max-width: 768px) {
    .header-center { display: none; }
    .mobile-menu-toggle { display: block; }
    .hero-content h1 { font-size: 2rem; }
    .hero-banner { padding: 40px 0; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 20px; }
    .detail-thumb { width: 180px; height: 180px; }
    .detail-info h2 { font-size: 1.6rem; line-height: 1.2; margin-top: 10px; }
    .detail-meta { flex-wrap: wrap; justify-content: center; gap: 10px; font-size: 0.85rem; }
    .detail-body { grid-template-columns: 1fr; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
    .scroll-container .game-card { flex: 0 0 140px; }
    .category-nav { padding: 12px 0; }
    #category-list { padding: 0 20px; }
    .logo-bright, .logo-forge { font-size: 1.2rem; }
    .seo-content-section { padding: 25px; margin: 40px 0; }
    .seo-content-wrapper h2 { font-size: 1.5rem; }
    .seo-content-wrapper h3 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .hero-content h1 { font-size: 1.5rem; }
    .hero-content p { font-size: 1rem; }
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-info h2 { font-size: 1.4rem; }
    .detail-actions { gap: 10px; width: 100%; }
    .play-now-btn, .external-btn, .fav-btn-large { 
        flex: 1 1 100%; 
        justify-content: center;
        padding: 12px 10px;
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .logo-sub { display: none; }
    .detail-info h2 { font-size: 1.2rem; }
    .game-grid { grid-template-columns: 1fr; }
}
