/* =============================================================
   APK Page Styles — GeneratePress APK Child Theme
   Primary colour: #6C46DA
   ============================================================= */

/* ----------------------------------------------------------
   Reset GeneratePress defaults on APK pages
---------------------------------------------------------- */
.apk-page-wrapper .entry-header,
.apk-page-wrapper .page-header,
.apk-page-wrapper .breadcrumb-trail { display: none !important; }

.apk-page-wrapper .inside-article,
.apk-page-wrapper .entry-content { padding: 0; margin: 0; }

/* ----------------------------------------------------------
   Layout
---------------------------------------------------------- */
.apk-page-wrapper {
	background: #f5f3ff;
	min-height: 100vh;
	font-family: var(--apk-font);
	color: var(--apk-text);
	-webkit-font-smoothing: antialiased;
	padding-bottom: 90px;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.apk-container { max-width: 820px; width: 100%; margin: 0 auto; padding: 24px 16px; box-sizing: border-box; }
.apk-container--narrow { max-width: 640px; }

/* ----------------------------------------------------------
   Force full-width single-column layout on APK templates.
   GeneratePress reserves a sidebar column by default; this
   guarantees the app card is centered on desktop even if the
   per-page "Layout" setting or cached HTML still expects a
   sidebar.
---------------------------------------------------------- */
body.apk-full-width-template .site-content,
body.apk-full-width-template .content-area,
body.apk-full-width-template #primary,
body.apk-full-width-template #main,
body.apk-full-width-template .inside-article,
body.apk-full-width-template .entry-content {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
}

body.apk-full-width-template .grid-container {
	display: block !important;
	grid-template-columns: 100% !important;
	max-width: 100% !important;
}

body.apk-full-width-template #right-sidebar,
body.apk-full-width-template #left-sidebar,
body.apk-full-width-template .sidebar {
	display: none !important;
}

/* ----------------------------------------------------------
   Play Store-style top bar (hamburger + title + search)
   Replaces the GeneratePress header on APK templates.
---------------------------------------------------------- */
.apk-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #fff;
	padding: 14px 20px;
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 1px 6px rgba(108,70,218,.08);
}
.apk-topbar__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
	transition: background .15s;
}
.apk-topbar__btn:hover { background: #f0ebff; }
.apk-topbar__btn svg { width: 22px; height: 22px; fill: var(--apk-text); }
.apk-topbar__title {
	flex: 1;
	text-align: center;
	font-size: 1rem;
	font-weight: 800;
	color: var(--apk-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.apk-topbar__search-form {
	display: none;
	align-items: center;
	gap: 8px;
	background: #fff;
	padding: 10px 20px 14px;
	border-bottom: 1px solid var(--apk-border);
}
.apk-topbar__search-form.is-open { display: flex; }
.apk-topbar__search-input {
	flex: 1;
	border: 1px solid var(--apk-border);
	background: #f8f6ff;
	border-radius: 10px;
	padding: 9px 14px;
	font-size: .875rem;
	font-family: var(--apk-font);
	outline: none;
}
.apk-topbar__search-input:focus { border-color: #6C46DA; }

/* ----------------------------------------------------------
   Icon / Logo
---------------------------------------------------------- */
.apk-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.apk-icon-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 88px;
	height: 88px;
	background: linear-gradient(135deg, #6C46DA 0%, #9f7aea 100%);
	border-radius: 20px;
	box-shadow: 0 8px 24px rgba(108,70,218,.35);
	flex-shrink: 0;
}

.apk-icon-placeholder span { color: #fff; font-size: 28px; font-weight: 900; letter-spacing: -1px; }
.apk-icon-placeholder--sm { width: 40px; height: 40px; border-radius: 10px; box-shadow: none; }
.apk-icon-placeholder--sm span { font-size: 13px; }

/* ----------------------------------------------------------
   Hero
---------------------------------------------------------- */
.apk-hero {
	background: #fff;
	border-radius: 20px;
	padding: 24px 20px 20px;
	box-shadow: 0 2px 16px rgba(108,70,218,.08);
	margin-bottom: 20px;
}

.apk-hero__top { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.apk-hero__icon { width: 88px; height: 88px; border-radius: 20px; overflow: hidden; flex-shrink: 0; }
.apk-hero__info { flex: 1; min-width: 0; padding-top: 2px; }

.apk-app-name { font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--apk-text); margin: 0 0 4px; }
.apk-developer { font-size: .875rem; font-weight: 600; color: #6C46DA; margin: 0 0 6px; }

/* Stars */
.apk-rating-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.apk-rating-num { font-size: .875rem; font-weight: 700; color: var(--apk-text); }
.apk-stars { display: inline-flex; gap: 1px; }
.apk-star { width: 14px; height: 14px; fill: currentColor; }
.apk-star--full, .apk-star--half { color: #6C46DA; }
.apk-star--empty { color: #e2e8f0; }
.apk-rating-count { font-size: .75rem; color: var(--apk-text-muted); }

/* ----------------------------------------------------------
   Meta strip
---------------------------------------------------------- */
.apk-meta-strip {
	display: flex;
	align-items: center;
	overflow-x: auto;
	margin-bottom: 20px;
	background: #f8f6ff;
	border-radius: 12px;
	padding: 10px 4px;
	-ms-overflow-style: none;
	scrollbar-width: none;
}
.apk-meta-strip::-webkit-scrollbar { display: none; }

.apk-meta-chip { display: flex; flex-direction: column; align-items: center; min-width: 72px; padding: 2px 12px; flex-shrink: 0; }
.apk-meta-chip__label { font-size: .65rem; font-weight: 600; color: var(--apk-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.apk-meta-chip__value { font-size: .8125rem; font-weight: 700; color: var(--apk-text); white-space: nowrap; }
.apk-meta-divider { width: 1px; height: 28px; background: #ddd5f5; flex-shrink: 0; }

/* ----------------------------------------------------------
   Download CTA
---------------------------------------------------------- */
.apk-cta-block { display: flex; flex-direction: column; gap: 10px; }

.apk-btn-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #6C46DA;
	color: #fff !important;
	font-size: 1rem;
	font-weight: 700;
	text-decoration: none !important;
	padding: 14px 28px;
	border-radius: 14px;
	border: none;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(108,70,218,.35);
	transition: background .18s, transform .12s, box-shadow .18s;
	line-height: 1;
	width: 100%;
	text-align: center;
	position: relative;
	overflow: hidden;
}
.apk-btn-download:hover { background: #5a38c0; box-shadow: 0 8px 30px rgba(108,70,218,.45); transform: translateY(-1px); }
.apk-btn-download:active { transform: translateY(0); box-shadow: 0 4px 16px rgba(108,70,218,.3); }
.apk-btn-download--sm { width: auto; padding: 10px 22px; font-size: .875rem; border-radius: 10px; }
.apk-btn-download--xl { font-size: 1.125rem; padding: 16px 36px; border-radius: 16px; }

.apk-btn-icon { width: 20px; height: 20px; fill: #fff; flex-shrink: 0; }

.apk-safe-badge { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--apk-text-muted); }
.apk-safe-badge svg { width: 14px; height: 14px; fill: #22c55e; }

/* ----------------------------------------------------------
   Sections
---------------------------------------------------------- */
.apk-section {
	background: #fff;
	border-radius: 20px;
	padding: 22px 20px;
	box-shadow: 0 2px 16px rgba(108,70,218,.06);
	margin-bottom: 16px;
}
.apk-section__header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.apk-section__title { font-size: 1.0625rem; font-weight: 800; color: var(--apk-text); margin: 0 0 16px; }
.apk-section__header .apk-section__title { margin-bottom: 0; }
.apk-section__count { font-size: .75rem; color: var(--apk-text-muted); font-weight: 500; }

/* ----------------------------------------------------------
   Screenshot slider
---------------------------------------------------------- */
.apk-screenshots-section { padding-bottom: 4px; }

.apk-slider-outer { position: relative; overflow: hidden; margin: 0 -20px; padding: 0 20px 12px; }

.apk-slider-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	cursor: grab;
	-ms-overflow-style: none;
	scrollbar-width: none;
}
.apk-slider-track::-webkit-scrollbar { display: none; }
.apk-slider-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.apk-slide {
	flex-shrink: 0;
	width: 155px;
	height: 290px;
	border-radius: 18px;
	overflow: hidden;
	scroll-snap-align: start;
	box-shadow: 0 4px 16px rgba(108,70,218,.14);
	border: 1px solid rgba(108,70,218,.08);
	background: #ede8fb;
}
.apk-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.apk-slider-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-60%);
	background: #fff;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0,0,0,.15);
	z-index: 10;
	transition: background .15s;
}
.apk-slider-arrow:hover { background: #f0ebff; }
.apk-slider-arrow svg { width: 20px; height: 20px; fill: #6C46DA; }
.apk-slider-arrow--prev { left: 24px; }
.apk-slider-arrow--next { right: 24px; }
.apk-slider-arrow[hidden] { display: none; }

/* ----------------------------------------------------------
   Article content
---------------------------------------------------------- */
.apk-article-content { font-size: .9375rem; line-height: 1.75; color: #374151; }
.apk-article-content h2, .apk-article-content h3 { color: var(--apk-text); font-weight: 700; margin-top: 1.5em; }
.apk-article-content ul, .apk-article-content ol { padding-left: 1.5em; }
.apk-article-content li { margin-bottom: .5em; }
.apk-article-content a { color: #6C46DA; text-decoration: underline; }

/* ----------------------------------------------------------
   Info grid
---------------------------------------------------------- */
.apk-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; margin: 0; }
.apk-info-cell dt { font-size: .75rem; color: var(--apk-text-muted); font-weight: 600; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.apk-info-cell dd { font-size: .875rem; font-weight: 700; color: var(--apk-text); margin: 0; }

/* ----------------------------------------------------------
   Sticky bar
---------------------------------------------------------- */
.apk-sticky-bar {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	z-index: 100;
	background: rgba(255,255,255,.95);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-top: 1px solid rgba(108,70,218,.12);
	padding: 10px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	box-shadow: 0 -4px 20px rgba(108,70,218,.1);
}
.apk-sticky-bar__info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.apk-sticky-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.apk-sticky-bar__name { font-size: .875rem; font-weight: 700; color: var(--apk-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apk-sticky-bar__size { font-size: .75rem; color: var(--apk-text-muted); margin: 2px 0 0; }

/* =============================================================
   DOWNLOAD PAGE
   ============================================================= */
.apk-download-wrapper { background: #f5f3ff; }

.apk-dl-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }

.apk-dl-back {
	display: flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(108,70,218,.12);
	text-decoration: none;
	flex-shrink: 0;
	transition: background .15s;
}
.apk-dl-back:hover { background: #ede8fb; }
.apk-dl-back svg { width: 20px; height: 20px; fill: #6C46DA; }

.apk-dl-nav__title { display: block; font-size: 1rem; font-weight: 800; color: var(--apk-text); line-height: 1; }
.apk-dl-nav__subtitle { display: block; font-size: .75rem; color: var(--apk-text-muted); margin-top: 2px; }

.apk-dl-card {
	display: flex; align-items: center; gap: 16px;
	background: #fff; border-radius: 16px; padding: 18px;
	box-shadow: 0 2px 12px rgba(108,70,218,.08); margin-bottom: 24px;
}
.apk-dl-card__icon { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; flex-shrink: 0; }
.apk-dl-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.apk-dl-card__name { font-size: 1.125rem; font-weight: 800; margin: 0 0 4px; color: var(--apk-text); }
.apk-dl-card__meta { font-size: .8125rem; color: var(--apk-text-muted); font-weight: 500; margin: 0; }

/* Countdown ring */
.apk-countdown-section {
	display: flex; flex-direction: column; align-items: center;
	padding: 32px 16px 28px;
	background: #fff; border-radius: 20px;
	box-shadow: 0 2px 16px rgba(108,70,218,.08);
	margin-bottom: 20px;
}
.apk-ring-wrapper { position: relative; width: 140px; height: 140px; margin-bottom: 20px; }
.apk-ring { width: 140px; height: 140px; }
.apk-ring__track { stroke: #ede8fb; }
.apk-ring__progress { stroke: #6C46DA; transition: stroke-dashoffset .95s linear; }
.apk-ring__num {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	font-size: 3rem; font-weight: 900; color: #6C46DA; letter-spacing: -2px;
}
.apk-countdown-msg { font-size: 1.0625rem; font-weight: 700; color: var(--apk-text); text-align: center; margin: 0 0 6px; }
.apk-countdown-sub { font-size: .8125rem; color: var(--apk-text-muted); text-align: center; margin: 0; }

/* Download action */
.apk-dl-action {
	display: flex; flex-direction: column; align-items: center;
	padding: 28px 20px 24px;
	background: #fff; border-radius: 20px;
	box-shadow: 0 2px 16px rgba(108,70,218,.08);
	margin-bottom: 20px; gap: 16px;
}
.apk-dl-action__ready { font-size: .875rem; font-weight: 600; color: #22c55e; margin: 0; }
.apk-dl-action .apk-btn-download { width: 100%; }

.apk-dl-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.apk-badge {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: .72rem; font-weight: 600; color: var(--apk-text-muted);
	background: #f8f6ff; border: 1px solid #e4dcf9;
	border-radius: 20px; padding: 4px 10px;
}
.apk-badge svg { width: 12px; height: 12px; fill: #6C46DA; }
.apk-dl-details { font-size: .75rem; color: var(--apk-text-muted); margin: 0; }
.apk-no-url { font-size: .875rem; color: #ef4444; text-align: center; padding: 12px; background: #fef2f2; border-radius: 10px; border: 1px solid #fecaca; margin: 0; }
.apk-url-warning { font-size: .8125rem; color: #92400e; text-align: center; padding: 10px 14px; background: #fffbeb; border-radius: 10px; border: 1px solid #fde68a; margin: 12px 0 0; line-height: 1.5; }
.apk-url-warning code { background: #fef3c7; padding: 1px 5px; border-radius: 4px; font-size: .8125em; }

/* Installation guide */
.apk-guide { background: #fffbeb; border: 1px solid #fde68a; border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.apk-guide__header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.apk-guide__header svg { width: 22px; height: 22px; fill: #d97706; flex-shrink: 0; }
.apk-guide__header h2 { font-size: 1rem; font-weight: 800; color: #92400e; margin: 0; }

.apk-guide__steps { padding-left: 0; list-style: none; margin: 0; counter-reset: guide; }
.apk-guide__steps li {
	display: flex; gap: 12px; counter-increment: guide;
	font-size: .875rem; color: #78350f; line-height: 1.5; margin-bottom: 12px;
}
.apk-guide__steps li:last-child { margin-bottom: 0; }
.apk-guide__steps li::before {
	content: counter(guide);
	display: flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; min-width: 22px;
	background: #fcd34d; border-radius: 50%;
	font-size: .7rem; font-weight: 800; color: #78350f; margin-top: 1px;
}

/* Share */
.apk-share { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 12px rgba(108,70,218,.06); text-align: center; }
.apk-share__title { font-size: .9375rem; font-weight: 700; color: var(--apk-text); margin: 0 0 16px; }
.apk-share__buttons { display: flex; align-items: center; justify-content: center; gap: 14px; }

.apk-share-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; border-radius: 50%;
	text-decoration: none; border: none; cursor: pointer;
	transition: transform .15s, opacity .15s;
}
.apk-share-btn:hover { transform: scale(1.1); opacity: .9; }
.apk-share-btn svg { width: 24px; height: 24px; fill: currentColor; }
.apk-share-btn--wa { background: rgba(37,211,102,.12); color: #25d366; }
.apk-share-btn--tg { background: rgba(0,136,204,.12); color: #0088cc; }
.apk-share-btn--link { background: #ede8fb; color: #6C46DA; width: auto; border-radius: 24px; padding: 0 16px; font-size: .75rem; font-weight: 700; gap: 6px; height: 40px; }
.apk-share-btn--link svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */
@media (max-width: 480px) {
	.apk-container { padding: 16px 12px; }
	.apk-hero { padding: 18px 14px 16px; }
	.apk-hero__icon, .apk-icon-placeholder { width: 72px; height: 72px; }
	.apk-app-name { font-size: 1.25rem; }
	.apk-section { padding: 18px 14px; }
}

@media (min-width: 640px) {
	.apk-hero { padding: 28px 28px 24px; }
	.apk-section { padding: 24px 28px; }
	.apk-slide { width: 175px; height: 320px; }
}
