/*
Theme Name: CODEOBA Premium (PlayStore Edition)
Theme URI: https://codeoba.com/
Author: Mohamed Nurdin Mgaza
Author URI: mailto:codeoba@gmail.com
Author Email: codeoba@gmail.com
Author Phone: +255687001775
Author Location: Tanzania Daes salaam
Description: A next-generation WordPress theme for APK and MOD indexing, featuring autonomous scraping and a perfect Google Play UI.
Version: 1.0.0
Text Domain: codeoba-premium
*/

/* --- Design Tokens --- */
:root {
    --primary: #01875f; /* Play Store Green */
    --primary-light: #e6f2ef;
    --accent: #1a73e8; /* Google Blue */
    --text-main: #202124;
    --text-muted: #5f6368;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --border-color: #dadce0;
    --radius-icon: 18px;
    --radius-card: 12px;
}

[data-theme="dark"] {
    --text-main: #e8eaed;
    --text-muted: #9aa0a6;
    --bg-body: #121212;
    --bg-card: #202124;
    --border-color: #3c4043;
}

/* --- Base Reset --- */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* --- Global Reset & Stability --- */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    margin: 0;
    padding: 0;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

/* --- Grid System --- */
.grid-container {
    display: grid !important;
    gap: 20px !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 4 Columns on PC */
    width: 100% !important;
}

/* --- App Card (Horizontal on PC) --- */
.app-card {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 12px !important;
    background: var(--bg-card) !important;
    border-radius: 16px !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    text-align: left !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    min-width: 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.app-card:hover {
    box-shadow: 0 12px 32px rgba(1, 135, 95, 0.15), 0 0 20px rgba(1, 135, 95, 0.08) !important;
    transform: translateY(-5px) !important;
    border-color: var(--primary) !important;
}

.app-card .icon-container {
    position: relative !important;
    width: 65px !important;
    height: 65px !important;
    flex-shrink: 0 !important;
}

.app-card .icon-container .icon {
    width: 100% !important;
    height: 100% !important;
    border-radius: 14px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Floating Mod/Premium Badge */
.app-card .badge-mod {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%) !important;
    color: #ffffff !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: 1.5px solid var(--bg-card) !important;
    z-index: 2 !important;
}

.app-card .info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.app-card .title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 0 3px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
}

.app-card .meta {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    margin-bottom: 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

.app-card .rating-box {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-weight: 600 !important;
    color: #ff9800 !important;
}

.app-card .mod-label {
    font-size: 10px !important;
    color: #ff9800 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: rgba(255, 152, 0, 0.08) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
}

/* --- Responsive Rules --- */
@media screen and (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* --- Swiper Slider Customization --- */
.swiper-pagination-bullet-active {
    background: var(--primary) !important;
    width: 25px !important;
    border-radius: 5px !important;
}

@media screen and (max-width: 768px) {
    .main-slider {
        height: 300px !important;
    }
    .slide-content {
        left: 20px !important;
        bottom: 20px !important;
        text-align: center !important;
        width: calc(100% - 40px) !important;
    }
    .slide-content h2 {
        font-size: 24px !important;
    }
    .slide-content p {
        display: none !important;
    }
}

.app-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

/* Hero Section Adjustments */
.hero-section {
    background: #1a1a1a;
    color: #fff;
    padding: 60px 0;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-section h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #ffffff; /* High contrast */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- High-end Mobile Card & Grid Styling --- */
@media screen and (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
        padding: 0 !important;
    }
    
    .app-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 8px 6px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    
    .app-card:hover {
        transform: translateY(-2px) !important;
        box-shadow: none !important;
    }

    .app-card .icon-container {
        width: 76px !important;
        height: 76px !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    }
    
    .app-card .icon-container .icon {
        border-radius: 16px !important;
    }

    /* Beautiful Floating Mod Badge directly on top of icon */
    .app-card .badge-mod {
        position: absolute !important;
        top: -4px !important;
        right: -4px !important;
        font-size: 7.5px !important;
        padding: 1px 5px !important;
        border-radius: 5px !important;
        border: 1px solid var(--bg-body) !important;
        box-shadow: 0 2px 5px rgba(255, 152, 0, 0.4) !important;
    }

    .app-card .info {
        width: 100% !important;
        margin-top: 6px !important;
        padding: 0 !important;
    }

    .app-card .title {
        font-size: 12px !important;
        font-weight: 500 !important;
        color: var(--text-main) !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.25 !important;
        height: 30px !important; /* Forces exactly 2 lines height */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        white-space: normal !important;
    }

    .app-card .meta {
        font-size: 10px !important;
        color: var(--text-muted) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .app-card .meta .sep {
        font-size: 8px !important;
        opacity: 0.6 !important;
    }

    .app-card .mod-label {
        display: none !important; /* Hide extra text to keep grid clean and beautiful */
    }
}

/* --- Sidebar & Widgets --- */
.widget-area {
    width: 300px;
    flex-shrink: 0;
}

.widget-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-title::before {
    content: "";
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

/* Category Grid in Sidebar */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.cat-item i {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 8px;
}

.cat-item span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

.cat-item:hover {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(1, 135, 95, 0.1);
    transform: translateY(-2px);
}

@media screen and (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }
    .widget-area {
        width: 100%;
    }
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Homepage Blocks --- */
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px;
}

.block-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.block-header .view-more {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

/* --- Hero Slider --- */
.hero-slider {
    width: 100%;
    height: 250px;
    background: var(--primary-light);
    border-radius: var(--radius-card);
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* --- AJAX Live Search Dropdown Styles --- */
.search-results-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    margin-top: 8px !important;
    z-index: 9999 !important;
    padding: 6px !important;
    backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .search-results-dropdown {
    background: rgba(32, 33, 36, 0.98) !important;
    border-color: #3c4043 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.search-result-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(0,0,0,0.03) !important;
}

.search-result-item:last-child {
    border-bottom: none !important;
}

.search-result-item:hover {
    background: rgba(1, 135, 95, 0.08) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .search-result-item:hover {
    background: rgba(1, 135, 95, 0.15) !important;
}

.search-item-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.search-item-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.search-item-title {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.search-item-meta {
    font-size: 10.5px !important;
    color: var(--text-muted) !important;
}

.search-badge-mod {
    background: linear-gradient(135deg, #ff9800, #ff5722) !important;
    color: #ffffff !important;
    font-size: 7.5px !important;
    font-weight: 800 !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    margin-left: 5px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.search-loading, .search-no-results {
    padding: 20px !important;
    text-align: center !important;
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

/* --- Responsive Footer Columns --- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

@media screen and (max-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (max-width: 480px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

/* --- Premium Category Blocks (Simple Style) --- */
.category-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-item-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.category-item-simple i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-item-simple .category-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.25s;
}

.category-item-simple:hover {
    transform: translateY(-4px);
}

.category-item-simple:hover i {
    transform: scale(1.15) rotate(-5deg);
    color: var(--primary-light);
}

.category-item-simple:hover .category-name {
    color: var(--primary);
}

@media screen and (max-width: 768px) {
    .category-grid-premium {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
    }
}

@media screen and (max-width: 480px) {
    .category-grid-premium {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
    .category-item-simple i {
        font-size: 26px;
    }
    .category-item-simple .category-name {
        font-size: 12px;
    }
}



