/* Altis ASO – Top Apps by Keyword – Tryaltis/Blocksy style */

/* Use theme variables when available (Blocksy), fallbacks for standalone */
.altis-top-apps-page {
	--altis-primary: var(--theme-palette-color-1, #4c29a3);
	--altis-primary-hover: var(--theme-palette-color-2, #2596be);
	--altis-text: var(--theme-text-color, var(--theme-palette-color-3, #d2d7dc));
	--altis-headings: var(--theme-headings-color, var(--theme-palette-color-4, #ffffff));
	--altis-muted: var(--theme-palette-color-3, rgba(255, 255, 255, 0.6));
	--altis-bg: var(--theme-palette-color-8, #0e0e0e);
	--altis-card-bg: var(--theme-palette-color-6, #161d15);
	--altis-border: var(--theme-border-color, var(--theme-palette-color-7, rgba(255, 255, 255, 0.1)));
	--altis-radius: var(--theme-border-radius, 12px);
	--altis-shadow: 0px 12px 18px -6px rgba(34, 56, 101, 0.04);
	--altis-up: #16a34a;
	--altis-down: #dc2626;
	--altis-new: #0891b2;
	--altis-out: #64748b;
	--altis-font: var(--theme-font-family, Manrope, -apple-system, BlinkMacSystemFont, sans-serif);
}

.altis-top-apps-page {
	max-width: var(--theme-normal-container-max-width, 1290px);
	margin: 0 auto;
	padding: 180px 0 var(--theme-content-vertical-spacing, 60px);
	font-family: var(--altis-font);
	color: var(--altis-text);
}

.altis-top-apps-header {
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--altis-border);
}

.altis-top-apps-title {
	font-size: var(--theme-font-size, 40px);
	font-weight: var(--theme-font-weight, 800);
	line-height: 1.3;
	margin: 0 0 0.5rem 0;
	color: var(--altis-headings);
}

.altis-top-apps-meta {
	margin: 0;
	font-size: 0.95rem;
	color: var(--altis-muted);
}

.altis-meta-item + .altis-meta-item::before {
	content: " · ";
}

.altis-country-filter a { color: var(--altis-muted); text-decoration: none; }
.altis-country-filter a:hover { color: var(--altis-primary); }
.altis-country-filter .altis-country-current { color: var(--altis-primary); font-weight: 600; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.altis-country-select {
	margin: 0 0.5rem 0 0;
	padding: 0.25em 0.5em;
	font-size: 0.8rem;
	color: var(--altis-text);
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	border-radius: 6px;
	cursor: pointer;
	max-height: 2rem;
}
.altis-country-select:hover,
.altis-country-select:focus {
	border-color: var(--altis-primary);
	outline: none;
}
.altis-app-name-link { color: inherit; text-decoration: none; }
.altis-app-name-link:hover { color: var(--altis-primary); }

/* KPIs – card style, wider so values don’t wrap, centered */
.altis-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.25rem;
	margin-bottom: 2.5rem;
	justify-items: center;
}

.altis-kpis .altis-kpi-card {
	min-width: 180px;
	max-width: 220px;
}

.altis-kpi-card {
	background: var(--altis-card-bg);
	border-radius: var(--altis-radius);
	box-shadow: var(--altis-shadow);
	padding: 1.25rem 1.5rem;
	text-align: center;
	border: 1px solid var(--altis-border);
	box-sizing: border-box;
}

.altis-kpi-value {
	display: block;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--altis-primary);
	line-height: 1.2;
	white-space: nowrap;
}

.altis-kpi-label {
	display: block;
	font-size: 0.75rem;
	color: var(--altis-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-top: 0.35rem;
}

.altis-section {
	margin-bottom: 2.5rem;
}

.altis-section-title {
	font-size: var(--theme-font-size, 25px);
	font-weight: 800;
	margin: 0 0 1rem 0;
	color: var(--altis-headings);
}

/* Table */
.altis-table-wrap {
	overflow-x: auto;
	border-radius: var(--altis-radius);
	box-shadow: var(--altis-shadow);
	border: 1px solid var(--altis-border);
	background: var(--altis-card-bg);
}

.altis-apps-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.altis-apps-table th,
.altis-apps-table td {
	padding: 0.85rem 1.25rem;
	text-align: left;
	border-bottom: 1px solid var(--altis-border);
}

.altis-apps-table th {
	background: rgba(255, 255, 255, 0.03);
	font-weight: 600;
	color: var(--altis-muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.altis-apps-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.04);
}

.altis-col-pos { width: 2.5rem; font-weight: 600; color: var(--altis-muted); }

.altis-col-app {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.altis-app-icon {
	width: 52px;
	height: 52px;
	border-radius: 10px;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(76, 41, 163, 0.35);
}

.altis-col-movement { white-space: nowrap; }

.altis-mov {
	display: inline-block;
	padding: 0.2em 0.5em;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
}

.altis-mov-up { background: rgba(22, 163, 74, 0.2); color: var(--altis-up); }
.altis-mov-down { background: rgba(220, 38, 38, 0.15); color: var(--altis-down); }
.altis-mov-new { background: rgba(8, 145, 178, 0.2); color: var(--altis-new); }
.altis-mov-out { background: rgba(100, 116, 139, 0.2); color: var(--altis-out); }
.altis-mov-same { color: var(--altis-muted); }

.altis-review-count { color: var(--altis-muted); font-size: 0.85em; }

.altis-btn {
	display: inline-block;
	padding: 0.5em 1em;
	border-radius: var(--theme-button-border-radius, 7px);
	font-size: var(--theme-button-font-size, 14px);
	font-weight: var(--theme-button-font-weight, 600);
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
	background: var(--theme-button-background-initial-color, var(--altis-primary));
	color: #ffffff !important;
	border: var(--theme-button-border, none);
}

.altis-btn:hover {
	background: var(--theme-button-background-hover-color, var(--altis-primary-hover));
	color: #ffffff !important;
}

.altis-btn-store {
	background: var(--theme-button-background-initial-color, var(--altis-primary));
	color: #ffffff !important;
}

.altis-btn-store:hover {
	background: var(--theme-button-background-hover-color, var(--altis-primary-hover));
	color: #ffffff !important;
}

/* Movements */
.altis-movements-period {
	margin: 0 0 1rem 0;
	font-size: 0.9rem;
	color: var(--altis-muted);
}

.altis-movements-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
}

.altis-movements-card {
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	border-radius: var(--altis-radius);
	padding: 1.25rem 1.5rem;
	box-shadow: var(--altis-shadow);
}

.altis-movements-card h3 {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 0.75rem 0;
	color: var(--altis-headings);
}

.altis-movements-card ul { margin: 0; padding: 0; list-style: none; }
.altis-movements-card li {
	font-size: 0.875rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--altis-border);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.altis-movements-card li:last-child { border-bottom: none; }

.altis-movements-in { border-left: 3px solid var(--altis-new); }
.altis-movements-out { border-left: 3px solid var(--altis-out); }
.altis-movements-changes { border-left: 3px solid var(--altis-primary); }

/* Chart – tryaltis style */
.altis-chart-section .altis-section-title { margin-bottom: 1rem; }
.altis-chart-wrap {
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	border-radius: var(--altis-radius);
	padding: 1.5rem;
	box-shadow: var(--altis-shadow);
	max-width: 100%;
	min-height: 280px;
	position: relative;
}
.altis-chart-wrap canvas {
	display: block;
	max-width: 100% !important;
	width: 100% !important;
	height: auto !important;
	min-height: 260px;
}
.altis-chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--altis-border);
}
.altis-chart-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	max-width: 100%;
}
.altis-chart-legend-icon {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background-size: cover;
	background-position: center;
	flex-shrink: 0;
}
.altis-chart-legend-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}
.altis-chart-legend-name {
	font-size: 0.9rem;
	color: var(--altis-muted);
	white-space: normal;
	word-break: break-word;
	max-width: 200px;
}
@media (max-width: 689.98px) {
	.altis-chart-wrap { min-height: 240px; padding: 1rem; }
	.altis-chart-wrap canvas { min-height: 220px; }
	.altis-chart-legend-name { max-width: 140px; }
}

.altis-evolution-empty {
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	border-radius: var(--altis-radius);
	padding: 2rem;
	text-align: center;
	color: var(--altis-muted);
	font-size: 0.95rem;
}

.altis-snapshot-date { font-size: 0.9rem; color: var(--altis-muted); margin: 0 0 0.5rem 0; }
.altis-snapshot-list { margin: 0; padding-left: 1.5rem; }
.altis-snapshot-list li { margin-bottom: 0.25rem; }

/* Empty state */
.altis-top-apps-empty {
	background: var(--altis-card-bg);
	border-radius: var(--altis-radius);
	padding: 2.5rem;
	text-align: center;
	color: var(--altis-muted);
	border: 1px solid var(--altis-border);
}

.altis-top-apps-empty a { color: var(--altis-primary); text-decoration: none; }
.altis-top-apps-empty a:hover { text-decoration: underline; }

/* Listing – cards like blog entries */
.altis-seo-content {
	line-height: 1.7;
	margin-top: 2.5rem;
	margin-bottom: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--altis-border);
	max-width: 100%;
	column-count: 2;
	column-gap: 3rem;
	column-fill: balance;
}
.altis-seo-content .altis-seo-h2,
.altis-seo-content .altis-seo-h3 {
	break-after: avoid;
}
.altis-seo-content p {
	break-inside: avoid;
}
@media (max-width: 768px) {
	.altis-seo-content { column-count: 1; }
}
.altis-seo-content p { margin-bottom: 1rem; }
.altis-seo-content p:last-child { margin-bottom: 0; }
.altis-seo-content .altis-seo-h2 {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 2rem 0 0.75rem;
	color: var(--altis-headings);
}
.altis-seo-content .altis-seo-h2:first-child { margin-top: 0; }
.altis-seo-content .altis-seo-h3 {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 1.5rem 0 0.5rem;
	color: var(--altis-headings);
}

.altis-listing-page .altis-top-apps-header { margin-bottom: 2.5rem; }

.altis-listing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

.altis-listing-card {
	display: block;
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	border-radius: var(--altis-radius);
	box-shadow: var(--altis-shadow);
	padding: 1.5rem;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.altis-listing-card:hover {
	box-shadow: 0px 12px 24px -8px rgba(76, 41, 163, 0.25);
	border-color: var(--altis-primary);
	transform: translateY(-2px);
}

.altis-listing-card-title {
	font-size: 1.2rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
	color: var(--altis-headings);
}

.altis-listing-card-subtitle-line {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.altis-listing-card-subtitle {
	font-size: 0.85rem;
	color: var(--altis-muted);
	margin: 0;
}
.altis-listing-card-tag {
	font-size: 0.7rem;
	color: var(--altis-muted);
	background: rgba(255, 255, 255, 0.08);
	padding: 0.2em 0.5em;
	border-radius: 4px;
}
.altis-listing-view-more {
	font-size: 0.8rem;
	color: #ffffff;
	align-self: center;
	margin-left: 0.25rem;
}

.altis-listing-card-icons {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.altis-listing-icon-wrap { flex-shrink: 0; }

.altis-listing-icon {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	display: block;
	object-fit: cover;
	box-shadow: 0 4px 12px rgba(76, 41, 163, 0.35);
}

.altis-listing-icon-placeholder {
	background: rgba(255, 255, 255, 0.06);
	border: 1px dashed var(--altis-border);
	box-shadow: 0 4px 12px rgba(76, 41, 163, 0.2);
}

.altis-listing-card-cta {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--altis-primary);
}

.altis-listing-card-cta.altis-listing-card-btn {
	display: inline-block;
	margin-top: 0.25rem;
	padding: 0.5em 1em;
	border-radius: var(--theme-button-border-radius, 7px);
	background: rgba(76, 41, 163, 0.15);
	border: 1px solid var(--altis-primary);
	transition: background 0.2s, border-color 0.2s;
	color: #ffffff !important;
}

.altis-listing-card:hover .altis-listing-card-btn {
	background: rgba(76, 41, 163, 0.25);
	border-color: var(--altis-primary-hover);
}

/* App page */
.altis-app-intro {
	margin-bottom: 1.5rem;
}
.altis-app-intro-title {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 0.5rem 0;
	color: var(--altis-headings);
}
.altis-app-intro-text {
	margin: 0;
	color: var(--altis-text);
	line-height: 1.6;
}
.altis-app-explore .altis-btn { margin-top: 0.5rem; }

.altis-app-page .altis-app-hero {
	display: flex;
	align-items: flex-start;
	gap: 1.75rem;
	margin-bottom: 2.5rem;
	padding: 1.75rem;
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	border-radius: var(--altis-radius);
	box-shadow: var(--altis-shadow);
}

.altis-app-hero-icon {
	width: 120px;
	height: 120px;
	border-radius: 22px;
	flex-shrink: 0;
	box-shadow: 0 6px 20px rgba(76, 41, 163, 0.4);
}

.altis-app-hero-title {
	font-size: 1.75rem;
	font-weight: 800;
	margin: 0 0 0.5rem 0;
	color: var(--altis-headings);
}

.altis-app-hero-meta { font-size: 0.9rem; color: var(--altis-muted); margin-bottom: 0.5rem; }
.altis-app-hero-meta span + span::before { content: " · "; }
.altis-app-meta-label { font-weight: 600; color: var(--altis-text); margin-right: 0.25em; }
.altis-app-lang-tags { display: inline-flex; flex-wrap: wrap; gap: 0.35em; }
.altis-app-lang-tag {
	display: inline-block;
	font-size: 0.75rem;
	padding: 0.2em 0.5em;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--altis-muted);
}
.altis-app-hero-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.altis-btn-developer {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid var(--altis-border);
	color: var(--altis-text) !important;
}
.altis-btn-developer:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: var(--altis-primary);
	color: var(--altis-primary) !important;
}
.altis-app-section-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 1.5rem 0 0.75rem 0;
	color: var(--altis-headings);
}

.altis-app-rankings-list { list-style: none; padding: 0; margin: 0; }
.altis-app-rankings-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--altis-border);
}
.altis-app-rankings-list li:last-child { border-bottom: none; }
.altis-app-rankings-list a { color: var(--altis-primary); text-decoration: none; }
.altis-app-rankings-list a:hover { text-decoration: underline; }

.altis-app-screenshots { margin-top: 2rem; }
.altis-app-screenshots-switch-wrap {
	display: flex;
	gap: 0;
	margin-bottom: 0.75rem;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	padding: 3px;
	width: fit-content;
	border: 1px solid var(--altis-border);
}
.altis-app-screenshots-switch {
	padding: 0.35em 0.85em;
	font-size: 0.8rem;
	color: var(--altis-muted);
	background: transparent;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: color 0.2s, background 0.2s;
}
.altis-app-screenshots-switch:hover {
	color: var(--altis-text);
}
.altis-app-screenshots-switch.active {
	background: var(--altis-card-bg);
	color: var(--altis-primary);
	font-weight: 600;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.altis-app-screenshots-box {
	max-width: 100%;
	height: 224px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	border-radius: 16px;
	padding: 12px 8px;
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	box-shadow: var(--altis-shadow);
}
.altis-app-screenshots-list {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	list-style: none;
	padding: 0;
	margin: 0;
	min-height: 0;
	align-items: center;
}
.altis-app-screenshot-wrap {
	flex-shrink: 0;
	width: 100px;
	height: 200px;
	scroll-snap-align: start;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--altis-border);
	background: var(--altis-bg);
	display: flex;
	align-items: center;
	justify-content: center;
}
@media (min-width: 690px) {
	.altis-app-screenshots-box { height: 302px; padding: 14px 10px; }
	.altis-app-screenshot-wrap { width: 135px; height: 270px; }
}
.altis-app-screenshot-btn {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	cursor: pointer;
	border-radius: inherit;
}
.altis-app-screenshot-btn:focus {
	outline: 2px solid var(--altis-primary);
	outline-offset: 2px;
}
.altis-app-screenshot-wrap img.altis-app-screenshot {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: top center;
	pointer-events: none;
}
.altis-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0,0,0,0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
}
.altis-lightbox.altis-lightbox-open {
	opacity: 1;
	visibility: visible;
}
.altis-lightbox-inner {
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.altis-lightbox-inner img {
	max-width: 100%;
	max-height: calc(100vh - 4rem);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
}
.altis-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 44px;
	height: 44px;
	border: none;
	background: rgba(255,255,255,0.15);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s;
}
.altis-lightbox-close:hover {
	background: rgba(255,255,255,0.25);
}

.altis-app-cta {
	margin-top: 2rem;
}
.altis-app-cta-inner {
	max-width: 520px;
	padding: 1.5rem 1.75rem;
	border-radius: 16px;
	background: var(--altis-card-bg);
	border: 1px solid var(--altis-border);
	box-shadow: var(--altis-shadow);
}
.altis-app-cta-inner.altis-app-cta-grid {
	max-width: 100%;
	display: grid;
	grid-template-columns: minmax(0, 380px) 1fr;
	gap: 2rem;
	align-items: start;
}
.altis-app-cta-primary { min-width: 0; }
.altis-app-cta-text {
	margin: 0.75rem 0 1.25rem 0;
	color: var(--altis-muted);
	line-height: 1.5;
}
.altis-app-cta-seo-text {
	margin: 0;
	color: var(--altis-muted);
	line-height: 1.6;
	font-size: 0.95rem;
}
.altis-btn-cta {
	display: inline-block;
}

.altis-latest-apps-seo-content {
	margin-top: 2.5rem;
	max-width: 72ch;
	line-height: 1.65;
}
.altis-latest-apps-seo-content h2 { margin-top: 1.75rem; margin-bottom: 0.5rem; }
.altis-latest-apps-seo-content h3 { margin-top: 1.25rem; margin-bottom: 0.4rem; }
.altis-latest-apps-seo-content p { margin-bottom: 1rem; }

.altis-breadcrumb {
	font-size: 0.85rem;
	color: var(--altis-muted);
	margin-bottom: 1.25rem;
}

.altis-breadcrumb a { color: var(--altis-muted); text-decoration: none; }
.altis-breadcrumb a:hover { color: var(--altis-primary); }

.altis-muted { color: var(--altis-muted); }

@media (max-width: 999.98px) {
	.altis-top-apps-title { font-size: 35px; }
	.altis-kpis { grid-template-columns: repeat(2, 1fr); }
	.altis-apps-table th:nth-child(n+4),
	.altis-apps-table td:nth-child(n+4) { display: none; }
	.altis-movements-grid { grid-template-columns: 1fr; }
	.altis-listing-grid { grid-template-columns: 1fr; }
	.altis-app-hero { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 689.98px) {
	.altis-top-apps-title { font-size: 30px; }
	.altis-top-apps-page { padding: 40px 0; }
	.altis-app-screenshots-box { height: 184px; }
	.altis-app-screenshot-wrap { width: 80px; height: 160px; }
	.altis-app-cta-inner { padding: 1.25rem 1.25rem; }
	.altis-app-cta-inner.altis-app-cta-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
