/**
 * DJ Charts YOYAKU — Styles (Dark Theme)
 *
 * Uses Spline Sans Mono for catalog/rank numbers.
 * Adapted for yoyaku.io dark theme.
 *
 * @package Yoyaku
 * @since 2.7.0
 */

:root {
	--yy-accent: #1E90FF;
	--yy-accent2: #FF8C00;
	--yy-text: #EDEFF5;
	--yy-muted: #A8ADBB;
	--yy-bg: #1a1d21;
	--yy-font: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--yy-mono: 'Spline Sans Mono', ui-monospace, monospace;
}

/* Charts badge on artist page (below header) */
.yoyaku-charts-badge {
	margin: 0 0 20px;
}

.charts-badge-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	color: var(--yy-accent);
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	transition: all 0.25s ease;
}

.charts-badge-link:hover {
	color: var(--yy-text);
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.25);
	transform: translateY(-2px);
}

/* Charts button in artist header (alongside social links) */
.social-link-charts {
	background: rgba(30, 144, 255, 0.1) !important;
	border-color: rgba(30, 144, 255, 0.3) !important;
	color: var(--yy-accent) !important;
}

.social-link-charts:hover {
	background: rgba(30, 144, 255, 0.2) !important;
	border-color: var(--yy-accent) !important;
	color: var(--yy-text) !important;
}

/* Charts container */
.yoyaku-charts {
	margin: 0 auto 40px;
	max-width: 860px;
	padding: 0 24px;
}

.yoyaku-charts-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--yy-muted);
}

/* Charts header */
.yoyaku-charts-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 16px;
	max-width: 860px;
	margin-left: auto;
	margin-right: auto;
}

.charts-title {
	font-family: var(--yy-font);
	font-size: 22px;
	font-weight: 700;
	color: var(--yy-text);
	margin: 0;
	letter-spacing: -0.3px;
}

.charts-date {
	font-size: 13px;
	color: var(--yy-muted);
	margin-left: 12px;
	font-family: var(--yy-mono);
}

.charts-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.charts-play-all,
.charts-add-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	background: transparent;
	color: rgba(255, 255, 255, 0.8);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.2s;
}

.charts-play-all:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.4);
	color: var(--yy-text);
}

.charts-add-all {
	background: var(--yy-accent);
	border-color: var(--yy-accent);
	color: #fff;
}

.charts-add-all:hover {
	opacity: 0.85;
}

.charts-add-all.loading {
	opacity: 0.5;
	pointer-events: none;
}

.charts-download-story {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	background: transparent;
	color: rgba(255, 255, 255, 0.8);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.2s;
	font-family: var(--yy-font, 'Schibsted Grotesk', sans-serif);
}

.charts-download-story:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.4);
	color: #fff;
}

.charts-download-story svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.charts-back-link {
	font-size: 12px;
	color: var(--yy-muted);
	text-decoration: none;
}

.charts-back-link:hover {
	color: var(--yy-text);
}

/* Charts list */
.yoyaku-charts-list {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Chart item row — 5 columns (rank, cover+play, info, price, cart) */
.chart-item {
	display: grid;
	grid-template-columns: 36px 60px 1fr auto auto;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	transition: background 0.15s;
}

.chart-item:hover {
	background: rgba(255, 255, 255, 0.03);
}

.chart-item.out-of-stock,
.chart-item.coming-soon {
	opacity: 1;
}

/* Rank number */
.chart-rank {
	font-family: var(--yy-mono);
	font-size: 18px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.25);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.chart-item:nth-child(-n+3) .chart-rank {
	color: var(--yy-accent2);
}

/* Cover image */
.chart-image-link {
	display: block;
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	border-radius: 4px;
	overflow: hidden;
}

.chart-product-image,
.chart-image-link img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	display: block;
}

/* Product info — 3-line SSOT pattern */
.chart-info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.chart-release-title {
	font-family: var(--yy-font);
	font-size: 12px;
	color: var(--yy-text);
	opacity: 0.6;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-decoration: none;
}

.chart-release-title:hover {
	color: var(--yy-accent);
	opacity: 1;
}

.chart-artist-name {
	font-family: var(--yy-font);
	font-size: 13px;
	font-weight: 700;
	color: var(--yy-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chart-catalog {
	font-family: var(--yy-mono);
	font-size: 10px;
	color: var(--yy-text);
	opacity: 0.5;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chart-catalog strong {
	color: var(--yy-text);
	opacity: 0.6;
	font-weight: 600;
}

/* Cover with play overlay */
.chart-cover {
	position: relative;
	width: 60px;
	height: 60px;
	flex-shrink: 0;
}

.chart-cover-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	border: none;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s;
}

.chart-item:hover .chart-cover-play,
.chart-cover-play:focus {
	opacity: 1;
}

.chart-cover-play:hover {
	background: rgba(0, 0, 0, 0.7);
}

/* Price */
.chart-price {
	font-family: var(--yy-mono);
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.8);
	white-space: nowrap;
	min-width: 60px;
	text-align: right;
}

/* Cart button */
.chart-cart {
	flex-shrink: 0;
}

.chart-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	background: transparent;
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	transition: all 0.2s;
}

.chart-add-to-cart:hover {
	border-color: var(--yy-accent);
	background: var(--yy-accent);
	color: #fff;
}

.chart-add-to-cart.added {
	border-color: #4caf50;
	color: #4caf50;
}

.chart-add-to-cart.loading {
	opacity: 0.4;
	pointer-events: none;
}

/* Hide "View cart" link that WooCommerce injects after AJAX add */
.chart-cart .added_to_cart,
.chart-item .added_to_cart {
	display: none !important;
}

/* Hide SVG in added state (JS swaps to checkmark) */
.chart-add-to-cart.added {
	border-color: #4caf50;
	color: #4caf50;
	pointer-events: none;
}

.chart-oos {
	font-family: var(--yy-mono);
	font-size: 10px;
	color: var(--yy-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.chart-oos a {
	color: var(--yy-muted);
	text-decoration: none;
}

.chart-oos a:hover {
	color: var(--yy-accent);
}

/* Artist profile header */
.yoyaku-chart-artist-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 24px 0 20px;
	gap: 8px;
}

.chart-artist-photo {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
}

.chart-artist-name-heading {
	font-family: var(--yy-font);
	font-size: 22px;
	font-weight: 700;
	color: var(--yy-text);
	margin: 0;
}

.chart-artist-subtitle {
	font-family: var(--yy-mono);
	font-size: 12px;
	color: var(--yy-muted);
}

.chart-logo {
	height: 24px;
	width: auto;
	margin-bottom: 8px;
}

.yoyaku-charts-footer {
	text-align: center;
	padding: 16px 0;
	font-family: var(--yy-mono);
	font-size: 11px;
	color: var(--yy-muted);
}

/* Responsive — Tablet */
@media (max-width: 768px) {
	.yoyaku-charts-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.chart-item {
		grid-template-columns: 28px 50px 1fr auto;
		gap: 10px;
		padding: 10px 0;
	}

	.chart-price {
		display: none;
	}

	.chart-cover-play {
		opacity: 0.7;
	}

	.chart-rank {
		font-size: 15px;
	}

	.chart-image-link,
	.chart-product-image,
	.chart-image-link img {
		width: 50px;
		height: 50px;
	}

	.chart-release-title {
		font-size: 11px;
	}

	.chart-artist-name {
		font-size: 12px;
	}
}

/* Responsive — Small mobile actions */
@media (max-width: 480px) {
	.charts-actions {
		width: 100%;
	}

	.charts-play-all,
	.charts-add-all {
		flex: 1;
		justify-content: center;
	}
}

/* Stories mode — Instagram-ready 9:16 portrait, 10 items visible */
@media (max-width: 480px) {
	.yoyaku-chart-artist-header {
		padding: 16px 0 12px;
	}

	.chart-artist-photo {
		width: 64px;
		height: 64px;
	}

	.chart-artist-name-heading {
		font-size: 18px;
	}

	.chart-logo {
		height: 20px;
		margin-bottom: 4px;
	}

	.yoyaku-charts-header {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 8px;
		margin-bottom: 12px;
	}

	.charts-title {
		font-size: 16px;
	}

	.charts-actions {
		display: none;
	}

	.chart-item {
		grid-template-columns: 28px 44px 1fr;
		gap: 8px;
		padding: 6px 0;
	}

	.chart-rank {
		font-size: 16px;
		width: 28px;
	}

	.chart-cover,
	.chart-image-link,
	.chart-product-image,
	.chart-image-link img {
		width: 44px;
		height: 44px;
	}

	.chart-cover {
		width: 44px;
		height: 44px;
	}

	.chart-price,
	.chart-cart {
		display: none;
	}

	.chart-cover-play {
		opacity: 0;
	}

	.chart-release-title {
		font-size: 11px;
	}

	.chart-artist-name {
		font-size: 12px;
	}

	.chart-catalog {
		font-size: 9px;
	}

	.yoyaku-charts-footer {
		padding: 12px 0;
	}
}
