/*
Theme Name: APK Theme
Theme URI: https://example.com/apk-theme
Author: Your Name
Author URI: https://example.com
Description: A fast, SEO-optimized WordPress theme for APK websites with advanced features like APK extractor, screenshot sliders, download timers, and monetization support.
Version: 1.0.0
Requires at least: 5.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apk-theme
Tags: custom-background, threaded-comments, translation-ready, rtl-language-support, featured-images, theme-options, post-formats
*/

/* Design Tokens - التقنية للعرب */
:root {
    /* Typography */
    --font-family-primary: 'Tajawal', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 16px;
    --font-weight-base: 500;
    --font-line-height-base: 1.7;
    --font-size-xs: 12.5px;
    --font-size-sm: 13.5px;
    --font-size-md: 15px;
    --font-size-lg: 17px;
    --font-size-xl: 19px;
    --font-size-2xl: 22px;
    --font-size-3xl: 26px;
    --font-size-4xl: 34px;

    /* Colors */
    --color-text-primary: #172033;
    --color-text-secondary: #64748B;
    --color-text-tertiary: #2563EB;
    --color-text-inverse: #64748B;
    --color-surface-base: #000000;
    --color-surface-muted: #F3F6FC;
    --color-surface-raised: #FFFFFF;
    --color-surface-strong: rgba(37, 99, 235, 0.08);
    --color-border-strong: #E2E8F0;
    --color-primary: #2563EB;
    --color-primary-hover: #1D4ED8;
    --color-primary-active: #1E3A8A;
    --color-dark: #1E3A8A;
    --color-bg: #F3F6FC;
    --color-card: #FFFFFF;
    --success-color: #16A34A;
    --light-color: #F3F6FC;
    --border-color: #E2E8F0;
    --secondary-color: #64748B;
    --shadow: 0 4px 12px rgba(23, 32, 51, 0.06);
    --shadow-lg: 0 14px 34px rgba(30, 58, 138, 0.12);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;

    /* Radius */
    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    /* Shadow */
    --shadow-1: rgba(30, 58, 138, 0.08) 0px 8px 22px 0px;

    /* Motion */
    --motion-duration-instant: 180ms;
    --motion-duration-fast: 200ms;
    --motion-duration-normal: 250ms;
    --motion-duration-slow: 300ms;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-base);
    line-height: var(--font-line-height-base);
    color: var(--color-text-primary);
    background: var(--color-bg);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

a {
    color: var(--color-text-tertiary);
    text-decoration: none;
    transition: color var(--motion-duration-fast) ease;
}

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

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

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

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-3);
}

/* Header */
.site-header {
    background: var(--color-card);
    box-shadow: 0 1px 0 var(--border-color), 0 6px 24px rgba(23, 32, 51, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 800;
    color: var(--color-text-primary);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}

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

.site-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
    color: #fff;
    flex: 0 0 auto;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.site-logo-text {
    color: inherit;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--color-surface-muted);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 4px 4px 4px 14px;
    transition: border-color var(--motion-duration-fast) ease, box-shadow var(--motion-duration-fast) ease;
}

.header-search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-surface-strong);
}

.header-search-field {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    width: 200px;
    outline: none;
}

.header-search-field::placeholder {
    color: var(--color-text-secondary);
}

.header-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
    color: #fff;
    cursor: pointer;
    transition: transform var(--motion-duration-fast) ease, box-shadow var(--motion-duration-fast) ease;
}

.header-search-submit:hover,
.header-search-submit:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

.search-toggle {
    display: none;
    background: var(--color-surface-strong);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    color: var(--color-text-primary);
}

.mobile-menu-toggle {
    display: none;
    background: var(--color-surface-strong);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    color: var(--color-text-primary);
}

.search-toggle:hover,
.search-toggle:focus-visible,
.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background: var(--color-primary);
    color: #fff;
}

.mobile-menu-toggle .icon-close {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

/* Navigation */
.main-navigation {
    flex: 1 1 auto;
}

.main-navigation ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    display: inline-block;
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: var(--font-size-md);
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    transition: all var(--motion-duration-fast) ease;
    text-decoration: none;
    white-space: nowrap;
}

.main-navigation a:hover,
.main-navigation a:focus-visible {
    background: var(--color-surface-strong);
    color: var(--color-primary);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
    color: #fff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

/* Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.search-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    color: var(--color-text-secondary);
}

.search-close:hover,
.search-close:focus-visible {
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-field {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-family-primary);
    transition: all var(--motion-duration-fast) ease;
}

.search-field:focus {
    outline: none;
    border-color: var(--color-text-tertiary);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.search-submit {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    color: white;
}

.search-submit:hover,
.search-submit:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-3xl);
    cursor: pointer;
    color: var(--color-text-primary);
    padding: var(--space-2);
    border-radius: var(--radius-xs);
    transition: background-color var(--motion-duration-fast) ease;
    position: relative;
    width: 40px;
    height: 40px;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background-color: var(--color-surface-strong);
}

.hamburger-icon {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: background-color var(--motion-duration-fast) ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: all var(--motion-duration-fast) ease;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    top: 8px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon {
    background-color: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    color: white;
    padding: var(--space-4) var(--space-3);
    text-align: center;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: var(--space-4);
}

.hero-section h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-3);
    font-weight: var(--font-weight-base);
}

.hero-section p {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
    color: rgba(255, 255, 255, 0.9);
}

/* APK Card Views */
.apk-card-views {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.views-count {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-base);
    color: var(--color-text-tertiary);
}

.views-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* Homepage */
.homepage {
    padding: 28px 0 8px;
}

/* Hero */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: center;
    padding: 48px 40px;
    margin-bottom: 40px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(1200px 400px at 85% -20%, rgba(37, 99, 235, 0.18), transparent 60%),
        linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-active) 55%, var(--color-dark) 100%);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(30, 58, 138, 0.28);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.5;
    pointer-events: none;
}

.hero-text {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin-bottom: 18px;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ADE80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
}

.hero-title {
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 14px;
    color: #fff;
}

.hero-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    max-width: 560px;
    margin: 0 0 26px;
}

.hero-title-highlight {
    display: block;
    background: linear-gradient(90deg, #FDE68A 0%, #FBBF24 50%, #F59E0B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #FBBF24;
    font-size: 0.72em;
    margin-top: 6px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 96px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    backdrop-filter: blur(6px);
}

.hero-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.hero-stat-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md);
    font-weight: 800;
    text-decoration: none;
    transition: all var(--motion-duration-fast) ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: #fff;
    color: var(--color-primary-active);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
    color: var(--color-primary);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background: #fff;
    color: var(--color-primary-active);
    transform: translateY(-2px);
}

/* Featured app card in hero */
.hero-featured {
    position: relative;
    z-index: 1;
    display: block;
    background: rgba(255, 255, 255, 0.97);
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    padding: 26px 24px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    transition: transform var(--motion-duration-normal) ease;
}

.hero-featured:hover {
    transform: translateY(-4px);
}

.hero-featured-badge {
    position: absolute;
    top: -14px;
    inset-inline-start: 20px;
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: 800;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.4);
}

.hero-featured-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin: 8px auto 14px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-surface-muted);
    box-shadow: 0 12px 26px rgba(30, 58, 138, 0.18);
}

.hero-featured-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-featured-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--color-text-primary);
}

.hero-featured .apk-card-rating,
.hero-featured .apk-card-meta {
    justify-content: center;
}

.hero-featured-cta {
    display: inline-block;
    margin-top: 14px;
    color: var(--color-primary);
    font-weight: 800;
    font-size: var(--font-size-sm);
}

/* Homepage sections */
.home-section {
    margin-bottom: 44px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0;
    position: relative;
    padding-inline-start: 18px;
}

.section-title::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-active));
}

.section-desc {
    margin: 6px 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    padding-inline-start: 18px;
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    font-weight: 800;
    font-size: var(--font-size-md);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: var(--color-surface-strong);
    transition: all var(--motion-duration-fast) ease;
    white-space: nowrap;
}

.view-all:hover,
.view-all:focus-visible {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
    color: #fff;
    transform: translateY(-2px);
}

.view-all svg {
    transform: scaleX(-1);
}

/* APK Grid */
.apk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
}

.apk-card {
    background: var(--color-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--motion-duration-normal) ease, box-shadow var(--motion-duration-normal) ease, border-color var(--motion-duration-normal) ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.apk-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.35);
}

.apk-card:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.apk-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 20px auto 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-surface-muted);
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.12);
}

.apk-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apk-card-icon-placeholder {
    color: var(--color-primary);
}

/* Post thumbnail variant (used for articles in search / category) */
.apk-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.apk-card-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.apk-card-title {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.4;
    margin: 14px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.apk-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--motion-duration-fast) ease;
}

.apk-card-title a:hover {
    color: var(--color-primary);
}

.apk-card-rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-size: var(--font-size-sm);
}

.apk-card-stars {
    color: #F59E0B;
    letter-spacing: 1px;
}

.apk-card-rating-value {
    font-weight: 800;
    color: var(--color-text-primary);
}

.apk-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    margin-top: 10px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.apk-card-meta-item {
    background: var(--color-surface-muted);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    white-space: nowrap;
}

.apk-card-excerpt {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-top: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apk-card-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
    color: #fff;
    padding: 11px 24px;
    border-radius: var(--radius-pill);
    text-align: center;
    width: 100%;
    font-size: var(--font-size-md);
    font-weight: 700;
    transition: all var(--motion-duration-fast) ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    margin-top: 16px;
}

.apk-card-button:hover {
    background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary-active));
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
    color: #fff;
}

.apk-card-button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.apk-card-button:active {
    transform: translateY(0);
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.article-card {
    background: var(--color-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--motion-duration-normal) ease, box-shadow var(--motion-duration-normal) ease, border-color var(--motion-duration-normal) ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.35);
}

.article-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-muted);
}

.article-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--motion-duration-slow) ease;
}

.article-card:hover .article-card-media img {
    transform: scale(1.05);
}

.article-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card-cat {
    align-self: flex-start;
    background: var(--color-surface-strong);
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    margin-bottom: 10px;
}

.article-card-title {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--motion-duration-fast) ease;
}

.article-card-title a:hover {
    color: var(--color-primary);
}

.article-card-excerpt {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin: 0 0 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.article-card-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.article-card-link {
    color: var(--color-primary);
    font-weight: 800;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.article-card-link:hover {
    text-decoration: underline;
}

/* Category chips */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.cat-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--color-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 700;
    transition: all var(--motion-duration-fast) ease;
    box-shadow: var(--shadow);
}

.cat-chip:hover,
.cat-chip:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: var(--shadow-lg);
    color: var(--color-primary);
}

.cat-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-chip-count {
    flex: 0 0 auto;
    background: var(--color-surface-strong);
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: 800;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Useful links */
.useful-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.useful-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 12px 22px;
    color: var(--color-text-primary);
    font-weight: 700;
    text-decoration: none;
    transition: all var(--motion-duration-fast) ease;
    box-shadow: var(--shadow);
}

.useful-link svg {
    transform: scaleX(-1);
    color: var(--color-primary);
}

.useful-link:hover,
.useful-link:focus-visible {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}

.useful-link:hover svg {
    color: #fff;
}

/* Single APK Page */
.single-apk-header {
    display: flex;
    gap: 30px;
    margin: 40px 0;
    align-items: flex-start;
}

.apk-icon {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.apk-info {
    flex: 1;
}

.apk-info h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.apk-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.apk-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.download-button {
    display: inline-block;
    background: var(--success-color);
    color: white;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 20px;
}

.download-button:hover {
    background: #218838;
    color: white;
}

/* APK Category Chip */
.apk-category-chip {
    display: inline-block;
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
    transition: all var(--motion-duration-fast) ease;
}

.apk-category-chip:hover,
.apk-category-chip:focus-visible {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    color: white;
}

/* APK Rating */
.apk-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.apk-rating .stars {
    color: #f59e0b;
    font-size: 1.3rem;
    letter-spacing: 2px;
}

.apk-rating strong {
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

.apk-rating .rating-note {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.apk-developer {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

/* APK Details Grid (name, size, publisher, type, category, version) */
.apk-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 28px 0;
    padding: 24px;
    background: var(--color-surface-muted, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 14px);
}

.apk-details-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--color-border, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.apk-details-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.apk-details-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
    word-break: break-word;
}

.apk-details-value a {
    color: var(--color-primary, #2563eb);
    text-decoration: none;
}

.apk-details-value a:hover {
    text-decoration: underline;
}

/* Download Box */
.download-box {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-top: 4px solid var(--color-text-tertiary);
}

.download-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.download-box-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text-primary);
}

.download-box-num {
    font-size: 40px;
    font-weight: 800;
    color: var(--color-surface-strong);
    -webkit-text-stroke: 1px var(--color-border-strong);
}

.download-box-sub {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.download-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
}

.download-links .download-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    transition: all var(--motion-duration-fast) ease;
}

.download-links .download-button.mirror {
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
}

.download-links .download-button.mirror:hover {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    color: white;
}

.download-links .download-button .ext {
    font-size: 1.2rem;
}

.download-links .download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Share Box */
.share-box {
    background: white;
    border-radius: 20px;
    padding: 24px 32px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.share-box h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.social-sharing {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.social-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family-primary);
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    text-decoration: none;
}

.social-share-button.facebook { background: #1877f2; }
.social-share-button.twitter { background: #000000; }
.social-share-button.telegram { background: #229ed9; }
.social-share-button.whatsapp { background: #25d366; }

.social-share-button.copy-link {
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
}

.social-share-button:hover,
.social-share-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.social-share-button.copied {
    background: var(--success-color);
    color: white;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 20px;
    padding: 28px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    align-items: flex-start;
}

.author-avatar img {
    border-radius: 50%;
    width: 72px;
    height: 72px;
}

.author-label {
    font-size: 13px;
    color: var(--color-text-tertiary);
    font-weight: 700;
}

.author-info h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 4px 0 8px;
}

.author-info p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.author-info a {
    font-size: 14px;
    font-weight: 600;
}

/* Related Section */
.related-section {
    margin: 48px 0;
}

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

.related-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text-primary);
}

/* Community Rating */
.community-rating {
    background: white;
    border-radius: 20px;
    padding: 28px;
    margin: 40px 0 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.community-rating h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.community-rating-sub {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Screenshot Slider */
.screenshot-slider {
    margin: 40px 0;
    overflow: hidden;
    position: relative;
}

.screenshot-slider-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 10px 0;
    scrollbar-width: none;
}

.screenshot-slider-track::-webkit-scrollbar {
    display: none;
}

.screenshot-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.screenshot-item img {
    width: 300px;
    height: 533px;
    object-fit: cover;
}

/* Download Timer */
.download-timer {
    background: var(--light-color);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin: 40px 0;
    box-shadow: var(--shadow);
}

.timer-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
    margin: 20px 0;
}

/* FAQ Section */
.faq-section {
    margin: 40px 0;
}

.faq-item {
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: bold;
}

.faq-item.active .faq-question::after {
    content: '-';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 20px 20px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.breadcrumbs a {
    color: var(--secondary-color);
}

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

/* Ad Placement */
.ad-banner {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    background: var(--light-color);
    border: 1px dashed var(--border-color);
}

/* Ad Slots (top / bottom / in-page / gate) */
.ad-slot {
    text-align: center;
}

.ad-slot-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.ad-slot-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* Top ad (above the header) */
.ad-slot-top {
    background: var(--color-surface-raised);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

.ad-slot-top .ad-slot-label {
    margin-bottom: 4px;
}

/* In-page ad (via [apk_ad]) */
.ad-slot-in-page {
    margin: 28px 0;
    padding: 18px;
    background: var(--light-color);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xs);
}

/* Fixed bottom ad bar */
.bottom-ad-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.12);
}

.bottom-ad-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 12px;
    min-height: 56px;
}

.bottom-ad-bar .ad-slot-label {
    margin-bottom: 0;
    white-space: nowrap;
}

.bottom-ad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Reserve space so the fixed bar never covers footer content */
body.has-bottom-ad {
    padding-bottom: 64px;
}

@media (max-width: 768px) {
    body.has-bottom-ad {
        padding-bottom: 84px;
    }
}

/* ============================================================
   Download Gate Modal (AD -> COUNTDOWN -> READY)
   ============================================================ */
.download-gate {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.download-gate[hidden] {
    display: none;
}

.download-gate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.download-gate-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    padding: 32px 28px;
    text-align: center;
    animation: dg-pop 220ms ease;
}

@keyframes dg-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.download-gate-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--light-color);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--motion-duration-fast) ease, color var(--motion-duration-fast) ease;
}

.download-gate-close:hover,
.download-gate-close:focus-visible {
    background: var(--color-primary);
    color: #ffffff;
}

.download-gate-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

.download-gate-state[hidden] {
    display: none;
}

/* AD state */
.download-ad-container {
    margin-bottom: 20px;
}

.download-ad-container .ad-slot-label {
    margin-bottom: 8px;
}

.download-ad-placeholder {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--color-text-secondary);
    font-size: 13px;
}

.download-gate-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--motion-duration-fast) ease, box-shadow var(--motion-duration-fast) ease;
}

.download-gate-continue:hover,
.download-gate-continue:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.35);
}

/* COUNTDOWN state */
.download-gate-status {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

.download-gate-status.ready {
    color: var(--success-color);
}

.countdown-circle {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
}

.countdown-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-track {
    fill: none;
    stroke: var(--color-surface-strong);
    stroke-width: 10;
}

.countdown-progress {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 10;
    stroke-linecap: round;
}

.countdown-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 800;
    color: var(--color-primary);
}

.download-gate-hint {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* READY state */
.download-ready-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(30, 58, 138, 0.4);
    transition: transform var(--motion-duration-fast) ease, box-shadow var(--motion-duration-fast) ease;
}

.download-ready-btn:hover,
.download-ready-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(30, 58, 138, 0.5);
}

/* Prevent background scroll while the gate is open */
body.download-gate-open {
    overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .download-gate-card {
        animation: none;
    }

    .countdown-progress {
        transition: none !important;
    }

    .download-gate-continue,
    .download-ready-btn,
    .download-gate-close {
        transition: none;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .download-gate-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .countdown-circle {
        width: 130px;
        height: 130px;
    }

    .countdown-number {
        font-size: 46px;
    }

    .download-gate-title {
        font-size: 18px;
    }
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, var(--color-dark) 0%, #172554 100%);
    color: #CBD5E1;
    padding: 56px 0 24px;
    margin-top: 64px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 40px;
}

.footer-about-text {
    font-size: var(--font-size-sm);
    color: #B6C2D6;
    line-height: 1.9;
    margin: 0;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.footer-logo .site-logo-mark {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: none;
}

.footer-logo .site-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.footer-logo img {
    max-height: 44px;
    width: auto;
}

.footer-title {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: #fff;
    margin-bottom: 18px;
}

.footer-description {
    font-size: var(--font-size-sm);
    color: #B6C2D6;
    line-height: 1.8;
    margin-bottom: 20px;
    max-width: 340px;
}

.quick-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.quick-links li {
    margin-bottom: 12px;
}

.quick-links a {
    color: #B6C2D6;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color var(--motion-duration-fast) ease, transform var(--motion-duration-fast) ease;
    font-size: var(--font-size-sm);
}

.quick-links a:hover,
.quick-links a:focus-visible {
    color: #fff;
    transform: translateX(-4px);
}

.footer-cats-list a {
    justify-content: space-between;
    width: 100%;
}

.footer-cats-list a:hover,
.footer-cats-list a:focus-visible {
    transform: none;
}

.footer-cats-list .count {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: 800;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-xs);
    color: #fff;
    transition: all var(--motion-duration-fast) ease;
}

.social-link:hover,
.social-link:focus-visible {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-bottom p {
    font-size: var(--font-size-sm);
    color: #94A3B8;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 40px 28px;
    }

    .hero-featured {
        max-width: 420px;
    }

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

    .apk-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        gap: 12px;
    }

    .site-logo {
        font-size: 19px;
    }

    .header-search {
        display: none;
    }

    .search-toggle {
        display: inline-flex;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline: 0;
        background: var(--color-card);
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 16px 30px rgba(23, 32, 51, 0.12);
        border-bottom: 1px solid var(--border-color);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        z-index: 999;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .main-navigation a {
        padding: 12px 18px;
        width: 100%;
        border-radius: var(--radius-xs);
    }

    .hero {
        padding: 32px 22px;
        margin-bottom: 32px;
    }

    .hero-actions {
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .section-head {
        flex-wrap: wrap;
    }

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

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

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

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .site-footer {
        padding: 40px 0 20px;
        margin-top: 40px;
    }
}

@media (max-width: 480px) {
    .apk-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .apk-card-icon {
        width: 60px;
        height: 60px;
        margin-top: 16px;
    }

    .apk-card-content {
        padding: 14px 12px 16px;
    }

    .apk-card-title {
        font-size: var(--font-size-md);
        min-height: 2.8em;
    }

    .apk-card-meta {
        font-size: var(--font-size-xs);
    }

    .apk-card-excerpt {
        font-size: var(--font-size-xs);
    }

    .apk-card-button {
        padding: 10px 12px;
        font-size: var(--font-size-sm);
    }

    .hero {
        padding: 28px 18px;
    }

    .hero-featured-icon {
        width: 80px;
        height: 80px;
    }

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

    .useful-link {
        width: 100%;
        justify-content: center;
    }
}

/* RTL Support - Default is RTL for التقنية للعرب */
body.ltr {
    direction: ltr;
    text-align: left;
}

.ltr .apk-meta {
    flex-direction: row;
}

.ltr .main-navigation {
    flex-direction: row;
}

.ltr .apk-card-meta {
    flex-direction: row;
}

.ltr .faq-question::after {
    content: '+';
}

.ltr .faq-item.active .faq-question::after {
    content: '−';
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.apk-card {
    animation: fadeIn 0.5s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Archive Header */
.archive-header {
    margin: 24px 0;
}

.archive-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.archive-description {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.pagination .nav-links {
    display: flex;
    gap: 8px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    background: white;
    border: 1px solid var(--color-border-strong);
    border-radius: 12px;
    color: var(--color-text-secondary);
    font-weight: 600;
    transition: all var(--motion-duration-fast) ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers:focus-visible {
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
}

.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    border-color: transparent;
    color: white;
}

/* Sidebar */
.sidebar {
    margin-top: 40px;
}

.sidebar .widget {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.sidebar .widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border-strong);
}

.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .widget ul li {
    margin-bottom: 10px;
}

.sidebar .widget ul li a {
    color: var(--color-text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--motion-duration-fast) ease;
}

.sidebar .widget ul li a:hover,
.sidebar .widget ul li a:focus-visible {
    color: var(--color-text-tertiary);
}

.sidebar .widget p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* Page Content */
.page-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    line-height: 1.8;
}

.page-content h1,
.page-content h2,
.page-content h3 {
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.page-content p {
    margin-bottom: 16px;
    color: var(--color-text-secondary);
}

.page-content ul,
.page-content ol {
    margin: 0 0 16px 24px;
    color: var(--color-text-secondary);
}

.page-content img {
    border-radius: 12px;
    margin: 16px 0;
}

/* Single Post / Blog */
.entry-header {
    margin: 24px 0;
}

.entry-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.entry-meta {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.entry-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 16px;
    color: var(--color-text-secondary);
}

.entry-content img {
    border-radius: 12px;
    margin: 16px 0;
}

/* Search Results */
.search-results-header {
    margin: 24px 0;
}

.search-results-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text-primary);
}

.search-results-header p {
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* 404 */
.error-404 {
    text-align: center;
    padding: 80px 24px;
}

.error-404 h1 {
    font-size: 21px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.error-404 p {
    font-size: 18px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.error-404 a {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    color: white;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    transition: all var(--motion-duration-fast) ease;
}

.error-404 a:hover,
.error-404 a:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

/* Comments */
.comments-area {
    margin-top: 48px;
}

.comments-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .comment {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.comment-list .children {
    list-style: none;
    margin: 16px 0 0 32px;
    padding: 0;
}

.comment-author {
    font-weight: 700;
    color: var(--color-text-primary);
}

.comment-metadata {
    font-size: 13px;
    margin-bottom: 8px;
}

.comment-metadata a {
    color: var(--color-text-secondary);
}

.comment-content {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.comment-reply-link {
    font-size: 13px;
    font-weight: 600;
}

.comment-form {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.comment-form label {
    display: block;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border-strong);
    border-radius: 12px;
    font-family: var(--font-family-primary);
    font-size: 14px;
    margin-bottom: 16px;
    transition: all var(--motion-duration-fast) ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-text-tertiary);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.comment-form .submit {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
}

.comment-form .submit:hover,
.comment-form .submit:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: 24px 0;
}

.no-comments {
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

/* Mirror Links */
.mirror-links {
    margin: 40px 0;
}

.mirror-links h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.mirror-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mirror-links li a {
    display: inline-block;
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--motion-duration-fast) ease;
}

.mirror-links li a:hover,
.mirror-links li a:focus-visible {
    background: linear-gradient(135deg, var(--color-text-tertiary), #3b82f6);
    color: white;
    transform: translateY(-2px);
}

/* APK Description */
.apk-description {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.apk-description h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.apk-description p {
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.apk-faq h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.screenshot-slider h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.download-timer h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Custom Logo */
.custom-logo {
    max-height: 60px;
    width: auto;
}

/* Footer Widgets */
.footer-widgets .widget {
    margin-bottom: 24px;
}

.footer-widgets .widget:last-child {
    margin-bottom: 0;
}

.footer-widgets .widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

.footer-widgets ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-widgets ul li {
    margin-bottom: 12px;
}

.footer-widgets ul li a {
    color: var(--color-text-secondary);
    font-size: 14px;
    transition: color var(--motion-duration-fast) ease;
}

.footer-widgets ul li a:hover,
.footer-widgets ul li a:focus-visible {
    color: var(--color-text-tertiary);
}

.footer-widgets p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.category-count-item {
    text-decoration: none;
}
