/**
 * COA Form Styles
 *
 * @package Supreme_COA
 * @since   1.0.0
 */

.coa-form-wrap {
	max-width: 600px;
	margin: 0 auto;
	font-family: inherit;
}

.coa-form-field {
	margin-bottom: 20px;
}

.coa-form-field label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #333;
}

.coa-required {
	color: #E5571F;
}

.coa-form-field input[type="text"],
.coa-form-field input[type="url"],
.coa-form-field textarea {
	width: 100%;
	padding: 12px 14px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
	outline: none;
	box-sizing: border-box;
}

.coa-form-field input:focus,
.coa-form-field textarea:focus {
	border-color: #3D264F;
}

.coa-form-field input[type="file"] {
	font-size: 14px;
	padding: 10px 0;
}

.coa-form-field small {
	color: #999;
	font-weight: 400;
}

/* Radio toggle */
.coa-link-toggle {
	display: flex;
	gap: 24px;
	margin-top: 4px;
}

.coa-radio-label {
	font-size: 14px;
	font-weight: 400 !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Shared primary button — see also coa-search.css for the duplicate definition.
 * .ppw-pwd-submit-btn is the password-protect plugin's Enter button shown
 * before the COA form is unlocked; we can't add a class to it, so we style
 * it via its own class to match. */
.coa-btn-primary,
.ppw-pwd-submit-btn {
	padding: 0.6rem 1rem;
	font-size: 16px;
	font-weight: 700;
	color: #fff !important;
	background-color: #3D264F !important;
	border: none !important;
	border-radius: 5px;
	cursor: pointer;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.coa-btn-primary:hover,
.ppw-pwd-submit-btn:hover {
	background-color: #FD7521 !important;
}

.coa-btn-primary.coa-loading,
.coa-btn-primary.coa-submitting {
	background-color: #FD7521 !important;
	pointer-events: none;
}

/* Password-protect gate (shown before the COA upload form is unlocked).
 * All rules scoped under .ppw-post-password-form so they only ever target
 * the plugin's form. coa-form.css itself only loads on pages with the
 * [coa_form] shortcode, so this can't bleed onto unrelated pages. */
.ppw-post-password-form {
	max-width: 600px;
	margin: 24px auto;
	font-family: inherit;
}

.ppw-post-password-form .ppw-ppf-desc {
	font-size: 16px;
	margin: 0 0 24px;
	color: #333;
	font-family: inherit;
}

.ppw-post-password-form .ppw-ppf-field-container {
	display: flex;
	gap: 12px;
	align-items: flex-end;
	margin: 0;
}

.ppw-post-password-form .ppw-pwd-label {
	display: block;
	flex: 1;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	font-family: inherit;
}

.ppw-post-password-form .ppw-pwd-label input[type="password"] {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	font-size: 14px;
	font-family: inherit;
	border: 1px solid #ccc;
	border-radius: 4px;
	outline: none;
	box-sizing: border-box;
}

.ppw-post-password-form .ppw-pwd-label input[type="password"]:focus {
	border-color: #3D264F;
}

.ppw-post-password-form .ppw-pwd-submit-btn {
	padding: 12px 24px;
}

/* Messages */
.coa-form-message {
	margin-top: 16px;
	padding: 14px 18px;
	border-radius: 4px;
	font-size: 14px;
}

.coa-form-message.coa-msg-success {
	background-color: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.coa-form-message.coa-msg-error {
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

/* Modal */
.coa-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.coa-modal {
	background: #fff;
	border-radius: 8px;
	padding: 32px;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.coa-modal h3 {
	margin: 0 0 12px;
	font-size: 18px;
	color: #333;
}

.coa-modal-text {
	font-size: 14px;
	color: #666;
	margin-bottom: 24px;
}

.coa-modal-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.coa-modal-btn {
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 600;
	border: none !important;
	border-radius: 5px;
	cursor: pointer;
	color: #fff !important;
}

.coa-modal-duplicate {
	background-color: #3D264F !important;
}

.coa-modal-duplicate:hover {
	background-color: #FD7521 !important;
}

.coa-modal-overwrite {
	background-color: #E5571F !important;
}

.coa-modal-overwrite:hover {
	background-color: #c94a18 !important;
}

.coa-modal-cancel {
	background-color: #999 !important;
}

.coa-modal-cancel:hover {
	background-color: #777 !important;
}

/* Section Headings */
.coa-section-heading {
	font-size: 22px;
	font-weight: 700;
	color: #333;
	margin: 0 0 24px;
}

/* Divider */
.coa-divider {
	border: none;
	border-top: 1px solid #ddd;
	margin: 50px 0 !important;
}

.coa-delete-search {
	display: flex;
	gap: 12px;
}

.coa-delete-search input {
	flex: 1;
}

.coa-delete-search-btn {
	white-space: nowrap;
}

.coa-delete-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}

.coa-delete-table thead th {
	background-color: #4A2040;
	color: #fff;
	text-align: left;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 700;
}

.coa-delete-table tbody td {
	padding: 10px 14px;
	font-size: 13px;
	border-bottom: 1px solid #eee;
}

.coa-delete-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

/* Per-row Delete and Cancel use the shared .coa-btn-primary class for colour. */

.coa-delete-none {
	text-align: center;
	padding: 16px;
	color: #666;
}

.coa-delete-message {
	margin-top: 16px;
	padding: 14px 18px;
	border-radius: 4px;
	font-size: 14px;
}

.coa-delete-message.coa-msg-success {
	background-color: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.coa-delete-message.coa-msg-error {
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

/* Responsive */
@media (max-width: 600px) {
	.coa-link-toggle {
		flex-direction: column;
		gap: 10px;
	}

	.coa-modal-actions {
		flex-direction: column;
	}

	.coa-modal-btn {
		width: 100%;
		text-align: center;
	}
}
