/*
Theme Name: apkstore
Theme URI: https://apkstore.com
Author: apkstore Team
Author URI: https://apkstore.com
Description: A modern, minimal, SEO-friendly APK download theme for WordPress.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apkstore
Tags: minimal, clean, apps, apk, custom-post-types
*/

/* ============================================
   CSS VARIABLES - LIGHT MODE (DEFAULT)
============================================ */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #111827;
    --accent-hover: #374151;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --rating-color: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

/* ============================================
   CSS VARIABLES - DARK MODE
============================================ */
.dark-mode {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #171717;
    --bg-card-hover: #262626;
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --accent: #fafafa;
    --accent-hover: #e5e5e5;
    --border-color: #262626;
    --border-light: #1f1f1f;
    --rating-color: #fafafa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

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

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ============================================
   LAYOUT
============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    min-height: calc(100vh - 160px);
}

/* ============================================
   HEADER
============================================ */
.site-header {
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.site-logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

/* Logo Dark Mode Toggle */
.site-logo {
    display: inline-flex;
    align-items: center;
}

.site-logo img {
    height: 40px; /* adjust as needed */
    width: auto;
    max-width: 150px; /* adjust as needed */
}

.site-logo .logo-light {
    display: block;
}

.site-logo .logo-dark {
    display: none;
}

/* Dark mode - swap logos */
.dark-mode .site-logo .logo-light {
    display: none;
}

.dark-mode .site-logo .logo-dark {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .site-logo img {
        height: 32px;
    }
}
.site-logo img {
    height: 45px;
    width: auto;
}

/* Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a,
.nav-menu li.current_page_item a {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.header-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
}

.theme-toggle .icon-moon {
    opacity: 0;
}

.dark-mode .theme-toggle .icon-sun {
    opacity: 0;
}

.dark-mode .theme-toggle .icon-moon {
    opacity: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 1.5px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.search-overlay-inner {
    width: 100%;
    max-width: 560px;
    padding: 0 24px;
}

.search-overlay .search-field {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.125rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.search-overlay .search-field:focus {
    border-color: var(--text-primary);
}

.search-overlay .search-field::placeholder {
    color: var(--text-muted);
}

.search-close {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: var(--transition);
}

.search-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* ============================================
   HERO SECTION
============================================ */
.hero-section {
    padding: 64px 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 32px;
}

.hero-search {
    max-width: 480px;
    margin: 0 auto;
}

.hero-search-form {
    position: relative;
}

.hero-search-input {
    width: 100%;
    padding: 16px 120px 16px 20px;
    font-size: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.hero-search-input:focus {
    border-color: var(--text-primary);
}

.hero-search-input::placeholder {
    color: var(--text-muted);
}

.hero-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}


/* ============================================
   SECTION STYLES
============================================ */
.section {
    padding: 48px 0;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.section-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-link:hover {
    color: var(--text-primary);
}

.section-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   CATEGORY TABS
============================================ */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    white-space: nowrap;
    transition: var(--transition);
}

.category-tab:hover,
.category-tab.active {
    color: var(--bg-primary);
    background: var(--text-primary);
}

/* ============================================
   APP CARDS - GRID
============================================ */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.app-card {
    display: block;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.app-card:hover {
    border-color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

.app-card-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    object-fit: cover;
}

.app-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-developer {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.app-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-card-rating svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   APP CARDS - LIST
============================================ */
.apps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.app-list-item:hover {
    border-color: var(--text-primary);
}

.app-list-rank {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 24px;
}

.app-list-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.app-list-info {
    flex: 1;
    min-width: 0;
}

.app-list-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.app-list-developer {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.app-list-meta {
    text-align: right;
}

.app-list-rating {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.app-list-downloads {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   FEATURED SECTION
============================================ */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.featured-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.featured-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.featured-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.featured-card-meta {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

/* ============================================
   STATS SECTION
============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 48px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   FOOTER
============================================ */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 0 24px;
    transition: var(--transition);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: block;
}

.footer-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-widget h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-widget ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-widget ul li a {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

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

/* ============================================
   SINGLE APK PAGE
============================================ */
.single-apk-header {
    padding: 48px 0;
    border-bottom: 1px solid var(--border-color);
}

.single-apk-top {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.single-apk-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    flex-shrink: 0;
}

.single-apk-info {
    flex: 1;
}

.single-apk-title {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.single-apk-developer {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.single-apk-actions {
    display: flex;
    gap: 12px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
}

.single-apk-meta {
    display: flex;
    gap: 32px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

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

.meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   BREADCRUMB
============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-muted);
}

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

.breadcrumb-separator {
    color: var(--border-color);
}

/* ============================================
   PAGINATION
============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.pagination a:hover,
.pagination span.current {
    color: var(--bg-primary);
    background: var(--text-primary);
    border-color: var(--text-primary);
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 4px;
    }
    
    .nav-menu li a {
        display: block;
        padding: 12px 16px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-brand {
        max-width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .single-apk-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .single-apk-actions {
        justify-content: center;
    }
    
    .single-apk-meta {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .header-inner {
        height: 64px;
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .app-card {
        padding: 16px;
    }
    
    .app-card-icon {
        width: 56px;
        height: 56px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-search-input {
        padding: 14px 100px 14px 16px;
    }
    
    .hero-search-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
}

/* ============================================
   UTILITIES
============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-8 { margin-top: 32px; }
.mb-8 { margin-bottom: 32px; }
