/*
Theme Name: RealKatha Gaming Portal
Theme URI: https://realkatha.com/
Author: Manus AI
Author URI: https://manus.im/
Description: A professional gaming and content portal with 100+ playable HTML5 games, blog functionality, and AdSense optimization.
Version: 2.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: realkatha-gaming
Domain Path: /languages
Requires at least: 5.0
Requires PHP: 7.4
*/

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: #000;
}

h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

p {
    margin-bottom: 1em;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #00ff00;
}

/* ============================================================================
   LAYOUT & CONTAINERS
   ============================================================================ */

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

main {
    flex: 1;
    padding: 40px 0;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

header {
    background-color: #fff;
    border-bottom: 3px solid #f0f0f0;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 28px;
    font-weight: 900;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
}

.logo a {
    color: #000;
    transition: all 0.3s ease;
}

.logo a:hover {
    color: #00ff00;
}

/* Search Bar */
.search-wrapper {
    flex: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: #00ff00;
}

.search-form button {
    padding: 12px 24px;
    background-color: #00ff00;
    color: #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background-color: #00cc00;
    transform: translateY(-2px);
}

/* Main Navigation */
nav {
    display: flex;
    gap: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 15px 20px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    background-color: #f9f9f9;
    color: #00ff00;
    border-bottom-color: #00ff00;
}

/* ============================================================================
   CATEGORY BADGES & TAGS
   ============================================================================ */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 30px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
    min-height: 50px;
}

.badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.badge-action { background-color: #ff4444; color: #fff; }
.badge-racing { background-color: #ff8800; color: #fff; }
.badge-shooting { background-color: #ffcc00; color: #000; }
.badge-arcade { background-color: #00ff00; color: #000; }
.badge-puzzle { background-color: #00ccff; color: #000; }
.badge-casual { background-color: #cc00ff; color: #fff; }
.badge-adventure { background-color: #ff0099; color: #fff; }
.badge-strategy { background-color: #0099ff; color: #fff; }
.badge-board { background-color: #99ff00; color: #000; }
.badge-card { background-color: #ff6600; color: #fff; }
.badge-family { background-color: #00ff99; color: #000; }
.badge-other { background-color: #999; color: #fff; }

/* ============================================================================
   GAME GRID
   ============================================================================ */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.game-card {
    background-color: #fff;
    border: 2px dashed #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: #00ff00;
}

.game-thumbnail {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.game-thumbnail::after {
    content: '▶';
    position: absolute;
    font-size: 40px;
    color: rgba(255, 255, 255, 0.8);
    z-index: 2;
}

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

.game-category {
    display: inline-block;
    font-size: 10px;
    padding: 4px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    color: #666;
    margin-bottom: 6px;
    width: fit-content;
}

.game-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #000;
    flex: 1;
}

.game-play-btn {
    display: inline-block;
    padding: 8px 12px;
    background-color: #00ff00;
    color: #000;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    align-self: flex-start;
}

.game-play-btn:hover {
    background-color: #00cc00;
    transform: scale(1.05);
}

/* ============================================================================
   SECTION HEADERS
   ============================================================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 20px 0;
    border-bottom: 3px solid #f0f0f0;
    padding-bottom: 15px;
}

.section-title {
    font-size: 26px;
    font-weight: 900;
    color: #000;
}

.section-more {
    color: #ff4444;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.section-more:hover {
    color: #00ff00;
}

/* ============================================================================
   MAIN CONTENT LAYOUT
   ============================================================================ */

.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

.content {
    flex: 1;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 3px solid #00ff00;
    color: #000;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.widget a {
    color: #333;
    display: block;
    transition: all 0.3s ease;
    font-size: 14px;
}

.widget a:hover {
    color: #00ff00;
    padding-left: 8px;
}

/* ============================================================================
   BLOG POSTS
   ============================================================================ */

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.post-item {
    background-color: #fff;
    border-left: 4px solid #00ff00;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.post-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.post-item h3 {
    margin-bottom: 10px;
}

.post-item h3 a {
    color: #000;
}

.post-item h3 a:hover {
    color: #00ff00;
}

.post-meta {
    color: #999;
    font-size: 13px;
    margin-bottom: 12px;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    background-color: #1a1a1a;
    color: #ccc;
    padding: 50px 0 20px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #00ff00;
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: #ccc;
    transition: color 0.3s ease;
    font-size: 14px;
}

.footer-section a:hover {
    color: #00ff00;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination a:hover {
    background-color: #00ff00;
    color: #000;
    border-color: #00ff00;
}

.pagination .current {
    background-color: #00ff00;
    color: #000;
    border-color: #00ff00;
    font-weight: 700;
}

/* ============================================================================
   SINGLE POST/GAME PAGE
   ============================================================================ */

.post-header {
    margin-bottom: 30px;
}

.post-title {
    font-size: 42px;
    margin-bottom: 15px;
    color: #000;
}

.post-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.post-content {
    line-height: 1.8;
    margin-bottom: 30px;
    color: #333;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

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

.post-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-content p {
    margin-bottom: 15px;
}

.entry-content {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

/* Game Container */
.game-container {
    margin: 30px 0;
    text-align: center;
    background-color: #000;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    min-height: 600px;
    height: auto;
    display: block;
    width: 100%;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    height: 0;
    overflow: hidden;
    background: #000;
    display: block;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    background: transparent !important;
}

.game-container iframe {
    border: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 600px !important;
    display: block !important;
    background: transparent !important;
}

.game-details {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.game-details ul {
    list-style: none;
}

.game-details li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.game-details li:last-child {
    border-bottom: none;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 15px;
    }

    .search-wrapper {
        max-width: 100%;
        order: 3;
        flex-basis: 100%;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    h1 { font-size: 32px; }
    h2 { font-size: 24px; }
}

@media (max-width: 768px) {
    h1 { font-size: 28px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }

    .container {
        padding: 0 15px;
    }

    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav a {
        padding: 12px 15px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    nav a:hover {
        border-left-color: #00ff00;
        border-bottom: none;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .badge {
        padding: 10px 12px;
        font-size: 11px;
        min-height: 45px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .game-thumbnail {
        height: 110px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .post-title {
        font-size: 28px;
    }

    .section-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 24px; }
    h2 { font-size: 18px; }

    .logo {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .search-form {
        flex-direction: column;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .game-thumbnail {
        height: 100px;
    }

    .game-info {
        padding: 10px;
    }

    .game-title {
        font-size: 12px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .badge {
        padding: 8px 10px;
        font-size: 10px;
        min-height: 40px;
    }

    .post-title {
        font-size: 22px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-title {
        font-size: 18px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }

.hidden {
    display: none;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================================
   ADSENSE OPTIMIZATION
   ============================================================================ */

.ad-space {
    margin: 30px 0;
    min-height: 250px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    header, footer, .sidebar, .pagination {
        display: none;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
}
