/*
Theme Name: ModdedAndroid Theme
Theme URI: https://moddedandroid.com/
Author: ModdedAndroid
Description: APKPure-styled, ultra-fast, Core Web Vitals focused WordPress theme for ModdedAndroid.com. Features signature APKPure emerald layout, squircle badges, verified checkmarks, and responsive app grids.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: moddedandroid-theme
*/

:root {
    --brand: #24c96a;
    --brand-dark: #1ea857;
    --brand-light: #e8f8ef;
    --brand-glow: rgba(36, 201, 106, 0.25);
    --ink: #1a202c;
    --ink-light: #2d3748;
    --muted: #718096;
    --muted-light: #a0aec0;
    --paper: #ffffff;
    --wash: #f4f6f8;
    --wash-card: #f9fafb;
    --line: #e5e9ee;
    --line-light: #f0f3f6;
    --rating-star: #ff9800;
    --badge-mod: #ff5722;
    --badge-mod-bg: #fff0eb;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-squircle: 22px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 8px rgba(18, 38, 63, 0.06);
    --shadow-hover: 0 10px 24px rgba(18, 38, 63, 0.12);
    --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--wash);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--ink-light); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-hover); }

.wrap { width: min(var(--wrap), calc(100% - 32px)); margin-inline: auto; }

/* ==========================================================================
   Header & Navbar (APKPure Style with Green Accent)
   ========================================================================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.45rem;
    font-weight: 900;
    color: #1a202c;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #24c96a 0%, #1ea857 100%);
    color: #fff;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 900;
    box-shadow: 0 2px 6px var(--brand-glow);
}

.brand span {
    color: var(--brand);
}

.nav ul {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav a {
    color: var(--ink-light);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 0;
    position: relative;
}

.nav a:hover, .nav .current-menu-item > a {
    color: var(--brand);
}

.nav a:hover::after, .nav .current-menu-item > a::after {
    content: "";
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand);
    border-radius: 2px;
}

/* ==========================================================================
   APKPure-style Hero Search Bar Banner
   ========================================================================== */
.hero {
    padding: 38px 0 34px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7f6 100%);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.hero h1 {
    font-size: clamp(1.8rem, 3.8vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0 0 10px;
    color: var(--ink);
}

.hero p {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 660px;
    margin: 0 auto 24px;
}

/* APKPure Search Bar Pill */
form.search {
    display: flex;
    max-width: 580px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid var(--brand);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 4px 14px var(--brand-glow);
    transition: box-shadow 0.2s, border-color 0.2s;
}

form.search:focus-within {
    box-shadow: 0 6px 20px rgba(36, 201, 106, 0.35);
}

form.search label { position: absolute; left: -9999px; }

form.search input {
    min-width: 0;
    flex: 1;
    border: none;
    padding: 13px 22px;
    font: inherit;
    font-size: 0.98rem;
    background: transparent;
    color: var(--ink);
}

form.search input:focus {
    outline: none;
}

form.search button {
    border: none;
    background: var(--brand);
    color: #ffffff;
    padding: 0 26px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

form.search button:hover {
    background: var(--brand-dark);
}

/* ==========================================================================
   Section & Cards Grid (APKPure Style)
   ========================================================================== */
.section {
    padding: 36px 0;
    width: 100%;
}

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

.section-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 4px;
    height: 20px;
    background: var(--brand);
    border-radius: 2px;
    display: inline-block;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

/* APKPure Card Styling */
.card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Squircle App Icon like APKPure */
.app-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-squircle);
    object-fit: cover;
    background: var(--wash-card);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: block;
    margin-bottom: 12px;
}

.card-icon-wrap {
    position: relative;
    display: inline-block;
    width: fit-content;
}

.card-badge-mod {
    position: absolute;
    bottom: 8px;
    right: -4px;
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(255, 65, 108, 0.4);
}

.card h2, .card h3 {
    font-size: 1rem;
    line-height: 1.35;
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.7em;
}

.card-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.card-rating-stars {
    color: var(--rating-star);
    font-size: 0.86rem;
    font-weight: 700;
}

.card-score {
    font-weight: 700;
    color: var(--ink);
}

.card-category {
    color: var(--muted);
    font-size: 0.78rem;
    background: var(--wash);
    padding: 2px 8px;
    border-radius: 4px;
}

.card .meta {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.82rem;
}

.card-dl-pill {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
}

/* ==========================================================================
   APKPure-style Single App Page Layout
   ========================================================================== */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 780px) 340px;
    gap: 28px;
    align-items: start;
    padding: 28px 0 50px;
}

.article, .sidebar-box {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: clamp(20px, 3.5vw, 36px);
    box-shadow: var(--shadow-card);
}

.breadcrumb {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* App Hero Box (APKPure Style Detail Header) */
.app-detail-header {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.app-detail-header .app-icon {
    width: 108px;
    height: 108px;
    border-radius: 26px;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

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

.app-detail-info h1 {
    font-size: clamp(1.4rem, 2.8vw, 1.9rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    font-weight: 800;
    color: var(--ink);
    word-break: break-word;
}

.app-dev-verified {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.dev-name {
    color: var(--brand);
    font-weight: 600;
}

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 750;
    padding: 2px 7px;
    border-radius: 999px;
}

.app-rating-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    margin-top: 6px;
}

.rating-score-box {
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 2px 7px;
    border-radius: 6px;
}

/* APKPure Big Signature Download Button */
.button-apkpure {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(135deg, #24c96a 0%, #1ea857 100%);
    color: #ffffff !important;
    padding: 16px 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.08rem;
    box-shadow: 0 6px 18px var(--brand-glow);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s, background 0.18s;
    cursor: pointer;
    border: none;
    margin: 20px 0;
    text-align: center;
    letter-spacing: -0.01em;
}

.button-apkpure:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(36, 201, 106, 0.4);
    background: linear-gradient(135deg, #27d973 0%, #20b45e 100%);
}

.button-apkpure svg, .button-apkpure span.icon {
    font-size: 1.25rem;
}

/* Technical Specification Table */
.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 22px 0;
}

.facts li {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    font-size: 0.92rem;
    display: flex;
    flex-direction: column;
}

.facts li:nth-child(odd) {
    border-right: 1px solid var(--line);
}

.facts li span.fact-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.facts li span.fact-value {
    color: var(--ink);
    font-weight: 600;
}

/* ModdedAndroid Info Box */
.mod-highlight-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 22px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.mod-highlight-box .mod-shield {
    color: var(--brand-dark);
    font-size: 1.5rem;
    line-height: 1;
}

.mod-highlight-box h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 750;
    color: #166534;
}

.mod-highlight-box p {
    margin: 0;
    font-size: 0.88rem;
    color: #14532d;
}

/* Screenshots Gallery */
.app-screenshots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0 32px;
}

.app-screenshots figure { margin: 0; }
.app-screenshots img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--wash-card);
    box-shadow: var(--shadow-sm);
}

.entry-content {
    line-height: 1.75;
    font-size: 1rem;
    color: #334155;
    margin-top: 24px;
}

.entry-content h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    border-left: 4px solid var(--brand);
    padding-left: 10px;
}

/* Sidebar Styling */
.sidebar-box h2 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-box p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.related-box { margin-top: 24px; }
.related-app {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-light);
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.15s;
}

.related-app:hover {
    transform: translateX(3px);
}

.related-app:last-child { border-bottom: 0; }

.related-app img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--wash);
}

.related-app strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}

.related-app small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #111827;
    color: #9ca3af;
    padding: 44px 0 32px;
    margin-top: 50px;
    border-top: 4px solid var(--brand);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

.footer-brand span { color: var(--brand); }

.footer-menu {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: #9ca3af;
    font-size: 0.9rem;
}

.footer-menu a:hover {
    color: #ffffff;
}

.footer-copy {
    width: 100%;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #1f2937;
    font-size: 0.82rem;
    color: #6b7280;
    text-align: center;
}

/* ==========================================================================
   Download Page Modern Styling
   ========================================================================== */
.download-card {
    text-align: center;
    max-width: 780px;
}

.download-card .breadcrumb {
    text-align: left;
}

.download-card .app-head {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.download-card .app-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.download-card h1 {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--ink);
}

.download-status-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 20px 0;
    font-size: 0.95rem;
    color: var(--ink-light);
    font-weight: 600;
}

.download-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 460px;
    margin: 24px auto;
}

.button-dl-apk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: linear-gradient(135deg, #24c96a 0%, #1ea857 100%);
    color: #ffffff !important;
    padding: 16px 24px;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px var(--brand-glow);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s, background 0.18s;
}

.button-dl-apk:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(36, 201, 106, 0.4);
    background: linear-gradient(135deg, #27d973 0%, #20b45e 100%);
}

.button-dl-apk:disabled, .button-dl-xapk:disabled {
    opacity: 0.8;
    cursor: wait;
    transform: none;
}

.button-dl-xapk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: #ffffff;
    color: #1e293b !important;
    border: 2px solid #cbd5e1;
    padding: 15px 24px;
    border-radius: 999px;
    font-size: 1.02rem;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.18s ease;
}

.button-dl-xapk:hover {
    border-color: #24c96a;
    color: #1ea857 !important;
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(36, 201, 106, 0.15);
}

.button-dl-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.download-info-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 14px;
}

/* Mobile & Responsive */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
}

@media(max-width: 900px) {
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .content-layout { grid-template-columns: 1fr; }
    .app-screenshots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media(max-width: 680px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header-inner { position: relative; }
    .menu-toggle { display: block; }
    .nav { display: none; width: 100%; padding-bottom: 12px; }
    .nav.is-open { display: block; }
    .nav ul { flex-direction: column; gap: 0; }
    .nav li { border-top: 1px solid var(--line); }
    .nav a { padding: 10px 4px; display: block; }
    .facts { grid-template-columns: 1fr; }
    .facts li:nth-child(odd) { border-right: none; }
}

@media(max-width: 440px) {
    .grid { grid-template-columns: 1fr; }
    .app-detail-header { flex-direction: column; align-items: center; text-align: center; }
    .app-dev-verified, .app-rating-badge { justify-content: center; }
}
