:root {
	/* Backgrounds */
	--bg-page:     #343D3F;
	--bg-surface:  #18181b;
	--bg-card:     #1f1f23;
	--bg-elevated: #27272a;

	/* Borders */
	--border-subtle:  #2f2f35;
	--border-default: #3f3f46;

	/* Texte */
	--text-primary:   #ffffff;
	--text-secondary: #a1a1aa;
	--text-muted:     #71717a;

	/* Accent indigo */
	--accent:       #6366f1;
	--accent-hover: #4f46e5;
	--accent-soft:  #818cf8;
	--accent-muted: #1c1c35;

	/* Sémantiques */
	--color-score:    #f1c40f;
	--color-success:  #2ecc71;
	--color-progress: #f59e0b;
	--color-dropped:  #ef4444;
}

body {
	background-color: var(--bg-page);
	color: var(--text-primary);
	margin: 0;
	font-family: "Inter", "Roboto", "Helvetica Neue", sans-serif;
}

#navbar {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 0 32px;
	height: 60px;
	background: var(--bg-surface);
	border-bottom: 1px solid var(--border-subtle);
	position: sticky;
	top: 0;
	z-index: 100;
}
#logo {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--text-primary);
	font-weight: 700;
	font-size: 17px;
	letter-spacing: -0.3px;
	flex-shrink: 0;
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 4px;
}

.navbar-button {
	background: none;
	border: none;
	color: var(--text-secondary);
	font-size: 13px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.navbar-button:hover {
	background: var(--bg-elevated);
	color: var(--text-primary);
}
.navbar-button.active {
	color: var(--text-primary);
	background: var(--bg-elevated);
}

.search-container {
	flex: 1;
	max-width: 320px;
	position: relative;
	margin-left: auto;
}
#search-input {
	width: 100%;
	background: var(--bg-elevated);
	border: 1px solid var(--border-default);
	border-radius: 8px;
	color: var(--text-primary);
	font-size: 13px;
	padding: 7px 12px 7px 34px;
	outline: none;
	transition: border 0.15s;
}
#search-input::placeholder {
	color: var(--text-muted);
}
#search-input:focus, #search-input:hover{
	border-color: var(--accent);
}

.nav-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.signin-button {
	background: var(--accent);
	border: none;
	color: var(--text-primary);
	font-size: 13px;
	font-weight: 500;
	padding: 7px 16px;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s;
}
.signin-button:hover {
	background: var(--accent-hover);
}
.signin-button.hidden {
	display: none;
}
.signin-button.visible {
	display: block;
}

#profile-button {
	background: none;
	padding: 0;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--border-default);
	transition: border-color 0.15s ease;
}
#profile-button.hidden {
	display: none;
}

#profile-button:hover {
	background: none;
	border-color: var(--accent);
}

.nav-avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}


/* =====================
=== Profile Dropdown ===
===================== */

.profile-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: var(--bg-card);
	border: 1px solid var(--border-default);
	border-radius: 10px;
	padding: 6px;
	min-width: 160px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	z-index: 200;

	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
}
.profile-dropdown.hidden {
	display: none;
}
.profile-dropdown.visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.dropdown-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--text-secondary);
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
	text-align: left;
}
.dropdown-item:hover {
	background: var(--bg-elevated);
	color: var(--text-primary);
}
.dropdown-item-danger {
	color: var(--color-dropped);
}
.dropdown-item-danger:hover {
	background: rgba(239, 68, 68, 0.1);
	color: var(--color-dropped);
}

.dropdown-separator {
	height: 1px;
	background: var(--border-subtle);
	margin: 4px 0;
}

/* ==============
=== Main Page ===
============== */

#page-container {
	display: flex;
	width: 80%;
	gap: 30px;
	margin: 10px 10% 0 10%;

	/*border: 1px solid red;	*/
}
#main-column-container {
	width: 70%;

	/*border: 1px solid blue;*/
}
#side-column-container {
	width: 30%;
	display: flex;
	flex-direction: column;
	gap: 20px;
	/*position: sticky;*/
	top: 20px;
	height: max-content;

	overflow-y: auto;

	/*border: 1px solid yellow;*/
}
	/*max-height: calc(100vh - 40px); 
						

	scrollbar-width: none;          
	-ms-overflow-style: none;
}
#side-column-container::-webkit-scrollbar {
	display: none;
}*/

/* =======================
=== Activity carousel ===
======================= */

#carousel-container {
	position: relative;
	width: 100%;
	overflow: hidden;
}

#carousel-track {
	/*border: 1px solid rosybrown;*/
	display: flex;
	/*align-items: flex-start;*/
	flex-wrap: nowrap;
	scroll-behavior: smooth;
	scrollbar-width: none;					/* masquer scroll bar firefox*/
	-ms-overflow-style: none;				/* masquer scroll bar edge*/

	will-change: transform;
}
#carousel-track .anime-card {
	width: 200px;
	/* width: 160px; */
}
/* #carousel-track .anime-card .anime-title {
	font-size: 12px;
}
#carousel-track .anime-card .card-metadata {
	font-size: 10px;
	margin-bottom: 8px;
}
#carousel-track .anime-card .card-info {
	padding: 10px; 
}
#carousel-track .anime-card .activity-desc {
	font-size: 12px;
} */

#carousel-track .anime-card .card-footer {
	padding: 8px 10px;
}
#carousel-track::-webkit-scrollbar {	/* masquer scroll bar chrome*/
	display: none;
}

.carousel-button {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	background-color: rgba(0, 0, 0, 0.6);
	color: white;
	border: none;
	padding: 15px 12px;
	cursor: pointer;
	font-size: 18px;
	border-radius: 4px;

	font-family: "Inter", "Roboto", "Helvetica Neue", sans-serif;
	font-weight: 300;
}
.carousel-button:hover {
	background-color: rgba(31, 31, 35, 1);
}
#carousel-prev-button {
	left: 5px; 
}
#carousel-next-button { 
	right: 5px; 
}

/* ==================
=== Anime Card ===
================== */

.anime-card {
	display: flex;
	flex-direction: column;

	margin-right: 10px;
	flex-shrink: 0;

	position: relative;

	overflow: hidden;

	background-color: var(--bg-card);
	border: 1px solid var(--border-subtle);
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	
	transition: transform 0.2s ease, box-shadow 0.2s ease;	
}
.anime-card > a {
	display: block;
	width: 100%;
	aspect-ratio: 2/3;
	overflow: hidden;
}
.anime-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.anime-img {
	/*height: 200px;
	width: 275;*/
	height: 100%;
	width: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}
.anime-card:hover .anime-img {
	transform: scale(1.05);
}

.card-info {
	padding: 12px;
	display: flex;
	flex-direction: column;
	flex-grow: 1; /* Force le footer à s'aligner en bas si le texte est court */
}
.anime-title {
	margin: 0 0 4px 0;
	font-size: 15px;
	line-height: 1.3;
	/*height: 3.9em;*/
}
.anime-title a {
	color: var(--text-primary);
	text-decoration: none;
}
.anime-title a:hover {
	color: var(--accent-soft);
}
.card-metadata {
	font-size: 12px;
	color: var(--text-secondary);
	margin-bottom: 12px;
}
.card-metadata .separator {
	margin: 0 4px;
	color: #52525b;
}

.activity-desc {
	/*height: 100%;*/
	display: flex;
	align-items: center;
	color: var(--text-primary);

	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 4px;
}

.card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 0 4px 4px 4px;

	max-height: 52px;
	overflow: hidden;
}
.tag-badge {
	background-color: var(--bg-elevated);
	color: #e4e4e7;
	font-size: 10px;
	padding: 3px 6px;
	border-radius: 12px;
	border: 1px solid var(--border-default);

	word-break: break-word;
}

.card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background-color: var(--bg-surface);
	border-top: 1px solid var(--border-subtle);
}
.card-scores {
	display: flex;
	flex-direction: column;
}
.score-group {
	color: var(--color-score);
	font-weight: bold;
	font-size: 14px;
}
.score-mal {
	color: var(--text-muted);
	font-size: 11px;
}
.recommenders-avatars {
	display: flex;
	justify-content: flex-end;
}
.user-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid var(--bg-surface);
	margin-left: -8px; /* Fait se chevaucher les profils */
	object-fit: cover;
	background-color: var(--border-default);
}

/* =====================
=== Badges et Avatars ===
===================== */
.completed-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background-color: var(--color-success);
	color: #000;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 900;
	font-size: 14px;
	z-index: 10;
	box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.anime-card > a {
	position: relative; 
}

/* ===================
=== Recommendation ===
=================== */

.anime-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
	padding: 15px 0;
}

/* =============
=== SIDE BAR ===
============= */

.sidebar-widget {
	background-color: var(--bg-card);
	border: 1px solid var(--border-subtle);
	border-radius: 8px;
	padding: 16px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.widget-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border-subtle);
}

.widget-header h3 {
	margin: 0;
	font-size: 15px;
	color: var(--text-primary);
	font-family: "Inter", "Roboto", sans-serif;
	font-weight: 500;
}

.widget-subtitle {
	font-size: 11px;
	color: var(--text-muted);
}

/* ================
=== Leaderboard ===
================ */

.crew-leaderboard {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.leaderboard-item {
	display: flex;
	align-items: center;
	background-color: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	padding: 8px 12px;
	border-radius: 6px;
	gap: 12px;
}
.leaderboard-link {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-grow: 1;
	text-decoration: none;
	color: inherit;
}

.rank-badge {
	width: 22px;
	height: 22px;
	background-color: var(--bg-elevated);
	color: var(--text-secondary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: bold;
}

.rank-1 .rank-badge { 
	background-color: var(--color-score);
	color: var(--bg-surface);
}
.rank-2 .rank-badge {
	background-color: var(--text-secondary);
	color: var(--bg-surface);
}
.rank-3 .rank-badge {
	background-color: #cd7f32;
	color: var(--text-primary);
}

.user-avatar-mini {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--border-subtle);
}

.username {
	color: var(--text-primary);
	font-size: 13px;
	font-weight: 500;
	flex-grow: 1;
}

.leaderboard-stat {
	color: var(--accent-soft);
	font-size: 13px;
	font-weight: bold;
}

.leaderboard-stat small {
	color: var(--text-muted);
	font-weight: normal;
	font-size: 10px;
}

/* ===================
=== Liste Episodes ===
=================== */

.episodes-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.episode-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border-subtle);
}

.episode-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.episode-number {
	background-color: var(--bg-elevated);
	color: var(--text-secondary);
	font-size: 11px;
	font-weight: bold;
	padding: 4px 6px;
	border-radius: 4px;
	min-width: 52px;
	text-align: center;
	font-family: monospace;
	border: 1px solid var(--border-default);
}

.episode-number.new {
	background-color: rgba(46, 204, 113, 0.15);
	color: var(--color-success);
	border-color: rgba(46, 204, 113, 0.4);
}

.episode-details {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.anime-mini-title {
	margin: 0 0 2px 0;
	font-size: 13px;
	font-weight: 500;
	/* white-space: nowrap; */
	/* overflow: hidden; */
	/* text-overflow: ellipsis; */
}

.anime-mini-title a {
	color: var(--text-primary);
	text-decoration: none;
}

.anime-mini-title a:hover {
	color: var(--accent-soft);
}

.episode-type {
	font-size: 11px;
	color: var(--text-secondary);
}

.time-ago {
	color: var(--text-muted);
	font-size: 11px;
}

/* =====================
=== Watchlist Button ===
===================== */

.watchlist-button {
	position: absolute;
	top: 12px;
	right: 12px;
	
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	
	background: rgba(30, 30, 30, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 50%;
	
	color: var(--text-primary);
	font-size: 20px;
	font-weight: bold;
	line-height: 0;
	
	cursor: pointer;
	z-index: 5;

	opacity: 0;
	transform: scale(0.8);
	pointer-events: none;

	transition: 
		background-color 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2 ease,
		transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
		box-shadow 0.2s ease;
}

.anime-card:hover .watchlist-button {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

.watchlist-button:hover {
	background: var(--color-success); 
	border-color: var(--color-success);
	color: var(--text-primary);
	
	transform: scale(1.15) rotate(90deg);
	
	box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
}

.watchlist-button:active {
	transform: scale(0.95);
}


/* ================
=== Auth Modal ===
================ */

#auth-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}
#auth-overlay.hidden {
	display: none;
}

.auth-modal {
	background: var(--bg-card);
	border: 1px solid var(--border-default);
	border-radius: 16px;
	padding: 36px 40px;
	width: 100%;
	max-width: 380px;
	position: relative;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

#close-auth-button {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 16px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
}
#close-auth-button:hover {
	color: var(--text-primary);
	background: var(--bg-elevated);
}

.auth-panel {
	display: none;
	flex-direction: column;
	gap: 16px;
}
.auth-panel.active {
	display: flex;
}

.auth-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--text-primary);
}
.auth-subtitle {
	margin: -8px 0 0 0;
	font-size: 13px;
	color: var(--text-muted);
}

.auth-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.auth-field label {
	font-size: 12px;
	font-weight: 500;
	color: var(--text-secondary);
}
.auth-field input {
	background: var(--bg-elevated);
	border: 1px solid var(--border-default);
	border-radius: 8px;
	color: var(--text-primary);
	font-size: 14px;
	padding: 9px 12px;
	outline: none;
	transition: border 0.15s;
}
.auth-field input::placeholder {
	color: var(--text-muted);
}
.auth-field input:focus {
	border-color: var(--accent);
}

.auth-primary-button {
	background: var(--accent);
	border: none;
	border-radius: 8px;
	color: var(--text-primary);
	font-size: 14px;
	font-weight: 600;
	padding: 10px;
	cursor: pointer;
	transition: background 0.15s;
	margin-top: 4px;
}
.auth-primary-button:hover {
	background: var(--accent-hover);
}
.auth-primary-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.auth-links {
	display: flex;
	justify-content: center;
	gap: 8px;
	font-size: 12px;
}
.auth-links a {
	color: var(--accent-soft);
	text-decoration: none;
}
.auth-links a:hover {
	text-decoration: underline;
}
.auth-links-sep {
	color: var(--text-muted);
}

.auth-error {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	border-radius: 6px;
	color: var(--color-dropped);
	font-size: 13px;
	padding: 8px 12px;
}
.auth-success {
	background: rgba(46, 204, 113, 0.1);
	border: 1px solid rgba(46, 204, 113, 0.3);
	border-radius: 6px;
	color: var(--color-success);
	font-size: 13px;
	padding: 8px 12px;
}
.auth-error.hidden,
.auth-success.hidden {
	display: none;
}

/* =====================
=== Search Dropdown  ===
===================== */
.search-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: var(--bg-card);
	border: 1px solid var(--border-default);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
	z-index: 300;
	max-height: 400px;
	overflow-y: auto;
}
.search-dropdown.hidden { 
	display: none; 
}
.search-empty {
	padding: 16px;
	text-align: center;
	color: var(--text-muted);
	font-size: 13px;
}
.search-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border-subtle);
	transition: background 0.15s;
}
.search-item:hover { 
	background: var(--bg-elevated); 
}
.search-item:last-child { 
	border-bottom: none; 
}

.search-item-img {
	width: 36px;
	height: 50px;
	border-radius: 4px;
	object-fit: cover;
	background-color: var(--bg-elevated);
}
.search-item-info {
	flex: 1;
	overflow: hidden;
}
.search-item-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.search-item-meta {
	font-size: 11px;
	color: var(--text-secondary);
	margin-top: 4px;
}
.search-add-button {
	background: var(--bg-elevated);
	border: 1px solid var(--border-default);
	color: var(--text-primary);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 16px;
	line-height: 0;
	cursor: pointer;
	transition: 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.search-add-button:hover {
	background: var(--accent);
	border-color: var(--accent);
}
.search-in-list {
	color: var(--color-success);
	font-weight: bold;
	font-size: 16px;
	padding: 0 6px;
}


/* =====================
=== Hall of Shame    ===
===================== */

.shame-grid .anime-img {
	filter: grayscale(80%) contrast(120%) brightness(80%);
	transition: filter 0.3s ease;
}

.shame-grid .anime-card:hover .anime-img {
	filter: grayscale(0%) contrast(100%) brightness(100%);
}

.shame-grid .anime-card:hover {
	box-shadow: 0 8px 15px rgba(239, 68, 68, 0.2);
	border-color: rgba(239, 68, 68, 0.5);
}

.shame-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background-color: var(--color-dropped);
	color: #fff;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: bold;
	z-index: 10;
	box-shadow: 0 2px 6px rgba(0,0,0,0.6);
	backdrop-filter: blur(4px);
}