/* ==========================================================================
   Improvement Plugin — Front-end Form Styles
   Fields are injected using MyListing's native .fieldset / .form-group
   structure, so most layout and typography is already handled by the theme.
   This file adds only the styles MyListing doesn't provide.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section wrapper — card with padding and rounded corners
   -------------------------------------------------------------------------- */
#improvement-extra-fields {
	display: block !important;
	visibility: visible !important;
}

.improvement-fieldset {
	display: block !important;
	padding: 16px !important;
	border-radius: 5px !important;
	border: 1px solid #e0e0e0 !important;
	background: #fafafa !important;
	margin-top: 12px !important;
	margin-bottom: 12px !important;
	box-sizing: border-box;
}

/* Optional description line below the field label */
.improvement-field-desc {
	display: block;
	font-size: 0.82rem;
	color: #777;
	margin-top: 3px;
	margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Input fields — match MyListing's borderless bottom-line style
   -------------------------------------------------------------------------- */
.improvement-fe-input {
	font-family: inherit;
	width: 100%;
	padding: 9px 0;
	border: none;
	border-bottom: 1px solid #e0e0e0;
	border-radius: 0;
	font-size: 0.9rem;
	background: transparent;
	color: #242429;
	box-sizing: border-box;
	margin-bottom: 8px;
	display: block;
	outline: none;
	transition: border-color 0.15s;
}
.improvement-fe-input:focus {
	border-bottom-color: var(--accent, #0080d7);
	outline: none;
	box-shadow: none;
}
.improvement-fe-input::placeholder {
	color: #aaa;
}
.improvement-fe-textarea {
	resize: vertical;
	min-height: 60px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 8px 10px;
	background: #fff;
}
.improvement-fe-textarea:focus {
	border-color: var(--accent, #0080d7);
	outline: none;
}
.improvement-fe-select {
	font-family: inherit;
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font-size: 0.9rem;
	background: #fff;
	color: #242429;
	flex-shrink: 0;
}
.improvement-fe-select:focus {
	border-color: var(--accent, #0080d7);
	outline: none;
}
.improvement-fe-input-grow {
	flex: 1;
}
.improvement-fe-row-inline {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   Owner Recommendation — photo upload column
   -------------------------------------------------------------------------- */
.improvement-rec-photo-col {
	flex-shrink: 0;
	width: 72px;
}

/* Compact upload tap target */
.improvement-rec-photo-upload {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 6px;
	overflow: hidden;
}
.improvement-rec-photo-upload .improvement-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}
.improvement-rec-photo-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	width: 72px;
	height: 72px;
	border: 2px dashed #d0d1d5;
	border-radius: 6px;
	background: #f9f9f9;
	cursor: pointer;
	text-align: center;
	font-size: 0.68rem;
	color: #888;
	transition: border-color 0.15s, background 0.15s;
	box-sizing: border-box;
}
.improvement-rec-photo-label .improvement-upload-icon {
	font-size: 1.3rem;
}
.improvement-rec-photo-upload:hover .improvement-rec-photo-label {
	border-color: var(--accent, #0080d7);
	background: #e6f3fc;
}

/* Spinner overlaid in the upload box */
.improvement-rec-photo-spinner {
	padding: 8px 4px;
}
.improvement-rec-photo-spinner .improvement-progress-bar {
	height: 3px;
	border-radius: 2px;
	background: #e0e0e0;
	overflow: hidden;
}
.improvement-rec-photo-spinner .improvement-progress-fill {
	height: 100%;
	background: var(--accent, #0080d7);
	width: 0;
	transition: width 0.2s;
}

/* Thumbnail preview */
.improvement-rec-photo-preview {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid #e0e0e0;
}
.improvement-rec-photo-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.improvement-rec-photo-remove {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 18px;
	height: 18px;
	background: rgba(0,0,0,0.55);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 0.6rem;
	line-height: 18px;
	text-align: center;
	padding: 0;
}
.improvement-rec-photo-remove:hover {
	background: #c00;
}

.hidden {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Repeater rows
   -------------------------------------------------------------------------- */
.improvement-fe-repeater-row {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	background: #fafafa;
	border: 1px solid #ebebeb;
	border-radius: 4px;
	padding: 12px;
	margin-bottom: 8px;
}
.improvement-fe-row-fields {
	flex: 1;
	min-width: 0;
}
.improvement-fe-remove {
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	background: #fee2e2;
	color: #c00;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	margin-top: 4px;
	font-family: inherit;
}
.improvement-fe-remove:hover {
	background: #fca5a5;
}

/* --------------------------------------------------------------------------
   Social URL row
   -------------------------------------------------------------------------- */
.improvement-fe-social-row {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 6px;
}
.improvement-fe-social-row .improvement-fe-input {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Add row button
   -------------------------------------------------------------------------- */
.improvement-fe-add-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 14px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--accent, #0080d7);
	background: #e8f3fc;
	border: 1px dashed var(--accent, #0080d7);
	border-radius: 4px;
	cursor: pointer;
	margin-top: 4px;
}
.improvement-fe-add-btn:hover {
	background: #cce6f8;
}

/* --------------------------------------------------------------------------
   File upload area
   -------------------------------------------------------------------------- */
.improvement-upload-area {
	position: relative;
}
.improvement-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}
.improvement-upload-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 22px;
	border: 2px dashed #d0d1d5;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.2s, background 0.2s;
	background: #f9f9f9;
}
.improvement-upload-area:hover .improvement-upload-label,
.improvement-upload-area.drag-over .improvement-upload-label {
	border-color: var(--accent, #0080d7);
	background: #e6f3fc;
}
.improvement-upload-icon {
	font-size: 1.6rem;
}
.improvement-upload-text {
	font-family: inherit;
	font-size: 0.85rem;
	color: #777;
}

/* --------------------------------------------------------------------------
   Upload progress
   -------------------------------------------------------------------------- */
.improvement-progress-bar {
	height: 4px;
	background: #e0e0e0;
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 6px;
}
.improvement-progress-fill {
	height: 100%;
	background: var(--accent, #0080d7);
	width: 0;
	transition: width 0.2s;
}
.improvement-progress-text {
	font-family: inherit;
	font-size: 0.82rem;
	color: #777;
}

/* --------------------------------------------------------------------------
   Uploaded file preview
   -------------------------------------------------------------------------- */
.improvement-upload-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: #e8f5e9;
	border: 1px solid #a5d6a7;
	border-radius: 4px;
	margin-bottom: 8px;
	font-family: inherit;
	font-size: 0.85rem;
}
.improvement-upload-preview a {
	flex: 1;
	color: var(--accent, #0080d7);
	word-break: break-all;
}
/* Menu image preview — floating X button */
.improvement-menu-img-preview {
	position: relative;
	display: inline-block;
	margin-bottom: 10px;
	border-radius: 6px;
	overflow: hidden;
	max-width: 100%;
}
.improvement-menu-img-preview img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}
.improvement-menu-img-remove {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	background: rgba(0,0,0,0.55);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1rem;
	line-height: 28px;
	text-align: center;
	padding: 0;
	transition: background 0.15s;
}
.improvement-menu-img-remove:hover {
	background: #c00;
}

.improvement-upload-remove {
	background: none;
	border: none;
	color: #c00;
	cursor: pointer;
	font-size: 1rem;
	font-family: inherit;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
	.improvement-fe-row-inline {
		flex-direction: column;
		align-items: stretch;
	}
}
