/* Fonts */
@font-face {
	font-family: "Lato";
	font-weight: 400;
	src: url("LatoLatin-Regular.woff2");
}

@font-face {
	font-family: "Lato";
	font-weight: 700;
	src: url("LatoLatin-Bold.woff2");
}

@font-face {
	font-family: "Lato";
	font-weight: 900;
	src: url("LatoLatin-Black.woff2");
}

/* Theme */
:root,
.theme-light {
	--body-color: #000;
	--primary: #fbc500;
	--bg-secondary: #F5F5F5;
	--bg-tertiary: #D2D3D5;
	--control-active: #D2D3D5;
	--control: #62656C;
	--success: #00B831;
	--success-muted: #E0FFE8;
	--danger: #F20000;
	--danger-muted: #FFDEDE;
	--border-color: yellow;
	--column-border-color: red;
}

.theme-dark {
	--body-color: #fff;
	--border-color: #444;
	--column-border-color: #666;
	--bg-secondary: #161616;
	--bg-tertiary: #292929;
	--control-active: #FFFFFF;
	--control: rgba(255, 255, 255, 0.1);
}

:root {
	font-size: calc(11px * var(--scale, 1));
}

/* Base */
html,
body {
	margin: 0;
	padding: 0;
}

body {
	font-family: "Lato", Arial, sans-serif;
	font-weight: 400;
	line-height: 1.42857;
	margin: 0;
	padding: 0;
	text-rendering: optimizeLegibility;
	color: var(--body-color);
	overflow: hidden;
}

h1 {
	font-size: 24px;
	font-weight: 900;
}

@media (min-width: 768px) {
	h1 {
		font-size: 32px;
	}
}

/* Helpers */
.text-muted {
	color: var(--bg-tertiary);
}

.bg-muted {
	background-color: var(--bg-tertiary);
}

.position-relative {
	position: relative;
}

.stretched-link::after {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	content: "";
}

.z-1 {
	z-index: 1;
}

.z-2 {
	z-index: 2;
}

/* Widget */
.widget {
	display: block;
	width: 100%;
	box-sizing: border-box;
	max-width: 992px;
	margin: auto;
}

.widget a {
	text-decoration: none;
}

/* Header */
.header {
	padding: 0 1rem;
	gap: 1rem;
	margin-bottom: 1rem;
}

.header-title {
	position: relative;
}

.charts-view-module .header {
	justify-content: center;
}

@media (min-width: 768px) {
	.header {
		display: flex;
		align-items: center;
		font-size: 24px;
	}

	.header-title {
		padding-right: 1rem;
	}

	.header-title::after {
		content: "";
		position: absolute;
		right: 0;
		top: 0;
		bottom: 0;
		width: 1px;
		background: currentColor;
		opacity: 0.75;
	}
}

/* Titles (default grid) */
.titles {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);
  width: 100%;
  align-items: stretch;
  gap: 0;
}

/* Below 768px: single column (mobile) */
@media (max-width: 767px) {
  .titles {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: 1fr;
  }
}

/* 768px and above: 5 columns */
@media (min-width: 768px) {
  .titles {
    grid-auto-flow: column;
    grid-template-rows: repeat(5, auto);
  }
}

/* MODULE VIEW: horizontal scroller - keep existing module view styles */
.charts-view-module .titles {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding: 0 0.5rem;
  padding-bottom: 0;
}
/* hide scrollbars */
.charts-view-module .titles::-webkit-scrollbar {
	height: 8px;
}

.charts-view-module .titles::-webkit-scrollbar-thumb {
	background: transparent;
}

.charts-view-module .titles {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.charts-view-module .titles::-webkit-scrollbar {
	display: none;
}

/* Each slide */
.charts-view-module .title-row {
	flex: 0 0 auto;
	display: flex;
	box-sizing: border-box;
	min-height: 80px;
	padding: 0.5rem;
	margin: 0;
}

/* Mobile: up to 575px (2 slides) */
@media (max-width: 575px) {
	.charts-view-module .titles {
		gap: 0.5rem;
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}

	.charts-view-module .title-row {
		width: calc((100% - 0.5rem) / 2);
		scroll-snap-align: start;
	}

	.chart-bullet {
		display: none;
	}

	.chart-bullet:nth-child(2n+1) {
		display: inline-block;
	}
}

/* Tablet: 576px to 767px (3 slides) */
@media (min-width: 576px) and (max-width: 767px) {
	.charts-view-module .titles {
		gap: 0.5rem;
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}

	.charts-view-module .title-row {
		width: calc((100% - 1rem) / 3);
		scroll-snap-align: none;
	}

	.chart-bullet {
		display: none;
	}

	.chart-bullet:nth-child(3n+1) {
		display: inline-block;
	}
}

/* Desktop: 768px+ (5 slides) */
@media (min-width: 768px) {
	.charts-view-module .titles {
		gap: 0.5rem;
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}

	.charts-view-module .title-row {
		width: calc((100% - 2rem) / 5);
		scroll-snap-align: none;
	}

	.charts-view-module .title-row:nth-child(5n+1) {
		scroll-snap-align: start;
	}

	.chart-bullet {
		display: none;
	}

	.chart-bullet:nth-child(5n+1) {
		display: inline-block;
	}
}

/* Scroll-snap grouping */
@media (max-width: 575px) {
	.charts-view-module .title-row {
		scroll-snap-align: none;
	}

	.charts-view-module .title-row:nth-child(2n+1) {
		scroll-snap-align: start;
	}
}

@media (min-width: 576px) and (max-width: 767px) {
	.charts-view-module .title-row {
		scroll-snap-align: none;
	}

	.charts-view-module .title-row:nth-child(3n+1) {
		scroll-snap-align: start;
	}
}

@media (min-width: 768px) {
	.charts-view-module .title-row {
		scroll-snap-align: none;
	}

	.charts-view-module .title-row:nth-child(5n+1) {
		scroll-snap-align: start;
	}
}

/* Bullets container */
.chart-bullets {
	display: none; /* Hide for list view */
}

.charts-view-module .chart-bullets {
	flex: 0 0 100%;
	order: 9999;
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 0.5rem 0 0.75rem 0;
	box-sizing: border-box;
	align-items: center;
	background: transparent;
}


/* Bullets */
.chart-bullet {
	width: 8px;
	height: 8px;
	background: var(--control);
	border-radius: 50%;
	flex: 0 0 auto;
}

.chart-bullet.is-active {
	background-color: var(--control-active);
	transform: scale(1.2);
	transition: all 0.2s ease;
}

.chart-bullet:hover {
	cursor: pointer;
}

/* Title row general */
.title-row {
	display: flex;
	padding: 0.5rem;
	box-sizing: border-box;
	background-color: transparent;
	min-height: 80px;
	position: relative;
}

/* Mobile row borders */
@media (max-width: 767px) {
	.title-row:not(:last-child)::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 1px;
		background-color: var(--bg-tertiary, #d1d1d1);
	}

	.title-row:last-child::after {
		display: none;
	}
}

/* Hide border in module */
.charts-view-module .title-row::after {
	display: none;
}

/* Alternating backgrounds */
.title-row:nth-child(10n+1),
.title-row:nth-child(10n+3),
.title-row:nth-child(10n+5),
.title-row:nth-child(10n+11),
.title-row:nth-child(10n+13),
.title-row:nth-child(10n+15) {
	background-color: var(--bg-secondary, #f9f9f9);
}

.title-row:nth-child(10n+2),
.title-row:nth-child(10n+4),
.title-row:nth-child(10n+12),
.title-row:nth-child(10n+14) {
	background-color: transparent;
}

.title-row:nth-child(10n+6),
.title-row:nth-child(10n+8),
.title-row:nth-child(10n+10),
.title-row:nth-child(10n+16),
.title-row:nth-child(10n+18),
.title-row:nth-child(10n+20) {
	background-color: var(--bg-secondary, #f9f9f9);
}

.title-row:nth-child(10n+7),
.title-row:nth-child(10n+9),
.title-row:nth-child(10n+17),
.title-row:nth-child(10n+19) {
	background-color: transparent;
}

/* Mobile alternating */
@media (max-width: 767px) {
	.title-row:nth-child(odd) {
		background-color: var(--bg-secondary, #f9f9f9);
	}

	.title-row:nth-child(even) {
		background-color: transparent;
	}
}

/* Module view rows transparent */
.charts-view-module .title-row {
	background: transparent;
}

/* Title body/content */
.title-body {
	display: flex;
	gap: 1rem;
	width: 100%;
	align-items: center;
}

.charts-view-module .title-body {
	flex-direction: column;
	align-items: start;
	gap: 0;
	height: 100%;
}

.title-content {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: nowrap;
	flex-grow: 1;
	min-width: 0;
}

.charts-view-module .title-content {
	flex-direction: column;
	order: 2;
	align-items: start;
}

/* Mobile adjustments */
@media (max-width: 767px) {
	.title-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.title-content {
		flex-direction: column;
		align-items: flex-start;
		width: 100%;
	}
}

/* Rank */
.rank-col {
	width: 40px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	flex-shrink: 0;
	gap: 0.5rem;
}

.charts-view-module .rank-col {
	width: 100%;
	flex-direction: row;
	justify-content: start;
	order: 1;
}

.rank-number {
	font-size: 20px;
	font-weight: 900;
	display: block;
}

.rank-trend {
	font-size: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0.25rem;
}

.charts-view-module .rank-trend {
	flex-direction: row;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.trend-icon {
	font-style: normal;
	margin-right: 2px;
	font-size: 16px;
	display: block;
}

.trend-up {
  color: var(--success);
}

.charts-view-module .trend-up {
  background-color: var(--success-muted);
}

.charts-view-module .trend-down {
  background-color: var(--danger-muted);
}

.trend-down {
  color: var(--danger);
}

/* Poster */
.poster {
	border-radius: 5px;
	width: 48px;
	height: auto;
	flex-shrink: 0;
	align-self: center;
}

.charts-view-module .poster {
	width: 100%;
	margin-bottom: 1rem;
}

/* Title label */
.title-label {
	font-weight: 500;
}

/* Individual offer */
.jw-offer {
	display: inline-block;
	text-align: center;
	scroll-snap-align: start;
	width: 32px;
	flex: 0 0 32px;
}

.jw-package-icon {
	border: 1px solid transparent;
	border-radius: 1em;
	width: 32px;
	height: 32px;
	object-fit: contain;
}

.jw-package-icon.large {
	width: auto;
	height: 32px;
}

.jw-offer-label {
	margin-bottom: 0.4em;
	text-align: center;
	font-size: 10px;
	line-height: 1.2;
}

/* Offers */
.offers {
	display: flex;
	align-items: center;
	position: relative;
	flex-grow: 1;
	justify-content: flex-end;
}

.offers-inner {
	display: flex;
	align-items: center;
	gap: 0.4em;
	overflow-x: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	width: calc(32px * 3 + 0.4em * 2);
	flex-shrink: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.offers-inner::-webkit-scrollbar {
	display: none;
}

.offers:has(.jw-offer:nth-child(4)) .offers-inner {
	overflow-x: auto;
}

.offers:has(.jw-offer:nth-child(4))::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 20px;
	pointer-events: none;
}

.jw-offer:nth-child(3n+1) {
	scroll-snap-align: start;
}

.more-count {
	cursor: pointer;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 0.3em;
	font-weight: 600;
	border-radius: 0.5em;
	margin-left: 0.5em;
	width: 32px;
	height: 32px;
	z-index: 2;
	position: relative;
	display: none;
}

.offers:has(.jw-offer:nth-child(4)) .more-count {
	display: inline-flex;
}

/* No titles message */
.no-titles-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  text-align: center;
  padding: 0 1.5rem 2rem;
}

.no-titles-message h3 {
  font-size: 1.45rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}