/* Anime Profiles Pro v23.7.5 - Final Wikipedia-Style Sidebar Fix */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
	--app-accent: #5865F2;
	--app-accent-dark: #4752C4;
	--app-text: #2E3338;
	--app-text-light: #4E545A;
	--app-text-muted: #747F8D;
	--app-bg: #F2F3F5;
	--app-surface: #FFFFFF;
	--app-border: #E3E5E8;
	--app-font: 'Inter', system-ui, -apple-system, sans-serif;
	--app-star: #FFAC33;
	--app-error: #D63638;
	--app-shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
	--app-shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
	--app-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
	font-family: var(--app-font);
	background-color: var(--app-bg);
	color: var(--app-text);
	margin: 0;
	line-height: 1.6;
}

.app-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
}

a {
	color: var(--app-accent);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover { color: var(--app-accent-dark); }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.75em;
	font-weight: 700;
	line-height: 1.2;
}

/* Breadcrumbs */
.app-container .app-breadcrumbs {
	padding: 15px 0;
	margin-bottom: 24px;
	font-size: 0.9em;
	font-weight: 500;
}

.app-container .app-breadcrumbs a { color: var(--app-accent); }

.app-container .app-breadcrumbs a:hover { text-decoration: underline; }

.app-container .app-breadcrumbs .separator {
	margin: 0 8px;
	color: var(--app-border);
}

.app-container .app-breadcrumbs .current {
	color: var(--app-text);
	font-weight: 600;
}

/* Main Layout & Sidebar */
.app-series-details-grid,
.app-single-container {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.app-sidebar .app-sidebar-sticky {
	position: sticky;
	top: 40px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.app-main-content { min-width: 0; }

.app-sidebar-widget {
	background: var(--app-surface);
	border-radius: 12px;
	padding: 24px;
	border: 1px solid var(--app-border);
	box-shadow: var(--app-shadow-sm);
}

.app-prose {
	line-height: 1.7;
	font-size: 1.1em;
	color: var(--app-text-light);
}

.app-prose p:first-child { margin-top: 0; }
.app-prose p:last-child { margin-bottom: 0; }

/* Accordion */
.app-accordion-container {
	background: var(--app-surface);
	border: 1px solid var(--app-border);
	border-radius: 12px;
	box-shadow: var(--app-shadow-sm);
	overflow: hidden;
}

.app-accordion-item:not(:last-child) { border-bottom: 1px solid var(--app-border); }

.app-accordion-header {
	font-size: 1.2em;
	font-weight: 600;
	margin: 0;
	padding: 18px 24px;
	cursor: pointer;
	position: relative;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
}

.app-accordion-header::before {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 8px solid var(--app-text-muted);
	margin-right: 15px;
	transition: transform 0.3s ease-in-out, border-color 0.2s ease;
}

.app-accordion-header:hover {
	background-color: var(--app-bg);
	color: var(--app-accent);
}

.app-accordion-header.active {
	color: var(--app-accent);
	font-weight: 700;
}

.app-accordion-header.active::before {
	transform: rotate(90deg);
	border-left-color: var(--app-accent);
}

.app-accordion-content {
	display: none;
	padding: 32px 32px 32px 55px;
	animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ============================================================
 * SINGLE CHARACTER PAGE / SIDEBAR
 * ========================================================== */

/* Character image – shorter, cropped nicely */
.app-sidebar .app-main-image {
	width: 100%;
	height: 360px;          /* <== adjust this if you want shorter/taller */
	object-fit: cover;
	border-radius: 12px;
	margin-bottom: 0;
	box-shadow: var(--app-shadow-lg);
	display: block;
}






.app-character-header {
	text-align: left;
	margin-bottom: 0;
}

/* Character title */
.app-main-title {
	font-size: clamp(1.6em, 4vw, 2.0em);
	font-weight: 800;
	line-height: 1.1;
	color: var(--app-text);
}

.app-subtitle {
	font-size: clamp(1.1em, 3vw, 1.3em);
	font-weight: 400;
	color: var(--app-text-muted);
	margin: 5px 0 0;
}

/* Profile box */
.app-sidebar-widget.app-quick-stats {
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--app-border);
}

/* Profile header label */
.app-quick-stats h3 {
	padding: 12px 20px;
	margin: 0;
	background-color: var(--app-bg);
	font-size: 0.8em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--app-text-muted);
	border-bottom: 1px solid var(--app-border);
}

/* Profile rows grid */
.profile-details-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: 30% 70%;
}

/* Profile rows */
.profile-details-list dt,
.profile-details-list dd {
	padding: 4px 12px;
	margin: 0;
	border-top: 1px solid var(--app-border);
	font-size: 0.95em;
	line-height: 1.4;
}

/* Left labels */
.profile-details-list dt {
	font-weight: 600;
	color: var(--app-text);
	background-color: var(--app-bg);
}

/* Right values */
.profile-details-list dd {
	color: var(--app-text-light);
	text-align: left;
	background-color: var(--app-surface);
}

.profile-details-list dd a {
	color: var(--app-accent);
	font-weight: 600;
}

/* Keep profile labels bold on mobile too */
@media (max-width: 768px) {
	.profile-details-list dt {
		font-weight: 700 !important;
	}
}

/* Fallback/Main Content Bio List */
.app-bio-list { display: none; }

/* Character Cards (Compact Version) */
.app-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 20px;
}

.app-card {
	background: var(--app-surface);
	border-radius: 12px;
	box-shadow: var(--app-shadow-sm);
	text-decoration: none;
	overflow: hidden;
	transition: all 0.25s ease-in-out;
	display: flex;
	flex-direction: column;
}

.app-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--app-shadow-md);
}

.app-card-image {
	aspect-ratio: 3 / 4;
	background-size: cover;
	background-position: center;
	position: relative;
}

.app-card-role-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 5px 10px;
	font-size: 0.75em;
	font-weight: 700;
	color: white;
	border-radius: 6px;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
	z-index: 2;
}

.app-card-role-badge.role-main { background-color: var(--app-accent); }
.app-card-role-badge.role-supporting { background-color: rgba(116, 127, 141,.9); }

.app-card-content {
	padding: 12px;
	flex-grow: 1;
}

.app-card-title {
	font-size: 1em;
	font-weight: 600;
	color: var(--app-text);
	margin: 0 0 8px;
}

.app-card-favorites {
	font-size: 0.9em;
	color: var(--app-text-muted);
	display: flex;
	align-items: center;
	gap: 5px;
}

.app-card-favorites .app-icon-star { color: var(--app-star); }

/* --- Series Page Hero Banner --- */
.app-series-hero {
	min-height: 280px;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: flex-end;
	padding: 32px 0;
	position: relative;
	color: #FFFFFF;
	margin-bottom: 48px;
}

.app-series-hero-content h1 {
	color: #FFFFFF;
	font-size: clamp(2.5em, 6vw, 4em);
	font-weight: 800;
	text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
	line-height: 1.1;
	margin-bottom: 8px;
}

.app-series-hero-score {
	color: #FFFFFF;
	font-size: 1.5em;
	font-weight: 600;
	text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.6);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.app-series-hero-score .app-icon-star {
	color: var(--app-star);
	font-size: 1.2em;
}

/* RESPONSIVE STYLES */
@media (min-width: 992px) {
	.app-series-details-grid {
		grid-template-columns: minmax(0, 2.5fr) minmax(320px, 1fr);
	}
	.app-single-container {
		grid-template-columns: 400px 1fr;
	}
}

@media (max-width: 991px) {
	.app-series-details-grid,
	.app-single-container {
		gap: 32px;
	}
	.app-sidebar .app-sidebar-sticky { position: static; }
}

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

	.app-series-hero-content h1 {
    	font-size: clamp(2em, 8vw, 2.8em);
	}

	.app-series-hero-score { font-size: 1.2em; }

	.app-accordion-header {
		padding: 15px 24px;
		font-size: 1.5em;
	}

	.app-accordion-content {
		padding: 24px 24px 24px 45px;
	}

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

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

	.app-single-container .app-sidebar,
	.app-single-container .app-character-header {
		text-align: center;
	}

	.app-single-container .app-main-image {
		max-width: 280px;
		margin-left: auto;
		margin-right: auto;
	}
}

@media (max-width: 480px) {
	body { font-size: 15px; }
	.app-accordion-header {
		font-size: 1.25em;
		padding: 15px 20px;
	}
	.app-accordion-content {
		padding: 20px 20px 20px 38px;
	}
	.app-grid { grid-template-columns: repeat(2, 1fr); }
	.app-media-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================
 * SERIES SIDEBAR + STATS
 * ========================= */

/* Sidebar poster: reduced height */
.app-series-poster-sidebar {
	width: 100%;
	height: 260px;               /* shorter poster */
	border-radius: 12px;
	box-shadow: var(--app-shadow-lg);
	display: block;
	object-fit: cover;           /* crop instead of stretch */
}

/* Base heading for stats + "where to watch" */
.visual-stats h3,
.app-where-to-watch h3 {
	font-size: 1.1em;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0 0 16px;
	color: var(--app-text-muted);
	font-weight: 600;
}

.app-streaming-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
	gap: 12px;
}

.app-streaming-link {
	display: flex;
	justify-content: center;
	align-items: center;
	aspect-ratio: 1.5/1;
	background: var(--app-bg);
	border-radius: 8px;
	border: 1px solid var(--app-border);
	transition: all 0.2s ease;
}

.app-streaming-link:hover {
	transform: translateY(-3px);
	border-color: #d0d3d6;
	background: #e9eaec;
	box-shadow: var(--app-shadow-sm);
}

.app-streaming-link img {
	height: 28px;
	max-width: 90%;
	object-fit: contain;
}

.app-streaming-link-name {
	font-size: 0.8em;
	font-weight: 600;
	color: var(--app-text-muted);
	padding: 5px;
	text-align: center;
}

/* Base one-column stats layout (fallback) */
.visual-stats-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--app-border);
}

.visual-stats-grid > .stat-item:last-child { border-bottom: none; }

.stat-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	margin: 0;
	opacity: 0.6;
}

.stat-label {
	display: block;
	font-size: 0.9em;
	color: var(--app-text-muted);
	margin-bottom: 2px;
	line-height: 1.2;
	font-weight: 500;
}

.stat-value {
	display: block;
	font-weight: 600;
	line-height: 1.3;
	color: var(--app-text);
	font-size: 1.1em;
}

.stat-item-genres { align-items: flex-start; }

.app-series-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.app-series-tag {
	background-color: var(--app-bg);
	color: var(--app-text-light);
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 0.9em;
	text-decoration: none;
	border: none;
	font-weight: 500;
}

/* Skill stats */
.app-stats-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.app-stat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 1em;
}

.app-stat-bar-container {
	width: 100%;
	background-color: var(--app-bg);
	border-radius: 6px;
	height: 12px;
	overflow: hidden;
}

.app-stat-bar {
	height: 100%;
	border-radius: 6px;
	transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
	background-color: var(--app-accent);
}

/* Media grids */
.app-media-grid {
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 20px;
}

.app-media-card {
	text-decoration: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.app-media-card-image {
	aspect-ratio: 10 / 16;
	background-size: cover;
	background-position: center;
	border-radius: 8px;
	box-shadow: var(--app-shadow-sm);
	transition: all 0.25s ease;
}

.app-media-card:hover .app-media-card-image {
	transform: scale(1.05);
	box-shadow: var(--app-shadow-md);
}

.app-media-card-content { text-align: center; }

.app-media-card-title {
	font-size: 1em;
	font-weight: 600;
	color: var(--app-text);
	margin: 0 0 4px;
	line-height: 1.3;
}

.app-media-card-role {
	font-size: 0.85em;
	color: var(--app-text-muted);
}

.app-grid-related {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* Staff + VA */
.app-staff-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 24px;
}

.app-staff-card { text-align: center; }

.app-staff-image {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	margin: 0 auto 12px;
	box-shadow: var(--app-shadow-md);
}

.app-staff-name {
	display: block;
	font-weight: 600;
	font-size: 0.95em;
	line-height: 1.3;
}

.app-staff-role {
	display: block;
	font-size: 0.8em;
	color: var(--app-text-muted);
}

.app-va-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 20px;
}

.app-va-card {
	position: relative;
	text-align: center;
}

.app-va-card img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: var(--app-shadow-sm);
}

.app-va-card-name {
	font-weight: 600;
	font-size: 0.9em;
	line-height: 1.4;
	margin-top: 8px;
}

/* Sources */
.app-source-attribution {
	text-align: center;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--app-border);
}

.app-source-attribution h3 {
	font-size: 0.8em;
	color: var(--app-text-muted);
	text-transform: uppercase;
	letter-spacing: 1.5px;
	margin-bottom: 16px;
	font-weight: 600;
}

.app-source-list {
	list-style: none;
	padding: 0;
	margin: 10px 0 0;
	display: inline-flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: center;
}

.app-source-list a {
	background-color: var(--app-bg);
	color: var(--app-accent);
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 600;
	transition: all 0.2s ease;
	border: 1px solid var(--app-border);
}

.app-source-list a:hover {
	background-color: var(--app-accent);
	color: #fff;
	border-color: var(--app-accent-dark);
}

/* Load more */
.app-load-more-container {
	margin-top: 40px;
	text-align: center;
}

.app-load-more-btn {
	background-color: var(--app-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 14px 32px;
	font-size: 1.1em;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.app-load-more-btn:hover {
	background-color: var(--app-accent-dark);
	transform: translateY(-2px);
	box-shadow: var(--app-shadow-md);
}

.app-loader {
	border: 5px solid var(--app-bg);
	border-top: 5px solid var(--app-accent);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
	margin: 0 auto;
}

#app-load-more-loader {
	width: 30px;
	height: 30px;
	border-width: 4px;
}

@keyframes spin {
	100% { transform: rotate(360deg); }
}

/* Explorer */
.app-explorer-container {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 48px;
	align-items: flex-start;
}

.app-explorer-sidebar .app-desktop-filter-title {
	font-size: 1.5em;
	border-bottom: 1px solid var(--app-border);
	padding-bottom: 12px;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.app-explorer-sidebar .filter-group { margin-bottom: 24px; }

.app-explorer-sidebar input[type="text"],
.app-explorer-sidebar select {
	width: 100%;
	padding: 12px;
	border-radius: 8px;
	border: 1px solid var(--app-border);
	font-size: 1em;
	background: var(--app-bg);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-checkbox-group {
	max-height: 250px;
	overflow-y: auto;
	border: 1px solid var(--app-border);
	padding: 15px;
	border-radius: 8px;
	background: var(--app-surface);
}

.filter-checkbox-group label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	margin-bottom: 12px;
	cursor: pointer;
}

.app-radio-group {
	display: flex;
	gap: 10px;
	background-color: var(--app-bg);
	border-radius: 8px;
	padding: 5px;
}

.app-radio-group label {
	flex-grow: 1;
	padding: 8px 12px;
	margin: 0;
	text-align: center;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s ease-in-out;
}

.app-radio-group input[type="radio"] { display: none; }

.app-radio-group input[type="radio"]:checked + label {
	background-color: var(--app-surface);
	color: var(--app-accent);
	box-shadow: var(--app-shadow-sm);
}

.app-mobile-filter-button { display: none; }

@media (max-width: 991px) {
	.app-explorer-container { grid-template-columns: 1fr; }

	.app-explorer-sidebar .app-desktop-filter-title { display: none; }

	#app-explorer-filters {
		display: none;
		border: 1px solid var(--app-border);
		padding: 24px;
		border-radius: 12px;
		margin-top: 16px;
		background: var(--app-surface);
	}

	.app-mobile-filter-button {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		background: var(--app-surface);
		border: 1px solid var(--app-border);
		color: var(--app-text);
		padding: 14px;
		font-size: 1.1em;
		font-weight: 600;
		border-radius: 8px;
		cursor: pointer;
	}

	.app-mobile-filter-button.is-open {
		background-color: var(--app-accent);
		border-color: var(--app-accent-dark);
		color: white;
	}
}

/* -----------------------
 * SERIES-SPECIFIC TWEAKS
 * ----------------------- */

/* Scope to anime series pages only: compact series info box */
.single-anime_series .app-series-sidebar .app-quick-stats {
    padding: 14px 16px;
    font-size: 13px;
}

/* Two-column layout for stats in series sidebar */
.single-anime_series .visual-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 8px;
}

/* Each stat item compact */
.single-anime_series .visual-stats-grid .stat-item,
.single-anime_series .visual-stats-grid .stat-item-genres {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--app-border);
}

/* Items that span full width */
.single-anime_series .visual-stats-grid .stat-item.full-width,
.single-anime_series .visual-stats-grid .stat-item-genres.full-width {
    grid-column: 1 / -1;
}

/* Smaller icons */
.single-anime_series .stat-icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* Label small + uppercase */
.single-anime_series .stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280; /* gray-500 */
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

/* Value slightly smaller */
.single-anime_series .stat-value {
    display: block;
    font-size: 13px;
    color: #111827; /* gray-900 */
}

/* Smaller genre chips */
.single-anime_series .app-series-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.single-anime_series .app-series-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
}

/* On mobile, stats fall back to one column */
@media (max-width: 768px) {
    .single-anime_series .visual-stats-grid {
        grid-template-columns: 1fr;
    }
}
