/* START: Core Styling */

.kol-myplace-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.kol-myplace-grid {
	display: grid;
	grid-template-columns: 250px 1fr;
	gap: 20px;
	margin-top: 20px;
}

.kol-myplace-left,
.kol-myplace-right,
.kol-myplace-right-top,
.kol-myplace-right-bottom {
	min-width: 0;
}

.kol-bp-wrapper,
.kol-mypics-wrapper {
	box-sizing: border-box;
	margin: 0 auto;
	max-width: 1200px;
	padding: 20px;
}

.kol-bp-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: 1fr;
}

.kol-bp-grid.kol-bp-has-sidebar {
	grid-template-columns: minmax(0, 1fr) 280px;
}

.kol-bp-main,
.kol-bp-sidebar,
.kol-mypics-profile-header,
.kol-mypics-highlights-row,
.kol-mypics-grid-area,
.kol-mypics-sidebar {
	min-width: 0;
}

.kol-mypics-profile-header,
.kol-mypics-highlights-row {
	margin-bottom: 20px;
}

.kol-mypics-content {
	display: grid;
	gap: 20px;
	grid-template-columns: minmax(0, 1fr);
}

.kol-mypics-content:has(.kol-mypics-sidebar) {
	grid-template-columns: minmax(0, 1fr) 280px;
}

@media (max-width: 768px) {
	.kol-myplace-grid,
	.kol-bp-grid.kol-bp-has-sidebar,
	.kol-mypics-content:has(.kol-mypics-sidebar) {
		grid-template-columns: 1fr;
	}

	.kol-myplace-wrapper {
		padding: 10px;
	}

	.kol-bp-wrapper,
	.kol-mypics-wrapper {
		padding: 10px;
	}
}

@media (max-width: 480px) {
	.kol-myplace-wrapper {
		max-width: 100%;
		padding: 8px;
		font-size: 14px;
	}

	.kol-myplace-grid {
		gap: 12px;
	}

	.kol-myplace-left,
	.kol-myplace-right {
		gap: 12px;
	}

	.kol-myplace-widget,
	.kol-myplace-section {
		margin-bottom: 12px;
		padding: 10px;
		border-radius: 6px;
	}

	.kol-bp-wrapper,
	.kol-mypics-wrapper {
		max-width: 100%;
		padding: 8px;
	}

	.kol-mypics-profile-header,
	.kol-mypics-highlights-row {
		margin-bottom: 12px;
	}

	/* Widget-specific mobile adjustments */
	.kol-widget-about-me textarea,
	.kol-widget-message-form textarea {
		font-size: 14px;
		min-height: 90px;
		padding: 8px;
	}

	.kol-widget-about-me h3,
	.kol-widget-message-form h3,
	.kol-widget-activity-feed h3 {
		font-size: 14px;
		margin: 0 0 8px 0;
	}

	.bp-button,
	button[type="submit"] {
		width: 100%;
		min-height: 44px;
		padding: 10px;
		font-size: 13px;
	}

	.kol-widget-followers-stat-item {
		flex: 0 1 calc(33.333% - 6px);
		font-size: 12px;
	}

	.kol-myplace-fallback-card {
		flex-direction: column;
		text-align: center;
		gap: 10px;
	}

	.kol-myplace-fallback-avatar {
		height: 60px;
		width: 60px;
	}

	.kol-myplace-fallback-card h2 {
		font-size: 20px;
	}
}

@media (max-width: 375px) {
	.kol-myplace-wrapper {
		padding: 6px;
		font-size: 13px;
	}

	.kol-myplace-grid,
	.kol-bp-grid,
	.kol-mypics-content {
		gap: 8px;
	}

	.kol-myplace-widget,
	.kol-myplace-section {
		padding: 8px;
		margin-bottom: 8px;
	}

	.kol-widget-about-me textarea,
	.kol-widget-message-form textarea {
		font-size: 12px;
		min-height: 70px;
		padding: 6px;
	}

	.bp-button,
	button[type="submit"] {
		font-size: 12px;
		padding: 8px;
		min-height: 40px;
	}

	.kol-myplace-fallback-card h2 {
		font-size: 18px;
	}

	.kol-myplace-fallback-avatar {
		height: 52px;
		width: 52px;
	}
}

@media (max-width: 375px) {
	.kol-myplace-avatar-dialog {
		width: calc(100% - 4px);
		left: 2px;
		right: 2px;
		top: 40px;
		bottom: 40px;
		max-height: calc(100vh - 80px);
	}

	.kol-myplace-avatar-header {
		padding: 10px 12px;
	}

	.kol-myplace-avatar-header h2 {
		font-size: 14px;
	}

	.kol-myplace-avatar-body {
		max-height: calc(100vh - 140px);
		padding: 10px;
	}

	.kol-myplace-avatar-crop-frame {
		height: min(140px, calc(100vw - 72px));
		width: min(140px, calc(100vw - 72px));
	}

	.kol-myplace-avatar-preview > img {
		height: 90px;
		width: 90px;
	}

	.kol-myplace-avatar-history {
		grid-template-columns: repeat(3, minmax(45px, 1fr));
		gap: 5px;
	}

	.kol-myplace-avatar-primary {
		padding: 8px 8px;
		font-size: 11px;
		min-height: 36px;
	}
}

/* Template Cards */
.kol-myplace-template-card {
	border-radius: 8px;
	padding: 15px;
	border: 2px solid transparent;
	transition: all 0.3s ease;
	cursor: pointer;
}

.kol-myplace-template-card.active {
	border-color: #2196F3;
	background-color: rgba(33, 150, 243, 0.05);
}

.kol-myplace-template-card:hover {
	box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.kol-myplace-widget,
.kol-myplace-section {
	margin-bottom: 20px;
	border-radius: 8px;
	padding: 15px;
}

.kol-myplace-fallback-profile {
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
	color: #111827;
	margin: 0 0 20px;
	padding: 20px;
}

.kol-myplace-fallback-card {
	align-items: center;
	display: flex;
	gap: 14px;
	margin-bottom: 16px;
}

.kol-myplace-fallback-card h2 {
	font-size: 24px;
	line-height: 1.2;
	margin: 0;
}

.kol-myplace-fallback-avatar {
	border-radius: 50%;
	height: 72px;
	object-fit: cover;
	width: 72px;
}

.kol-mybook-avatar-wrap,
.kol-mypress-avatar-frame,
.kol-myplace-avatar-shell,
.kol-myplace-fallback-avatar-wrap {
	display: inline-block;
	position: relative;
}

.kol-myplace-avatar-trigger {
	align-items: center;
	background: #111827;
	border: 2px solid #fff;
	border-radius: 999px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
	color: #fff;
	cursor: pointer;
	display: flex;
	height: 38px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	position: absolute;
	right: -4px;
	bottom: -4px;
	width: 38px;
	z-index: 15;
}

.kol-myplace-avatar-trigger:hover,
.kol-myplace-avatar-trigger:focus {
	background: #0085ba;
	color: #fff;
	outline: 2px solid rgba(0, 133, 186, 0.35);
	outline-offset: 2px;
}

.kol-myplace-avatar-trigger .dashicons {
	font-size: 18px;
	height: 18px;
	width: 18px;
}

.kol-myplace-fallback-muted {
	color: #64748b;
	margin: 4px 0 0;
}

.kol-myplace-fallback-stats {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 16px 0;
}

@media (max-width: 480px) {
	.kol-myplace-fallback-stats {
		gap: 8px;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.kol-myplace-fallback-stats span {
		padding: 8px;
	}

	.kol-myplace-fallback-stats strong {
		font-size: 16px;
	}
}

.kol-myplace-fallback-stats span {
	background: #f3f4f6;
	border-radius: 6px;
	padding: 10px;
	text-align: center;
}

.kol-myplace-fallback-stats strong {
	display: block;
	font-size: 20px;
}

.kol-myplace-fallback-about h3 {
	font-size: 18px;
	margin: 0 0 8px;
}

.kol-myplace-fallback-about p {
	margin: 0;
}

html.dark-mode .kol-myplace-fallback-profile {
	background: #181818;
	border-color: rgba(255, 255, 255, 0.12);
	color: #f3f4f6;
}

html.dark-mode .kol-myplace-fallback-muted {
	color: #a3a3a3;
}

html.dark-mode .kol-myplace-fallback-stats span {
	background: #262626;
}

body.kol-myplace-avatar-lock {
	overflow: hidden;
}

.kol-myplace-avatar-modal {
	display: none;
	inset: 0;
	position: fixed;
	z-index: 999999;
}

.kol-myplace-avatar-modal.is-open {
	display: block;
}

.kol-myplace-avatar-backdrop {
	background: rgba(0, 0, 0, 0.62);
	inset: 0;
	position: absolute;
}

.kol-myplace-avatar-dialog {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
	color: #111827;
	left: 50%;
	max-height: min(760px, calc(100vh - 48px));
	max-width: 520px;
	overflow: hidden;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(100vw - 32px);
}

@media (max-width: 768px) {
	.kol-myplace-avatar-dialog {
		border-radius: 12px 12px 0 0;
		bottom: 50px;
		left: 2px;
		max-height: calc(100vh - 100px);
		max-width: none;
		right: 2px;
		top: 50px;
		transform: none;
		width: calc(100% - 4px);
	}
}

.kol-myplace-avatar-header {
	align-items: center;
	border-bottom: 1px solid rgba(15, 23, 42, 0.12);
	display: flex;
	justify-content: space-between;
	padding: 16px 18px;
}

.kol-myplace-avatar-header h2 {
	font-size: 20px;
	line-height: 1.25;
	margin: 0;
}

.kol-myplace-avatar-close {
	background: transparent;
	border: 0;
	color: #475569;
	cursor: pointer;
	font-size: 30px;
	height: 36px;
	line-height: 1;
	padding: 0;
	width: 36px;
}

.kol-myplace-avatar-body {
	max-height: calc(100vh - 142px);
	overflow-y: auto;
	padding: 18px;
}

@media (max-width: 768px) {
	.kol-myplace-avatar-body {
		max-height: calc(100vh - 170px);
		padding-bottom: max(18px, env(safe-area-inset-bottom));
	}
}

.kol-myplace-avatar-upload-form {
	display: grid;
	gap: 12px;
}

.kol-myplace-avatar-upload-form label,
.kol-myplace-avatar-history-wrap h3 {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
}

.kol-myplace-avatar-dropzone {
	align-items: center;
	background: #f8fafc;
	border: 1px dashed #94a3b8;
	border-radius: 8px;
	color: #111827;
	cursor: pointer;
	display: flex;
	gap: 8px;
	justify-content: center;
	min-height: auto;
	padding: 12px 18px;
	text-align: center;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.kol-myplace-avatar-dropzone:hover,
.kol-myplace-avatar-dropzone:focus-within {
	background: #eef6ff;
	border-color: #0085ba;
}

.kol-myplace-avatar-dropzone input[type="file"] {
	height: 1px;
	opacity: 0;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.kol-myplace-avatar-dropzone-text {
	color: #0f172a;
	font-size: 14px;
	font-weight: 500;
}

.kol-myplace-avatar-file-name {
	color: #64748b;
	font-size: 13px;
	font-weight: 400;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: none;
}

.kol-myplace-avatar-preview {
	align-items: center;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	display: grid;
	gap: 12px;
	justify-items: center;
	padding: 12px;
}

.kol-myplace-avatar-preview[hidden] {
	display: none;
}

.kol-myplace-avatar-crop-frame {
	aspect-ratio: 1;
	background: #111827;
	border-radius: 999px;
	cursor: grab;
	height: min(260px, calc(100vw - 96px));
	overflow: hidden;
	position: relative;
	touch-action: none;
	width: min(260px, calc(100vw - 96px));
}

.kol-myplace-avatar-crop-frame:active {
	cursor: grabbing;
}

.kol-myplace-avatar-crop-frame img {
	left: 50%;
	max-width: none;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	transform-origin: center center;
	user-select: none;
	will-change: transform;
}

.kol-myplace-avatar-crop-mask {
	border: 2px solid rgba(255, 255, 255, 0.86);
	border-radius: 999px;
	box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.08);
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.kol-myplace-avatar-zoom-label {
	color: #334155;
	font-size: 13px;
	font-weight: 800;
	justify-self: start;
}

.kol-myplace-avatar-zoom {
	accent-color: #0085ba;
	width: 100%;
}

.kol-myplace-avatar-preview > img {
	aspect-ratio: 1;
	border-radius: 999px;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
	display: block;
	height: 168px;
	object-fit: cover;
	width: 168px;
}

.kol-myplace-avatar-primary {
	background: #1f7a2f;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 8px 18px rgba(31, 122, 47, 0.25);
	color: #fff;
	cursor: pointer;
	font-weight: 700;
	padding: 12px 14px;
}

.kol-myplace-avatar-primary:hover,
.kol-myplace-avatar-primary:focus {
	background: #166326;
}

.kol-myplace-avatar-history-wrap {
	display: grid;
	gap: 12px;
	margin-top: 22px;
}

.kol-myplace-avatar-history {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.kol-myplace-avatar-history-item {
	aspect-ratio: 1;
	background: #f1f5f9;
	border: 2px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	overflow: hidden;
	padding: 0;
	position: relative;
}

.kol-myplace-avatar-history-item.is-current {
	border-color: #0085ba;
}

.kol-myplace-avatar-history-item img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.kol-myplace-avatar-history-item span {
	background: rgba(0, 133, 186, 0.92);
	bottom: 0;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	left: 0;
	padding: 4px 6px;
	position: absolute;
	right: 0;
	text-align: center;
}

.kol-myplace-avatar-empty,
.kol-myplace-avatar-status {
	color: #64748b;
	margin: 0;
}

.kol-myplace-avatar-status {
	font-weight: 700;
	margin-top: 14px;
	min-height: 20px;
}

.kol-myplace-avatar-status.is-error {
	color: #b91c1c;
}

.kol-myplace-avatar-status.is-success {
	color: #1f7a2f;
}

.kol-myplace-avatar-status.is-loading {
	color: #0085ba;
}

html.dark-mode .kol-myplace-avatar-dialog {
	background: #181818;
	color: #f3f4f6;
}

html.dark-mode .kol-myplace-avatar-header {
	border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode .kol-myplace-avatar-close,
html.dark-mode .kol-myplace-avatar-empty,
html.dark-mode .kol-myplace-avatar-status {
	color: #cbd5e1;
}

html.dark-mode .kol-myplace-avatar-dropzone,
html.dark-mode .kol-myplace-avatar-preview,
html.dark-mode .kol-myplace-avatar-history-item {
	background: #262626;
	border-color: rgba(255, 255, 255, 0.16);
	color: #f3f4f6;
}

html.dark-mode .kol-myplace-avatar-dropzone:hover,
html.dark-mode .kol-myplace-avatar-dropzone:focus-within {
	background: #1f2937;
	border-color: #38bdf8;
}

html.dark-mode .kol-myplace-avatar-dropzone-text {
	color: #f8fafc;
}

html.dark-mode .kol-myplace-avatar-zoom-label {
	color: #e2e8f0;
}

/* Widget Mobile Styles */
.kol-widget-about-me,
.kol-widget-activity-feed,
.kol-widget-follower-stats,
.kol-widget-message-form {
	width: 100%;
}

.kol-widget-about-me textarea,
.kol-widget-message-form textarea {
	width: 100%;
	min-height: 100px;
}

.kol-widget-follower-stats {
	flex-wrap: wrap;
	gap: 12px;
}

.kol-widget-followers-stat-item {
	flex: 0 1 calc(33.333% - 8px);
	text-align: center;
	min-width: 0;
}

@media (max-width: 640px) {
	.kol-myplace-avatar-history {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.kol-myplace-avatar-crop-frame {
		height: min(200px, calc(100vw - 68px));
		width: min(200px, calc(100vw - 68px));
	}

	.kol-myplace-avatar-preview > img {
		height: 140px;
		width: 140px;
	}

	.kol-myplace-avatar-preview {
		gap: 10px;
		padding: 10px;
	}

	.kol-myplace-avatar-zoom {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.kol-myplace-avatar-dialog {
		width: calc(100% - 4px);
	}

	.kol-myplace-avatar-header {
		padding: 12px 14px;
	}

	.kol-myplace-avatar-header h2 {
		font-size: 16px;
	}

	.kol-myplace-avatar-body {
		max-height: calc(100vh - 160px);
		padding: 12px;
		padding-bottom: max(12px, env(safe-area-inset-bottom));
	}

	.kol-myplace-avatar-crop-frame {
		height: min(160px, calc(100vw - 76px));
		width: min(160px, calc(100vw - 76px));
	}

	.kol-myplace-avatar-preview > img {
		height: 100px;
		width: 100px;
	}

	.kol-myplace-avatar-history {
		grid-template-columns: repeat(3, minmax(50px, 1fr));
		gap: 6px;
	}

	.kol-myplace-avatar-history-item {
		border-radius: 3px;
	}

	.kol-myplace-avatar-primary {
		width: 100%;
		padding: 9px 10px;
		font-size: 12px;
		min-height: 40px;
	}

	.kol-myplace-avatar-dropzone {
		padding: 8px 10px;
		gap: 5px;
	}

	.kol-myplace-avatar-dropzone-text {
		font-size: 11px;
	}

	.kol-myplace-avatar-preview {
		gap: 8px;
		padding: 8px;
	}
}

/* END: Core Styling */
