/**
 * Woo Product Fields - Frontend Styles
 *
 * @package WooProductFields
 * @since   1.0.0
 */

/* Field Group Container - Simple, clean design */
.wpf-field-group {
	margin-bottom: 20px;
}

.wpf-field-group-title {
	margin: 0 0 15px 0;
	font-size: 16px;
	font-weight: 600;
}

/* Individual Field */
.wpf-field {
	margin-bottom: 15px;
}

.wpf-field:last-child {
	margin-bottom: 0;
}

.wpf-field-label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
}

.wpf-field-label .required {
	color: #e2401c;
	margin-left: 3px;
}

.wpf-field-description {
	color: #666;
	font-size: 13px;
	margin-top: 5px;
}

/* Input Styles - Inherit from theme */
.wpf-field input[type="text"],
.wpf-field input[type="email"],
.wpf-field input[type="tel"],
.wpf-field input[type="number"],
.wpf-field input[type="date"],
.wpf-field textarea,
.wpf-field select {
	width: 100%;
	max-width: 100%;
}

.wpf-field textarea {
	min-height: 80px;
	resize: vertical;
}

.wpf-field select[multiple] {
	min-height: 100px;
}

/* Radio and Checkbox */
.wpf-field-options {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpf-field-option {
	margin-bottom: 8px;
}

.wpf-field-option:last-child {
	margin-bottom: 0;
}

.wpf-field-option label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
	font-weight: normal;
}

.wpf-field-option input[type="radio"],
.wpf-field-option input[type="checkbox"] {
	margin-top: 3px;
}

/* File Upload - Simple design */
.wpf-file-upload {
	position: relative;
}

.wpf-file-drop-zone {
	padding: 20px;
	border: 2px dashed #ccc;
	border-radius: 4px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s;
}

.wpf-file-drop-zone:hover,
.wpf-file-drop-zone.dragover {
	border-color: #666;
}

.wpf-file-input {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	opacity: 0;
	cursor: pointer;
}

.wpf-file-instructions {
	color: #666;
}

.wpf-file-instructions .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	margin-bottom: 5px;
}

.wpf-file-instructions p {
	margin: 5px 0;
}

.wpf-allowed-types {
	font-size: 12px;
	color: #999;
}

/* File List */
.wpf-file-list {
	margin-top: 10px;
}

.wpf-file-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 8px;
	background: #f9f9f9;
}

.wpf-file-item:last-child {
	margin-bottom: 0;
}

.wpf-file-item.uploading {
	background: #f0f7ff;
	border-color: #0073aa;
	border-style: dashed;
}

.wpf-file-item.uploaded {
	background: #f0fff4;
	border-color: #28a745;
}

.wpf-file-item.error {
	background: #fff5f5;
	border-color: #dc3545;
}

/* Success checkmark indicator */
.wpf-file-item.uploaded .wpf-file-icon {
	background: #28a745;
	color: #fff;
}

.wpf-file-item.uploaded .wpf-file-icon::after {
	content: "✓";
	position: absolute;
	bottom: -2px;
	right: -2px;
	background: #28a745;
	color: #fff;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
}

.wpf-file-item .wpf-file-icon {
	position: relative;
}

.wpf-file-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
	background: #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
}

.wpf-file-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wpf-file-icon .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.wpf-file-info {
	flex: 1;
	min-width: 0;
}

.wpf-file-name {
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpf-file-size {
	font-size: 12px;
	color: #666;
	margin-top: 2px;
}

.wpf-file-status {
	font-size: 12px;
	color: #0073aa;
	margin-top: 2px;
	font-style: italic;
}

.wpf-file-status.success {
	color: #28a745;
	font-style: normal;
	font-weight: 500;
}

.wpf-file-error {
	font-size: 12px;
	color: #dc3545;
	margin-top: 2px;
}

.wpf-file-remove {
	flex-shrink: 0;
	background: none;
	border: none;
	color: #a00;
	cursor: pointer;
	padding: 5px;
	font-size: 18px;
	line-height: 1;
}

.wpf-file-remove:hover {
	color: #dc3545;
}

/* File Upload Progress */
.wpf-file-progress {
	margin-top: 8px;
}

.wpf-progress-bar {
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	overflow: hidden;
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.wpf-progress-bar-fill,
.wpf-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #0073aa, #00a0d2);
	width: 0;
	transition: width 0.2s ease-out;
	border-radius: 3px;
}

/* Dropzone style for file-upload.js */
.wpf-file-dropzone {
	padding: 20px;
	border: 2px dashed #ccc;
	border-radius: 4px;
	text-align: center;
	cursor: pointer;
}

.wpf-file-dropzone:hover,
.wpf-file-dropzone.dragover {
	border-color: #666;
}

.wpf-file-dropzone-text {
	color: #666;
	margin-bottom: 5px;
}

.wpf-file-dropzone-hint {
	font-size: 12px;
	color: #999;
}

/* Validation Errors */
.wpf-field.has-error input,
.wpf-field.has-error textarea,
.wpf-field.has-error select {
	border-color: #dc3545;
}

.wpf-field.has-error .wpf-file-drop-zone,
.wpf-field.has-error .wpf-file-dropzone {
	border-color: #dc3545;
	background-color: #fff5f5;
}

.wpf-field-error {
	color: #dc3545;
	font-size: 13px;
	margin-top: 8px;
	padding: 8px 12px;
	background: #fff5f5;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	display: block;
}

/* Shake animation for invalid file selection */
@keyframes wpf-shake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-5px); }
	40%, 80% { transform: translateX(5px); }
}

.wpf-file-dropzone.shake {
	animation: wpf-shake 0.4s ease-in-out;
	border-color: #dc3545;
}

/* Cart Display */
.wpf-cart-item-data {
	font-size: 13px;
	margin-top: 5px;
}

.wpf-cart-item-data dt {
	font-weight: 600;
	display: inline;
}

.wpf-cart-item-data dt::after {
	content: ": ";
}

.wpf-cart-item-data dd {
	display: inline;
	margin: 0;
}

.wpf-cart-item-data dd::after {
	content: "";
	display: block;
	margin-bottom: 3px;
}

/* Responsive */
@media screen and (max-width: 768px) {
	.wpf-file-item {
		flex-wrap: wrap;
	}

	.wpf-file-name {
		flex-basis: calc(100% - 50px);
	}
}
