/*
Theme Name: Gaming Theme
Theme URI: https://example.com/gaming-theme
Author: Developer
Description: A modern gaming news and blog theme inspired by JNews
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: gaming-theme
*/

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary-color: #e74c3c;
    --primary-hover: #c0392b;
    --dark-bg: #1a1a1a;
    --darker-bg: #0d0d0d;
    --light-bg: #ffffff;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #888888;
    --border-color: #e8e8e8;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding: 30px 0;
}

.content-area {
    min-width: 0;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--dark-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    position: relative;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .logo-text {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 400;
    font-style: italic;
    color: var(--white);
}

.site-logo .logo-text span {
    color: var(--primary-color);
}

/* Navigation */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 0;
}

.main-nav a {
    display: block;
    padding: 18px 16px;
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search {
    position: relative;
}

.header-search input {
    background: transparent;
    border: none;
    padding: 8px;
    color: var(--white);
    font-size: 14px;
    width: 0;
    transition: all 0.3s ease;
}

.search-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 10px;
    font-size: 16px;
}

.social-links {
    display: flex;
    gap: 5px;
}

.social-links a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    font-size: 14px;
    transition: all 0.3s ease;
}

.social-links a.facebook { background: #3b5998; }
.social-links a.twitch { background: #6441a5; }
.social-links a.youtube { background: #ff0000; }

.social-links a:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* ============================================
   Mega Menu (Horizontal Card Style)
   ============================================ */
.menu-item-has-mega {
    position: static;
}

.menu-item-has-mega > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-item-has-mega .dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.menu-item-has-mega:hover .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.menu-item-has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-menu-carousel {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
}

/* Individual mega menu card */
.mega-item {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 180px;
    transition: opacity 0.2s ease;
}

.mega-item:hover {
    opacity: 0.85;
}

.mega-item-thumb {
    width: 180px;
    height: 120px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mega-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mega-item:hover .mega-item-thumb img {
    transform: scale(1.05);
}

.mega-item h4 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-dark);
    margin: 0;
}

.mega-item:hover h4 {
    color: var(--primary-color);
}

/* ============================================
   Search Modal
   ============================================ */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-inner {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.search-modal form {
    display: flex;
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
}

.search-modal input {
    flex: 1;
    padding: 20px;
    border: none;
    font-size: 18px;
    outline: none;
}

.search-modal button[type="submit"] {
    padding: 20px 25px;
    background: var(--primary-color);
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-modal button[type="submit"]:hover {
    background: var(--primary-hover);
}

.search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.search-close:hover {
    opacity: 1;
}

/* ============================================
   Posts List (Reference Site Style)
   ============================================ */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.post-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
}

.post-item:first-child {
    padding-top: 0;
}

.post-item:last-child {
    border-bottom: none;
}

/* Featured First Post - Larger */
.post-item.featured-item {
    grid-template-columns: 350px 1fr;
}

.post-item.featured-item .post-thumbnail img {
    height: 230px;
}

.post-item.featured-item .post-title {
    font-size: 24px;
}

/* Post Thumbnail */
.post-item .post-thumbnail {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 0;
}

.post-item .post-thumbnail img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.03);
}

/* Video Play Button */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
}

.post-item:hover .video-play-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Post Info */
.post-item .post-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-item .post-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.post-item .post-title a:hover {
    color: var(--primary-color);
}

/* Rating Stars */
.rating-stars {
    display: flex;
    gap: 2px;
    color: #ffc107;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.post-meta a {
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 12px;
}

.post-meta .date,
.post-meta .comments {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta svg {
    opacity: 0.6;
}

/* Post Excerpt */
.post-item .post-excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: var(--white);
    border: 1px solid var(--border-color);
}

.widget-title {
    background: var(--dark-bg);
    color: var(--white);
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-content {
    padding: 15px;
}

/* Ad Banner */
.ad-banner {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

.ad-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 2px dashed #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ad-placeholder .ad-label {
    font-size: 18px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ad-placeholder .ad-size {
    font-size: 12px;
    color: #666;
}

/* Tabs Widget */
.tabs-widget .tab-nav {
    display: flex;
    background: var(--dark-bg);
}

.tabs-widget .tab-nav button {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tabs-widget .tab-nav button.active,
.tabs-widget .tab-nav button:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.tabs-widget .tab-content {
    padding: 0;
}

/* Small Post Item */
.small-post {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.small-post:last-child {
    border-bottom: none;
}

.small-post .post-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 50px;
    overflow: hidden;
    position: relative;
}

.small-post .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.small-post .video-play-btn {
    width: 24px;
    height: 24px;
}

.small-post .video-play-btn svg {
    width: 10px;
    height: 10px;
}

.small-post .post-info {
    flex: 1;
    min-width: 0;
}

.small-post .post-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.small-post .post-title a:hover {
    color: var(--primary-color);
}

.small-post .post-date {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Recommended Widget */
.recommended-widget .featured-post {
    position: relative;
    margin-bottom: 15px;
}

.recommended-widget .featured-post img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.recommended-widget .featured-post .post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.recommended-widget .featured-post .post-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 5px;
}

.recommended-widget .featured-post .post-date {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tags-cloud a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.tags-cloud a:nth-child(10n+1) { background: #e74c3c; }
.tags-cloud a:nth-child(10n+2) { background: #9b59b6; }
.tags-cloud a:nth-child(10n+3) { background: #3498db; }
.tags-cloud a:nth-child(10n+4) { background: #2ecc71; }
.tags-cloud a:nth-child(10n+5) { background: #f39c12; }
.tags-cloud a:nth-child(10n+6) { background: #1abc9c; }
.tags-cloud a:nth-child(10n+7) { background: #e91e63; }
.tags-cloud a:nth-child(10n+8) { background: #00bcd4; }
.tags-cloud a:nth-child(10n+9) { background: #ff5722; }
.tags-cloud a:nth-child(10n+10) { background: #607d8b; }

.tags-cloud a:hover {
    opacity: 0.85;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--dark-bg);
    color: rgba(255,255,255,0.7);
    margin-top: 40px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 40px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-widget h3 {
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-widget p {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.footer-widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

.footer-widget ul li:last-child {
    border-bottom: none;
}

.footer-widget a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    font-size: 12px;
}

.footer-bottom a {
    color: var(--primary-color);
}

.footer-nav ul {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    font-size: 12px;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--white);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .current {
    background: var(--dark-bg);
    border-color: var(--dark-bg);
    color: var(--white);
}

.pagination .dots {
    background: transparent;
    border: none;
}

/* ============================================
   Single Post
   ============================================ */
.single-post {
    background: var(--white);
}

.single-post-header {
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
}

.single-post-header .post-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 15px;
}

.single-post .featured-image {
    margin-bottom: 20px;
}

.single-post .featured-image img {
    width: 100%;
    height: auto;
}

.single-post-content {
    padding: 25px 0;
}

.single-post-content p {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.8;
}

.single-post-content h2 {
    font-size: 22px;
    margin: 25px 0 15px;
}

.single-post-content blockquote {
    background: #f9f9f9;
    border-left: 4px solid var(--primary-color);
    padding: 20px 25px;
    margin: 25px 0;
    font-style: italic;
}

.single-post-content img {
    margin: 20px 0;
    max-width: 100%;
    height: auto;
}

/* Post Footer */
.post-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.post-tags strong {
    font-size: 14px;
}

/* Post Navigation */
.post-navigation {
    padding: 25px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.post-navigation a {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.post-navigation a:hover {
    color: var(--primary-color);
}

/* ============================================
   No Posts
   ============================================ */
.no-posts {
    text-align: center;
    padding: 60px 20px;
}

.no-posts h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.no-posts p {
    color: var(--text-light);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav,
    .social-links {
        display: none;
    }
    
    .mega-menu {
        display: none;
    }
    
    .post-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .post-item .post-thumbnail img {
        height: 200px;
    }
    
    .post-item.featured-item {
        grid-template-columns: 1fr;
    }
    
    .post-item.featured-item .post-thumbnail img {
        height: 220px;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Touch device mega menu support */
.menu-item-has-mega.mega-open .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
