/**
 * CircleKit Profile Styles
 * Premium, modern profile page
 *
 * @package CircleKit
 */

/* ===== Profile Card Wrapper ===== */
.ck-profile-card-wrap {
	border-radius: var(--ck-radius-lg);
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
	background: var(--ck-card, #fff);
	overflow: visible;
	margin-bottom: 4px;
}

/* ===== Cover Image ===== */
.ck-profile-cover {
	height: 280px;
	background: linear-gradient(135deg, var(--ck-purple), var(--ck-purple-light), var(--ck-teal));
	background-size: cover;
	background-position: center;
	border-radius: var(--ck-radius-lg) var(--ck-radius-lg) 0 0;
	position: relative;
	overflow: hidden;
}

.ck-profile-cover.ck-repositioning {
	cursor: grab;
	outline: 2px dashed rgba(255, 255, 255, 0.5);
	outline-offset: -4px;
}

.ck-profile-cover.ck-repositioning:active {
	cursor: grabbing;
}

.ck-cover-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.2));
}

/* Cover action buttons container — stacked vertically, bottom-right */
.ck-cover-actions {
	position: absolute;
	bottom: 16px;
	right: 16px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 8px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.ck-profile-cover:hover .ck-cover-actions {
	opacity: 1;
}

/* Shared icon button style */
.ck-cover-icon-btn {
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	max-width: 40px;
	max-height: 40px;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	color: var(--ck-ink);
	transition: all 0.15s ease;
	position: relative;
}

.ck-cover-icon-btn:hover {
	background: white;
	transform: scale(1.08);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Cover update dropdown */
.ck-cover-dropdown-wrap {
	position: relative;
}

.ck-cover-dropdown {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: white;
	border: 1px solid var(--ck-border);
	border-radius: var(--ck-radius);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
	min-width: 200px;
	padding: 6px;
	display: none;
	animation: ck-cover-dd-in 0.15s ease;
	z-index: 10;
}

.ck-cover-dropdown.show {
	display: block;
}

@keyframes ck-cover-dd-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ck-cover-dd-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 14px;
	border: none;
	background: none;
	font-size: 14px;
	font-family: var(--ck-font);
	color: var(--ck-ink-2);
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.12s;
}

.ck-cover-dd-item:hover {
	background: var(--ck-bg);
}

.ck-cover-dd-item svg,
.ck-cover-dd-item .ck-dd-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ck-cover-dd-item.ck-dd-danger {
	color: var(--ck-red);
}

.ck-cover-dd-item.ck-dd-danger:hover {
	background: rgba(239, 68, 68, 0.06);
}

.ck-cover-dd-divider {
	height: 1px;
	background: var(--ck-border-light);
	margin: 4px 8px;
}

/* ===== Profile Header ===== */
.ck-profile-header {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	padding: 0 32px 20px;
	position: relative;
	z-index: 1;
}

.ck-profile-avatar-wrap {
	position: relative;
	flex-shrink: 0;
	cursor: pointer;
	margin-top: -38px;
}

.ck-profile-avatar-wrap .ck-avatar-xl {
	width: 128px;
	height: 128px;
	border: 4px solid white;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.ck-online-dot-lg {
	width: 16px;
	height: 16px;
	border: 3px solid white;
	bottom: 8px;
	right: 8px;
	z-index: 2;
}

.ck-avatar-edit {
	position: absolute;
	bottom: 4px;
	left: -4px;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	max-width: 32px;
	max-height: 32px;
	padding: 0;
	border-radius: 50%;
	background: white;
	border: 2px solid var(--ck-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--ck-shadow);
	transition: var(--ck-transition);
	z-index: 3;
	opacity: 0;
	pointer-events: none;
}

.ck-profile-avatar-wrap:hover .ck-avatar-edit {
	opacity: 1;
	pointer-events: auto;
}

.ck-avatar-edit:hover {
	background: var(--ck-purple-glow);
	border-color: var(--ck-purple);
}

/* Remove avatar button */
.ck-avatar-remove {
	position: absolute;
	top: 4px;
	left: -4px;
	width: 24px;
	height: 24px;
	min-width: 24px;
	min-height: 24px;
	max-width: 24px;
	max-height: 24px;
	padding: 0;
	border-radius: 50%;
	background: var(--ck-red);
	border: 2px solid white;
	color: white;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--ck-shadow);
	transition: var(--ck-transition);
	z-index: 3;
	opacity: 0;
	pointer-events: none;
}

.ck-profile-avatar-wrap:hover .ck-avatar-remove {
	opacity: 1;
	pointer-events: auto;
}

.ck-avatar-remove:hover {
	background: #dc2626;
	transform: scale(1.1);
}

/* ===== Profile Info ===== */
.ck-profile-info {
	flex: 1;
	min-width: 0;
	padding-top: 20px;
	padding-bottom: 4px;
}

.ck-profile-name {
	font-size: 26px;
	font-weight: 800;
	color: var(--ck-ink);
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 8px;
	line-height: 1.2;
}

.ck-verified {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--ck-purple);
	color: white;
	font-size: 12px;
	font-weight: 700;
}

.ck-profile-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--ck-muted);
	flex-wrap: wrap;
}

.ck-meta-dot {
	color: var(--ck-subtle);
}

.ck-status-online {
	color: var(--ck-green);
	font-weight: 600;
}

.ck-profile-bio {
	font-size: 15px;
	color: var(--ck-ink-3);
	margin: 12px 0 0;
	max-width: 600px;
	line-height: 1.6;
}

/* ===== Profile Actions ===== */
.ck-profile-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	padding-top: 8px;
	padding-bottom: 4px;
}

/* ===== Stats Bar ===== */
.ck-profile-stats {
	display: flex;
	gap: 0;
	padding: 0;
	margin: 0 0 4px;
	border-bottom: 1px solid var(--ck-border);
}

.ck-stat-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 16px 28px;
	cursor: default;
	transition: var(--ck-transition);
}

.ck-stat-item:hover {
	background: var(--ck-purple-soft);
}

.ck-stat-value {
	font-size: 20px;
	font-weight: 800;
	color: var(--ck-ink);
	line-height: 1;
}

.ck-stat-label {
	font-size: 12px;
	color: var(--ck-muted);
	font-weight: 500;
	margin-top: 4px;
}

.ck-stat-completion {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
	margin-left: auto;
	padding: 8px 20px;
	background: var(--ck-purple-soft);
	border-radius: var(--ck-radius-sm);
}

/* ===== Tabs ===== */
.ck-profile-tabs {
	display: flex;
	gap: 0;
	padding: 0;
	border-bottom: 2px solid var(--ck-border-light);
	overflow-x: auto;
}

.ck-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 20px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ck-muted);
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: var(--ck-transition);
	white-space: nowrap;
	text-decoration: none !important;
	border-radius: 6px 6px 0 0;
}

.ck-tab:hover {
	color: var(--ck-ink-2);
	background: var(--ck-bg);
	text-decoration: none !important;
}

.ck-tab.active {
	color: var(--ck-purple) !important;
	border-bottom-color: var(--ck-purple) !important;
	background: var(--ck-purple-soft);
	font-weight: 700;
}

.ck-tab-icon {
	font-size: 15px;
	display: inline-flex;
	align-items: center;
}

.ck-tab-icon svg {
	display: block;
}

.ck-tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--ck-bg-2, #f1f5f9);
	font-size: 11px;
	font-weight: 700;
	color: var(--ck-ink-3, #64748b);
	margin-left: 4px;
}

.ck-tab.active .ck-tab-count {
	background: var(--ck-purple-soft, rgba(109,40,217,0.1));
	color: var(--ck-purple, #6d28d9);
}

/* ===== Content ===== */
.ck-profile-content {
	padding: 24px 0;
}

/* Overview Grid */
.ck-overview-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.ck-overview-bio {
	grid-column: 1 / -1;
}

.ck-overview-bio h3,
.ck-overview-info h3,
.ck-overview-completion h3,
.ck-overview-activity h3 {
	font-size: 16px;
	font-weight: 700;
	color: var(--ck-ink);
	margin: 0 0 12px;
}

.ck-overview-bio p {
	color: var(--ck-ink-3);
	font-size: 15px;
	margin: 0;
	line-height: 1.7;
}

/* Field List */
.ck-field-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ck-field-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--ck-border-light);
}

.ck-field-row:last-child {
	border-bottom: none;
}

.ck-field-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ck-muted);
	min-width: 140px;
	flex-shrink: 0;
}

.ck-field-value {
	font-size: 14px;
	color: var(--ck-ink-2);
}

/* Completion Bar */
.ck-completion-bar {
	height: 8px;
	background: var(--ck-border);
	border-radius: 100px;
	overflow: hidden;
	margin-bottom: 8px;
}

.ck-completion-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--ck-purple), var(--ck-teal));
	border-radius: 100px;
	transition: width 0.6s ease;
}

.ck-completion-text {
	font-size: 13px;
	color: var(--ck-muted);
	margin: 0;
}

/* Muted text */
.ck-muted {
	color: var(--ck-subtle);
}

/* About Section */
.ck-about-section .ck-card h3 {
	font-size: 16px;
	font-weight: 700;
	color: var(--ck-ink);
	margin: 0 0 16px;
	padding: 0 0 12px;
	border-bottom: 1px solid var(--ck-border-light);
}

/* ===== Toast Notifications ===== */
.ck-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	padding: 14px 24px;
	border-radius: var(--ck-radius-sm);
	font-size: 14px;
	font-weight: 600;
	font-family: var(--ck-font);
	z-index: 10000;
	transform: translateY(20px);
	opacity: 0;
	transition: all 0.3s ease;
	box-shadow: var(--ck-shadow-lg);
}

.ck-toast.show {
	transform: translateY(0);
	opacity: 1;
}

.ck-toast-success {
	background: var(--ck-green);
	color: white;
}

.ck-toast-error {
	background: var(--ck-red);
	color: white;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
	.ck-profile-header {
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 0 0 24px;
		margin-top: -64px;
	}

	.ck-profile-info {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.ck-profile-name {
		justify-content: center;
	}

	.ck-profile-meta {
		justify-content: center;
	}

	.ck-profile-bio {
		text-align: center;
	}

	.ck-profile-actions {
		justify-content: center;
	}

	.ck-profile-stats {
		padding: 0;
		justify-content: center;
		flex-wrap: wrap;
	}

	.ck-profile-tabs {
		padding: 0;
	}

	.ck-profile-content {
		padding: 20px 0;
	}

	.ck-overview-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.ck-profile-cover {
		height: 180px;
		border-radius: 0;
	}

	.ck-profile-avatar-wrap .ck-avatar-xl {
		width: 96px;
		height: 96px;
	}

	.ck-profile-name {
		font-size: 22px;
	}

	.ck-tab {
		padding: 12px 14px;
		font-size: 13px;
	}

	.ck-stat-item {
		padding: 12px 16px;
	}
}

/* ===== Media Grid (Profile Tab) ===== */
.ck-media-section {
	padding: 0;
}

/* Sub-Tabs: All | Photos | Videos | Documents */
.ck-media-subtabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid var(--ck-border-light);
	margin-bottom: 20px;
}

.ck-media-subtab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ck-muted);
	background: none !important;
	border: none !important;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s;
	font-family: var(--ck-font);
	outline: none !important;
	box-shadow: none !important;
}

.ck-media-subtab:hover {
	color: var(--ck-ink-2);
	background: var(--ck-bg) !important;
}

.ck-media-subtab.active {
	color: var(--ck-purple);
	border-bottom-color: var(--ck-purple);
}

.ck-media-subtab:focus,
.ck-media-subtab:active {
	background: none !important;
	outline: none !important;
}

.ck-media-count {
	font-size: 12px;
	font-weight: 500;
	color: var(--ck-subtle);
	background: var(--ck-bg);
	border-radius: 10px;
	padding: 1px 8px;
	min-width: 18px;
	text-align: center;
}

.ck-media-subtab.active .ck-media-count {
	background: var(--ck-purple-soft);
	color: var(--ck-purple);
}

/* 4-Column Grid */
.ck-media-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.ck-media-grid-item {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 8px;
	background: var(--ck-bg);
	cursor: pointer;
}

.ck-media-grid-item img,
.ck-media-grid-item video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s ease;
}

.ck-media-grid-item:hover img,
.ck-media-grid-item:hover video {
	transform: scale(1.05);
}

.ck-media-play-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	pointer-events: none;
}

/* Document Card */
.ck-media-doc {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 16px 8px;
	text-align: center;
	background: var(--ck-bg);
}

.ck-media-doc-icon {
	font-size: 36px;
	margin-bottom: 8px;
}

.ck-media-doc-name {
	font-size: 12px;
	color: var(--ck-ink-3);
	font-weight: 500;
	word-break: break-all;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

@media (max-width: 768px) {
	.ck-media-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 480px) {
	.ck-media-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.ck-media-subtab {
		padding: 10px 14px;
		font-size: 13px;
	}
}
