/* WP Format Converter - Modern UI inspired by conversiontools.io */

.wpfc-converter {
	--wpfc-primary: #2563eb;
	--wpfc-primary-hover: #1d4ed8;
	--wpfc-success: #16a34a;
	--wpfc-border: #e5e7eb;
	--wpfc-bg: #f9fafb;
	--wpfc-text: #111827;
	--wpfc-muted: #6b7280;
	--wpfc-radius: 12px;
	--wpfc-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	max-width: 820px;
	margin: 0 auto 2rem;
	background: #fff;
	border: 1px solid var(--wpfc-border);
	border-radius: var(--wpfc-radius);
	box-shadow: var(--wpfc-shadow);
	overflow: hidden;
	color: var(--wpfc-text);
	line-height: 1.5;
}

.wpfc-header {
	padding: 1.75rem 1.75rem 1rem;
	border-bottom: 1px solid var(--wpfc-border);
	background: linear-gradient(to bottom, #f8fafc, #fff);
}

.wpfc-title {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--wpfc-text);
	letter-spacing: -0.02em;
}

.wpfc-subtitle {
	margin: 0;
	font-size: 0.9rem;
	color: var(--wpfc-muted);
}

/* Limit bar */
.wpfc-limit-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1.75rem;
	background: #f1f5f9;
	border-bottom: 1px solid var(--wpfc-border);
	font-size: 0.875rem;
}

.wpfc-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.75rem;
	background: #fff;
	border: 1px solid var(--wpfc-border);
	border-radius: 999px;
	font-weight: 500;
	color: var(--wpfc-muted);
}

.wpfc-badge-success {
	background: #dcfce7;
	border-color: #86efac;
	color: #166534;
}

.wpfc-login-link {
	color: var(--wpfc-primary);
	font-weight: 600;
	text-decoration: none;
}

.wpfc-login-link:hover {
	text-decoration: underline;
}

/* Body */
.wpfc-body {
	padding: 1.75rem;
}

/* Steps */
.wpfc-step {
	display: flex;
	gap: 1rem;
	margin-bottom: 1.75rem;
}

.wpfc-step-number {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wpfc-primary);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
	border-radius: 50%;
}

.wpfc-step-content {
	flex: 1;
	min-width: 0;
}

.wpfc-label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin-bottom: 0.6rem;
	color: var(--wpfc-text);
}

/* Dropzone */
.wpfc-dropzone {
	border: 2px dashed #cbd5e1;
	border-radius: var(--wpfc-radius);
	background: var(--wpfc-bg);
	transition: border-color 0.2s, background 0.2s;
	cursor: pointer;
}

.wpfc-dropzone:hover,
.wpfc-dropzone.wpfc-dragover {
	border-color: var(--wpfc-primary);
	background: #eff6ff;
}

.wpfc-dropzone-inner {
	padding: 2.5rem 1.5rem;
	text-align: center;
}

.wpfc-upload-icon {
	color: #94a3b8;
	margin-bottom: 0.75rem;
}

.wpfc-drop-text {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	color: var(--wpfc-text);
}

.wpfc-browse {
	color: var(--wpfc-primary);
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.wpfc-drop-hint {
	margin: 0;
	font-size: 0.8rem;
	color: var(--wpfc-muted);
}

/* Or separator */
.wpfc-or {
	display: flex;
	align-items: center;
	margin: 1.25rem 0;
	color: var(--wpfc-muted);
	font-size: 0.85rem;
}

.wpfc-or::before,
.wpfc-or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--wpfc-border);
}

.wpfc-or span {
	padding: 0 1rem;
}

/* Textarea */
.wpfc-textarea {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1px solid var(--wpfc-border);
	border-radius: 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.875rem;
	line-height: 1.5;
	resize: vertical;
	min-height: 160px;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wpfc-textarea:focus {
	outline: none;
	border-color: var(--wpfc-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* File info chip */
.wpfc-file-info {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
	padding: 0.5rem 0.85rem;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	font-size: 0.875rem;
}

.wpfc-filename {
	flex: 1;
	font-weight: 500;
	color: #1e40af;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpfc-remove-file {
	background: none;
	border: none;
	font-size: 1.25rem;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	padding: 0 0.25rem;
}

.wpfc-remove-file:hover {
	color: #ef4444;
}

/* Options */
.wpfc-options {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.wpfc-option label {
	font-size: 0.9rem;
	font-weight: 500;
	display: block;
	margin-bottom: 0.35rem;
}

.wpfc-option select,
.wpfc-option input[type="text"] {
	width: 100%;
	max-width: 280px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--wpfc-border);
	border-radius: 6px;
	font-size: 0.9rem;
}

.wpfc-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.wpfc-radio-group label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 400;
	cursor: pointer;
	margin: 0;
}

.wpfc-no-options {
	margin: 0;
	font-size: 0.9rem;
	color: var(--wpfc-muted);
}

/* Actions */
.wpfc-actions {
	margin: 1.5rem 0 0;
	text-align: center;
}

.wpfc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.5rem;
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
}

.wpfc-btn:active {
	transform: scale(0.98);
}

.wpfc-btn-primary {
	background: var(--wpfc-primary);
	color: #fff;
}

.wpfc-btn-primary:hover {
	background: var(--wpfc-primary-hover);
}

.wpfc-btn-primary:disabled {
	background: #93c5fd;
	cursor: not-allowed;
}

.wpfc-btn-secondary {
	background: #fff;
	color: var(--wpfc-text);
	border: 1px solid var(--wpfc-border);
}

.wpfc-btn-secondary:hover {
	background: var(--wpfc-bg);
}

/* Spinner */
.wpfc-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wpfc-spin 0.7s linear infinite;
}

@keyframes wpfc-spin {
	to { transform: rotate(360deg); }
}

/* Result */
.wpfc-result {
	margin-top: 1.75rem;
	border: 1px solid var(--wpfc-border);
	border-radius: var(--wpfc-radius);
	overflow: hidden;
}

.wpfc-result-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	background: var(--wpfc-bg);
	border-bottom: 1px solid var(--wpfc-border);
}

.wpfc-result-title {
	font-size: 0.95rem;
}

.wpfc-result-actions {
	display: flex;
	gap: 0.5rem;
}

.wpfc-result-preview {
	margin: 0;
	padding: 1rem;
	max-height: 320px;
	overflow: auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.8rem;
	line-height: 1.5;
	
	white-space: pre-wrap;
	word-break: break-all;
}

.wpfc-result-meta {
	padding: 0.5rem 1rem;
	font-size: 0.8rem;
	color: var(--wpfc-muted);
	background: #f8fafc;
	border-top: 1px solid var(--wpfc-border);
}

/* Messages */
.wpfc-message {
	margin-top: 1rem;
	padding: 0.85rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
}

.wpfc-message.wpfc-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.wpfc-message.wpfc-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.wpfc-message.wpfc-warning {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
}

/* Responsive */
@media (max-width: 640px) {
	.wpfc-header,
	.wpfc-body {
		padding: 1.25rem;
	}

	.wpfc-limit-bar {
		padding: 0.75rem 1.25rem;
		flex-direction: column;
		align-items: flex-start;
	}

	.wpfc-step {
		flex-direction: column;
		gap: 0.5rem;
	}

	.wpfc-result-header {
		flex-direction: column;
		gap: 0.75rem;
		align-items: flex-start;
	}
}
