/*****------ HEADER PROFIL -----*****/

.header__user-nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

.header__user-nav-icon {
	width: 20px;
	height: 20px;
}

.header__user-nav-img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.layout--profile {
	grid-template-columns: minmax(0, 1fr);
	column-gap: 0;
	contain: none;
}

.layout--profile .header,
.layout--profile .main,
.layout--profile .footer {
	grid-column: 1 / -1;
}

.layout--profile > .sidebar {
	position: fixed;
	top: 0;
	left: -220px;
	width: 220px;
	height: calc(100dvh - 75px);
	z-index: 101;
	border-radius: 0 var(--br12) var(--br12) 0;
	transition: transform 0.3s ease;
}

.layout--profile > .sidebar.sidebar--mobile-open {
	min-width: 265px;
	transform: translate(228px, 70px);
	background: rgba(19, 22, 27, 0.25);
	backdrop-filter: blur(40px);
	-webkit-backdrop-filter: blur(40px);
}

.layout--profile .main {
	overflow: visible;
	contain: none;
	padding-top: 44px;
}

.layout--profile .footer__container {
	width: 100%;
	transform: none;
}

/*****----- PROFIL - základní nastavení ----*****/

/* Profile wrapper */
.profile {
	display: grid;
	grid-template-columns: 280px 1fr;
	/* height: 100vh; */
	max-width: 1225px;
	gap: var(--gap32);
	margin: 0 auto;
	margin-top: 0;
	padding: 0 16px;
}

@media (max-width: 1024px) {
	.profile {
		grid-template-columns: 1fr;
	}

	.favorites__content {
		order: 1;
	}

	.profile__sidebar {
		order: 2;
	}
}

@media (max-width: 810px) {
	.profile {
		grid-template-columns: 1fr;
		height: auto;
		margin-bottom: 32px;
	}
}

/* Profile Sidebar */
.profile__sidebar {
	height: fit-content;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 0;
	background: var(--clr-alpha-black-10);
	border: 1px solid var(--brdr-skeumo-gradient);
	border-radius: var(--br12);
}

.profile__sidebar-header {
	width: 100%;
	padding: 16px;
	min-height: 212px;
	align-items: center;
	justify-content: center;
	display: flex;
}

.profile__user {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.profile__avatar {
	position: relative;
	width: 80px;
	height: 80px;
	/* overflow: hidden; */
	margin-bottom: 16px;
	border-radius: 50px;
}

.profile__add {
	position: absolute;
	bottom: 0;
	right: 0;
	background: var(--clr-black-primary);
	border-radius: 50px;
	border: 0;
	padding: 4px;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
}

.profile__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

[data-profile-avatar-viewer-trigger] {
	cursor: zoom-in;
}

[data-profile-avatar-viewer-trigger]:focus-visible {
	outline: 2px solid var(--bg-brand-solid);
	outline-offset: 4px;
}

.profile__username {
	font-size: var(--fs20);
	font-weight: var(--fw400);
}

.profile__email {
	font-size: var(--fs14);
	color: var(--text-tertiary);
}

.profile__avatar-status {
	margin-top: 8px;
	text-align: left;
}

.profile__nav {
	width: 100%;
	display: flex;
	flex-direction: column;
	padding: 0 8px;
}

.profile__link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px;
	border-radius: var(--br12);
	text-decoration: none;
	color: #f1f1f1;
	transition: background 0.2s;
}

.profile__link:hover,
.profile__link--active {
	background: var(--clr-alpha-black-10);
}

/* Profile Content */
.profile__content {
	max-height: fit-content;
}

.profile__title {
	font-size: 1.875rem;
	font-weight: var(--fw600);
}

.profile__list {
	display: grid;
	padding: 24px;
	background: var(--clr-alpha-black-10);
	border: 1px solid var(--brdr-skeumo-gradient);
	border-radius: var(--br16);
	gap: 20px;
}

.profile__item {
	display: flex;
}

.profile__label {
	font-size: var(--fs14);
	font-weight: var(--fw600);
	color: var(--text-secondary);
}

/* Sidebar link icons */
.profile__link-inner {
	display: flex;
	align-items: center;
	gap: var(--gap8);
}

.profile__sideicon {
	width: 32px;
	height: 32px;
}

.profile__sideicon img {
	max-width: 100%;
	height: auto;
	object-fit: contain;
	aspect-ratio: 1 / 1;
}

.profile__text {
	font-size: var(--fs14);
	color: var(--text-secondary);
	font-weight: var(--fw500);
}

.profile__icon {
	width: 48px;
	height: 48px;
	padding: 8px;
	background: var(--clr-bg-quaternary);
	border: 1px solid var(--brdr-border-primary);
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 50px;
}

.profile__icon img {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

/* List items with icons */
.profile__item {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.profile__info {
	display: flex;
	flex-direction: column;
	gap: var(--gap8);
}

.profile__label {
	font-size: var(--fs14);
	font-weight: var(--fw600);
	color: var(--text-secondary);
}

.profile__value {
	font-size: var(--fs16);
	font-weight: var(--fw400);
	color: var(--text-primary);
	word-break: normal;
	overflow-wrap: anywhere;
}

/* ==== SETTINGS BLOCK ==== */

.settings {
	padding: 24px;
	background: var(--clr-alpha-black-10);
	border: 1px solid var(--brdr-skeumo-gradient);
	border-radius: var(--br16);
	gap: 20px;
}

.settings__title {
	font-size: 1.875rem;
	font-weight: var(--fw600);
}

.settings__form {
	display: flex;
	flex-direction: column;
	gap: var(--gap24);
	padding-top: 20px;
}

/* ==== SECTIONS ==== */
.settings__section {
	border: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--gap24);
}

.settings__section-title {
	font-size: var(--fs18);
	font-weight: 500;
	display: block;
	margin-bottom: 24px;
}

/* ==== FIELDS ==== */
.settings__field {
	display: grid;
	grid-template-columns: 180px 1fr;
	align-items: center;
	gap: var(--gap32);
}

.settings__field-control {
	width: 100%;
}

.settings__field--textarea {
	grid-template-columns: 1fr;
	align-items: flex-start;
	gap: var(--gap8);
}

.settings__field--textarea .settings__field-label {
	padding-top: 0;
}

.settings__field-label {
	padding-top: 10px;
	font-size: var(--fs14);
	font-weight: var(--fw600);
	color: var(--text-secondary);
}

@media (max-width: 640px) {
	.settings__field {
		grid-template-columns: 1fr;
	}

	.settings__field-label {
		padding-top: 0;
	}
}

/* ==== CHECKBOX ==== */
.settings__checkbox {
	display: flex;
	align-items: center;
	gap: var(--gap8);
	cursor: pointer;
}

.settings__checkbox--full {
	grid-column: -1 / 1;
}

.settings__checkbox input {
	background: var(--clr-aplha-white-50);
}

/* custom override */
.settings__checkbox-input {
	appearance: none; /* odstraní nativní vzhled */
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 4px;
	background: var(--clr-alpha-white-50);
	cursor: pointer;
	position: relative;
}

.settings__checkbox-input:checked {
	background: var(--bg-brand-solid); /* třeba modrá */
	border-color: var(--clr-accent);
}

.settings__checkbox-input:checked::after {
	content: "✔";
	color: #fff;
	font-size: 12px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.settings__checkbox-input {
	width: 18px;
	height: 18px;
	accent-color: var(--bg-brand-solid); /* podpora moderních browserů */
}

.settings__checkbox-label {
	font-size: var(--fs14);
	font-weight: var(--fw500);
	color: var(--text-secondary);
}

/* ==== INPUTS ==== */
.settings__input,
.settings__textarea {
	width: 100%;
	/* max-width: 380px; */
	padding: 10px 14px;
	border: none;
	border-radius: var(--br8);
	background: var(--clr-aplha-white-50);
	color: #fff;
	font-size: var(--fs16);
	font-weight: var(--fw400);
	text-overflow: ellipsis;
	font-family: inherit;
}

.settings__input:focus,
.settings__input:focus-visible,
.settings__textarea:focus,
.settings__textarea:focus-visible {
	outline: 2px solid var(--bg-brand-solid);
}

.settings__textarea {
	min-height: 120px;
	resize: vertical;
}

.settings__avatar-control {
	display: flex;
	align-items: center;
	gap: var(--gap16);
	flex-wrap: wrap;
}

.settings__avatar-preview {
	width: 72px;
	height: 72px;
	border: 2px solid var(--bg-brand-solid);
	border-radius: 50%;
	object-fit: cover;
	background: var(--clr-alpha-black-10);
}

.settings__avatar-btn {
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: var(--br8);
	background: var(--clr-alpha-black-10);
	color: var(--text-secondary);
	cursor: pointer;
	font-size: var(--fs14);
	font-weight: var(--fw600);
	transition: background 0.2s ease;
}

.settings__avatar-btn:hover {
	background: var(--clr-alpha-black-20);
}

.settings__avatar-requirements {
	color: var(--text-tertiary);
	font-size: var(--fs14);
	line-height: 1.4;
}

.settings__actions {
	display: flex;
	justify-content: flex-start;
}

.settings__save-btn {
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: var(--br8);
	background: var(--clr-btn-submit, #00cfff);
	color: #000;
	cursor: pointer;
	font-size: var(--fs14);
	font-weight: var(--fw600);
	transition: background 0.2s ease;
}

.settings__save-btn:hover {
	background: #00b3e6;
}

.settings__save-btn:disabled,
.settings__avatar-btn:disabled,
.profile__add:disabled,
.password-change__btn:disabled {
	cursor: progress;
	opacity: 0.7;
}

.profile-form__status {
	display: none;
	width: 100%;
	padding: 12px 14px;
	border-radius: var(--br8);
	font-size: var(--fs14);
	font-weight: var(--fw500);
}

.profile-form__status.is-visible {
	display: block;
}

.profile-form__status.is-success {
	background: rgba(25, 191, 118, 0.18);
	color: #8ff0c1;
}

.profile-form__status.is-loading {
	background: rgba(0, 207, 255, 0.14);
	color: #8feeff;
}

.profile-form__status.is-error {
	background: rgba(255, 91, 91, 0.16);
	color: #ff9d9d;
}

.profile-form__error {
	min-height: 18px;
	margin-top: 6px;
	color: #ff7f7f;
	font-size: var(--fs14);
	font-weight: var(--fw500);
}

.profile-form__field--error .settings__textarea,
.profile-form__field--error .password-change__input {
	outline: 2px solid #ff5b5b;
}

/* ==== AVATAR ==== */
.settings__avatar {
	display: flex;
	width: fit-content;
	align-items: center;
	gap: 0.5rem;
	position: relative;
}

.settings__avatar-img {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--clr-bg-quaternary);
	border: 2px solid var(--clr-black-primary);
	object-fit: contain;
	padding: 16px;
}

.settings__avatar-upload {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--clr-black-primary);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: var(--fs16);
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	bottom: 0;
	right: 0;
}

/* ==== DELETE BUTTON ==== */
.settings__delete-btn {
	display: flex;
	align-items: center;
	padding: 10px 14px;
	gap: 8px;
	width: fit-content;
	border-radius: var(--br8);
	background-color: var(--clr-alpha-black-10);
	border: 1px solid var(--brdr-border-primary);
	color: var(--text-secondary);
	font-weight: var(--fw600);
	font-size: var(--fs14);
	cursor: pointer;
	transition: background 0.2s ease;
}

.settings__delete-btn img {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.settings__delete-btn:hover {
	background: var(--clr-alpha-black-20);
}

/****** ZMĚNA HESLA ******/
.favorites__content {
	height: fit-content;
	padding: 24px;
	background: var(--clr-alpha-black-10);
	border: 1px solid var(--brdr-skeumo-gradient);
	border-radius: var(--br16);
}

.favorites__list {
	display: grid;
	gap: 20px;
}

.favorites__title {
	font-size: 1.875rem;
	font-weight: var(--fw600);
}

.favorites__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px 16px;
}

.favorites__game-card {
	width: 100%;
	min-width: 0;
}

.favorites__pagination {
	max-width: none;
	margin-top: 8px;
	padding-top: 16px;
	border-top: 1px solid var(--brdr-border-primary);
}

.favorites__pagination .pagination__prev,
.favorites__pagination .pagination__next {
	display: flex;
	min-width: 104px;
}

.favorites__pagination .pagination__next {
	justify-content: flex-end;
}

.favorites__image {
	display: flex;
	justify-content: center;
	padding: 32px 0 8px;
}

.favorites__image img {
	max-width: min(420px, 100%);
	height: auto;
	object-fit: contain;
}

@media (max-width: 1180px) {
	.favorites__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.favorites__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 12px;
	}
}

@media (max-width: 482px) {
	.pagination.favorites__pagination {
		display: grid;
		grid-template-columns: max-content max-content;
		grid-template-areas:
			"pages pages"
			"prev next";
		justify-content: center;
		column-gap: 42px;
		row-gap: 10px;
		align-items: center;
	}

	.favorites__pagination .pagination__list {
		grid-area: pages;
		display: flex;
		justify-content: center;
		flex-wrap: wrap;
		gap: 4px;
	}

	.favorites__pagination .pagination__prev {
		grid-area: prev;
		justify-self: end;
		min-width: 0;
	}

	.favorites__pagination .pagination__next {
		grid-area: next;
		justify-self: end;
		min-width: 0;
	}

	.favorites__pagination .pagination__item {
		min-width: 40px;
		width: auto;
		padding: 0 12px;
	}
}

@media (max-width: 420px) {
	.favorites__content {
		padding: 20px;
	}

	.favorites__grid {
		gap: 14px 10px;
	}
}

.password-change {
	height: fit-content;
	padding: 24px;
	background: var(--clr-alpha-black-10);
	border: 1px solid var(--brdr-skeumo-gradient);
	border-radius: var(--br16);
}

.password-change__title {
	font-size: 1.5rem;
	margin-bottom: 1.5rem;
}

.password-change__form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.password-change__field {
	display: flex;
	gap: var(--gap32);
	flex-wrap: wrap;
}

@media (max-width: 640px) {
	.password-change__field {
		gap: var(--gap16);
	}
}

.password-change__label {
	min-width: 200px;
	font-weight: var(--fw600);
	color: var(--text-secondary);
}

.password-change__input {
	width: 100%;
	max-width: 360px;
	padding: 10px 14px;
	border: none;
	border-radius: var(--br8);
	background: var(--clr-aplha-white-50);
	color: #fff;
	font-size: var(--fs16);
	font-weight: var(--fw400);
	text-overflow: ellipsis;
	font-family: inherit;
}

.password-change__input:active,
.password-change__input:focus,
.password-change__input:focus-visible {
	outline: 2px solid var(--bg-brand-solid);
}

.password-change__group {
	width: 100%;
	max-width: 360px;
	display: flex;
	flex-direction: column;
	gap: var(--gap8);
}

.password-change__hint {
	font-size: var(--fs14);
	color: var(--text-tertiary);
	font-weight: var(--fw400);
}

.password-change__divider {
	border: none;
	border-top: 1px solid var(--clr-border, rgba(255, 255, 255, 0.2));
	margin: 1rem 0;
}

.password-change__actions {
	display: flex;
	justify-content: flex-start;
	gap: 1rem;
}

.password-change__btn {
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	font-weight: var(--fw600);
	transition: all 0.3s ease-in-out;
}

.password-change__btn--cancel {
	background: var(--clr-alpha-black-10);
	color: var(--text-secondary);
	font-size: var(--fs14);
	font-weight: var(--fw600);
}

.password-change__btn--submit {
	background: var(--clr-btn-submit, #00cfff);
	color: #000;
}

.password-change__btn:hover {
	background: var(--clr-alpha-black-20);
}

.password-change__btn--submit:hover {
	background: #00b3e6;
}

body.profile-avatar-viewer-open {
	overflow: hidden;
}

.profile-avatar-viewer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.profile-avatar-viewer[hidden] {
	display: none;
}

.profile-avatar-viewer__backdrop {
	position: absolute;
	inset: 0;
	border: 0;
	background: rgba(4, 7, 12, 0.78);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	cursor: zoom-out;
}

.profile-avatar-viewer__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: min(90vw, 680px);
	max-height: 90vh;
	padding: 24px;
	border-radius: var(--br16);
	background: rgba(22, 26, 33, 0.92);
	border: 1px solid var(--brdr-skeumo-gradient);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
}

.profile-avatar-viewer__img {
	display: block;
	width: min(80vw, 600px);
	max-height: min(80vh, 600px);
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: var(--br16);
}

.profile-avatar-viewer__close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.profile-avatar-viewer__close:focus-visible {
	outline: 2px solid var(--bg-brand-solid);
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.profile-avatar-viewer {
		padding: 16px;
	}

	.profile-avatar-viewer__dialog {
		padding: 16px;
	}
}
