﻿/* Profile Page (.profile-*) */
/* ============================================================
 * PROFILE PAGE  (.profile-*)
 * ============================================================ */
.profile-wrap {
	min-height: 80vh;
	padding-bottom: 60px;
}

.profile-layout {
	display: flex;
	gap: 32px;
	padding-top: 32px;
	align-items: flex-start;
	max-width: 1100px;
	margin-inline: auto;
}

/* Sidebar card */
.profile-sidebar {
	flex: 0 0 260px;
}

.profile-avatar-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 28px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	position: sticky;
	top: calc(var(--nav-h) + 20px);
}

.profile-stats {
	display: flex;
	gap: 16px;
	width: 100%;
	justify-content: center;
	padding: 12px 0;
	border-top: 1px solid #f3f4f6;
	border-bottom: 1px solid #f3f4f6;
}

.profile-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.profile-name {
	font-size: 18px;
	font-weight: 800;
	color: #111827;
	margin: 0;
}

.profile-email {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
	word-break: break-all;
}


.profile-stat__num {
	font-size: 15px;
	font-weight: 800;
	color: #123e8a;
}

.profile-stat__label {
	font-size: 11px;
	color: #9ca3af;
}

.profile-fav-link,
.profile-logout-link {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 8px;
	transition: background 0.2s, color 0.2s;
	justify-content: center;
}

.profile-link {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.profile-fav-link {
	background: #eef2ff;
	color: #123e8a;
}

.profile-fav-link:hover {
	background: #dbeafe;
}

.profile-logout-link {
	background: #fef2f2;
	color: #dc2626;
}

.profile-logout-link:hover {
	background: #fee2e2;
}

/* ── Mobile responsive (<768px) ────────────────────────────── */
@media (max-width: 767px) {

	/* Đổi layout sang dọc */
	.profile-layout {
		flex-direction: column;
		gap: 20px;
		padding-top: 20px;
	}

	/* Sidebar full-width, không sticky */
	.profile-sidebar {
		flex: none;
		width: 100%;
	}

	.profile-main {
		width: 100%;
	}

	/* Compact horizontal card */
	.profile-avatar-card {
		flex-direction: row;
		align-items: center;
		text-align: left;
		padding: 16px 20px;
		gap: 16px;
		position: static;
		border-radius: 12px;
		flex-wrap: wrap;
	}

	/* Avatar nhỏ hơn trên mobile */
	.profile-avatar {
		width: 64px !important;
		height: 64px !important;
		flex-shrink: 0;
	}

	.profile-stats {
		display: none;
	}

	/* Info block: name + email */
	.profile-avatar-card .profile-name {
		font-size: 15px;
		margin-bottom: 2px;
	}

	.profile-avatar-card .profile-email {
		font-size: 12px;
	}

	.profile-info-group {
		display: flex;
		flex-direction: column;
		gap: 3px;
		flex: 1;
		min-width: 0;
	}

	.profile-info-group .profile-name {
		font-size: 15px;
	}

	.profile-info-group .profile-email {
		font-size: 12px;
	}

	/* Social icons nhỏ hơn, ở cuối cùng */
	.profile-social-icons {
		order: 3;
		width: 100%;
		justify-content: flex-start;
		gap: 8px;
		padding-top: 4px;
		border-top: 1px solid #f3f4f6;
	}

	.profile-social-icon {
		width: 30px;
		height: 30px;
	}

	/* 2 action buttons: dạng row, nhỏ hơn */
	.profile-link {
		width: 100%;
		display: flex;
		flex-direction: row;
	}

	.profile-logout-link {
		width: 40%;
	}

	.profile-fav-link {
		width: 60%;
	}
}


/* Main content card */
.profile-main {
	flex: 1;
	min-width: 0;
}

.profile-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 32px;
}

.profile-card__title {
	font-size: 20px;
	font-weight: 800;
	color: #111827;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid #e5e7eb;
}

.profile-field {
	margin-bottom: 20px;
}

.profile-field__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #9ca3af;
	margin-bottom: 4px;
}

.profile-field__value {
	font-size: 15px;
	color: #1f2937;
}

/* .profile-edit-btn moved to inline-editing section below */

/* Dark mode – profile (unique rules not in shared groups) */
body.dark-mode .profile-stats {
	border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .profile-card__title {
	border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .profile-fav-link {
	background: rgba(18, 62, 138, 0.3);
	color: #60a5fa;
}

body.dark-mode .profile-logout-link {
	background: rgba(220, 38, 38, 0.15);
	color: #f87171;
}

/* Dark mode – móbile social border */
@media (max-width: 767px) {
	body.dark-mode .profile-social-icons {
		border-top-color: rgba(255, 255, 255, 0.08);
	}

	body.dark-mode .profile-info-group .profile-stats {
		border-top-color: rgba(255, 255, 255, 0.06);
	}
}

/* FAVORITES PAGE  (.fav-*) */
.fav-wrap {
	min-height: 80vh;
	padding-bottom: 60px;
}

.fav-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 28px 0 20px;
	max-width: 1100px;
	margin-inline: auto;
}

.fav-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 22px;
	font-weight: 800;
	color: #111827;
}

.fav-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #eef2ff;
	color: #123e8a;
	font-size: 13px;
	font-weight: 700;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border-radius: 20px;
}

.fav-back-link {
	font-size: 13px;
	color: #6b7280;
	text-decoration: none;
	transition: color 0.2s;
}

.fav-back-link:hover {
	color: #123e8a;
}

/* Empty state */
.fav-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 80px 20px;
	color: #9ca3af;
	max-width: 400px;
	margin-inline: auto;
	text-align: center;
}

.fav-empty svg {
	opacity: 0.4;
}

.fav-empty__title {
	font-size: 17px;
	font-weight: 700;
	color: #374151;
}

.fav-empty__sub {
	font-size: 14px;
}

.fav-empty__cta {
	margin-top: 8px;
	display: inline-flex;
	padding: 10px 24px;
	background: #123e8a;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	border-radius: 8px;
	text-decoration: none;
	transition: opacity 0.2s;
}

.fav-empty__cta:hover {
	opacity: 0.85;
}

/* Cards grid */
.fav-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	max-width: 1100px;
	margin-inline: auto;
	padding-bottom: 40px;
}

.fav-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	position: relative;
}

.fav-card:hover {
	border-color: #123e8a;
}

.fav-card__img-wrap {
	display: block;
	width: 100%;
	height: 160px;
	overflow: hidden;
}

.fav-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}

.fav-card:hover .fav-card__img {
	transform: scale(1.04);
}

.fav-card__body {
	padding: 14px 16px 8px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fav-card__cat {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #123e8a;
	text-decoration: none;
}

.fav-card__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	color: #111827;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fav-card__title a {
	color: inherit;
	text-decoration: none;
}

.fav-card__title a:hover {
	color: #123e8a;
}

.fav-card__meta {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: #9ca3af;
}

.fav-remove-btn {
	display: inline-flex;
	position: absolute;
	top: 10px;
	right: 10px;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	background: #f3f4f6;
	border: none;
	border-radius: 100%;
	padding: 5px;
	cursor: pointer;
}

.fav-remove-btn:hover {
	background: #fee2e2;
	color: #dc2626;
}

body.dark-mode .fav-count {
	background: rgba(18, 62, 138, 0.3);
	color: #60a5fa;
}

body.dark-mode .fav-card:hover {
	border-color: #60a5fa;
}

body.dark-mode .fav-empty__title {
	color: #d1d5db;
}

body.dark-mode .fav-remove-btn {
	background: #2d3036;
	color: #9ca3af;
}

body.dark-mode .fav-remove-btn:hover {
	background: rgba(220, 38, 38, 0.2);
	color: #f87171;
}

/* ============================================================
* PROFILE PAGE – INLINE EDITING EXTENSIONS
* ============================================================ */

/* Card header row: title + action buttons */
.profile-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid #e5e7eb;
}

.profile-card__title {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.profile-edit-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Shared button base */
.profile-edit-btn,
.profile-save-btn,
.profile-cancel-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 700;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: opacity 0.2s, background 0.2s;
	text-decoration: none;
}

.profile-save-btn,
.profile-edit-btn {
	background: #123e8a;
	color: #fff;
}

.profile-save-btn:hover,
.profile-edit-btn:hover {
	opacity: 0.85;
	color: #fff;
}

.profile-cancel-btn {
	background: #f3f4f6;
	color: #374151;
}

.profile-cancel-btn:hover {
	background: #e5e7eb;
}

/* Fields grid */
.profile-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 24px;
}

.profile-field--full {
	grid-column: 1 / -1;
}

/* Input/textarea styles */
.profile-field__input {
	width: 100%;
	padding: 9px 13px;
	font-size: 15px;
	font-family: inherit;
	color: #1f2937;
	background: #f9fafb;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	transition: border-color 0.2s, background 0.2s;
	box-sizing: border-box;
}

.profile-field__input:focus {
	outline: none;
	border-color: #123e8a;
	background: #fff;
}

.profile-field__textarea {
	resize: vertical;
	min-height: 80px;
}

/* Avatar overlay */
.profile-avatar-wrap {
	position: relative;
	display: inline-block;
}

.profile-avatar {
	width: 100px !important;
	height: 100px !important;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #eef2ff;
	display: block;
}

.profile-avatar-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.2s;
}

.profile-avatar-wrap:hover .profile-avatar-overlay {
	opacity: 1;
}

/* Social icons in sidebar */
.profile-social-icons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
}

.profile-social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: #f3f4f6;
	color: #374151;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.profile-social-icon:hover {
	background: #eef2ff;
	color: #123e8a;
}

/* Social section inside main card */
.profile-social-section {
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.profile-section-title {
	font-size: 15px;
	font-weight: 700;
	color: #374151;
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Label with icon */
.profile-field__label {
	display: flex;
	align-items: center;
	gap: 5px;
}

/* Message banners */
.profile-msg {
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 16px;
}

.profile-msg--ok {
	background: #dcfce7;
	color: #15803d;
}

.profile-msg--error {
	background: #fef2f2;
	color: #dc2626;
}

/* Password section */
.profile-card--pw {
	margin-top: 20px;
	padding: 0;
	overflow: hidden;
}

.profile-pw-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 18px 28px;
	background: none;
	border: none;
	font-size: 15px;
	font-weight: 700;
	color: #374151;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s;
}

.profile-pw-toggle:hover {
	background: #f9fafb;
}

.profile-pw-chevron {
	margin-left: auto;
	transition: transform 0.2s;
}

.profile-pw-toggle.is-open .profile-pw-chevron {
	transform: rotate(180deg);
}

.profile-pw-body {
	padding: 0 28px 24px;
	border-top: 1px solid #e5e7eb;
}

.profile-pw-body .profile-fields {
	padding-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
	.profile-fields {
		grid-template-columns: 1fr;
	}

	.profile-card {
		padding: 20px 16px;
	}

	.profile-pw-toggle,
	.profile-pw-body {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Dark mode – inline editing extensions */
body.dark-mode .profile-card__header {
	border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .profile-social-section {
	border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .profile-pw-body {
	border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .profile-pw-toggle:hover {
	background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .profile-social-icon {
	background: rgba(255, 255, 255, 0.07);
	color: #d1d5db;
}

body.dark-mode .profile-social-icon:hover {
	background: rgba(18, 62, 138, 0.35);
	color: #60a5fa;
}

body.dark-mode .profile-field__input {
	background: #1e2330;
	border-color: rgba(255, 255, 255, 0.12);
	color: #e5e7eb;
}

body.dark-mode .profile-field__input:focus {
	border-color: #60a5fa;
	background: #252b3b;
}

body.dark-mode .profile-cancel-btn {
	background: #2d3036;
	color: #d1d5db;
}

body.dark-mode .profile-cancel-btn:hover {
	background: #3a3f4a;
}


body.dark-mode .profile-msg--error {
	background: rgba(220, 38, 38, 0.15);
	color: #f87171;
}

