/**
 * MFP Declarations Frontend Styles
 *
 * Styles for the cascading address field and confirmation display.
 *
 * @package    MFP_Declarations
 * @subpackage MFP_Declarations/assets/css
 * @since      1.0.0
 */

/* ==========================================================================
   Cascading Address Field
   ========================================================================== */

.ginput_container_cascading_address {
	position: relative;
}

.mfp-cascade-field {
	margin-bottom: 15px;
}

.mfp-cascade-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	color: #333;
}

.mfp-cascade-field label .gfield_required {
	color: #d63638;
	margin-left: 3px;
}

.mfp-cascade-dropdown {
	width: 100%;
	padding: 10px 12px;
	font-size: 16px;
	line-height: 1.5;
	color: #333;
	background-color: #fff;
	background-image: none;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.mfp-cascade-dropdown:focus {
	border-color: #2271b1;
	outline: 0;
	box-shadow: 0 0 0 1px #2271b1;
}

.mfp-cascade-dropdown:disabled {
	background-color: #f0f0f1;
	color: #646970;
	cursor: not-allowed;
	opacity: 0.7;
}

.mfp-cascade-dropdown.mfp-loading {
	background-image: url('data:image/svg+xml;charset=utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"%3E%3Ccircle cx="10" cy="10" r="8" fill="none" stroke="%23646970" stroke-width="2" opacity="0.3"/%3E%3Cpath d="M10 2 A 8 8 0 0 1 18 10" fill="none" stroke="%232271b1" stroke-width="2"%3E%3CanimateTransform attributeName="transform" type="rotate" from="0 10 10" to="360 10 10" dur="1s" repeatCount="indefinite"/%3E%3C/path%3E%3C/svg%3E');
	background-repeat: no-repeat;
	background-position: calc(100% - 12px) center;
	background-size: 20px 20px;
	padding-right: 40px;
}

/* Loading Indicator */
.mfp-cascade-loading {
	margin-top: 10px;
	padding: 10px;
	background: #f0f0f1;
	border-radius: 4px;
	text-align: center;
	color: #646970;
}

.mfp-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #f0f0f1;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: mfp-spin 1s linear infinite;
	vertical-align: middle;
	margin-right: 5px;
}

@keyframes mfp-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Confirmation Display (Supplement Links)
   ========================================================================== */

.mfp-confirmation {
	padding: 30px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	max-width: 700px;
	margin: 20px auto;
}

.mfp-confirmation h2 {
	margin-top: 0;
	margin-bottom: 20px;
	color: #1d2327;
	font-size: 24px;
	font-weight: 600;
	border-bottom: 2px solid #2271b1;
	padding-bottom: 10px;
}

.mfp-confirmation h3 {
	margin-top: 25px;
	margin-bottom: 15px;
	color: #1d2327;
	font-size: 18px;
	font-weight: 600;
}

/* Address Display */
.mfp-address-display {
	background: #f6f7f7;
	border-left: 4px solid #2271b1;
	padding: 15px;
	margin-bottom: 25px;
	border-radius: 4px;
}

.mfp-address-display p {
	margin: 10px 0;
	line-height: 1.6;
}

.mfp-address-display strong {
	color: #1d2327;
}

/* Supplements Section */
.mfp-supplements-section {
	margin: 25px 0;
}

.mfp-supplements-list {
	list-style: none;
	padding: 0;
	margin: 15px 0;
}

.mfp-supplements-list li {
	margin-bottom: 12px;
}

/* Supplement Link (Button Style) */
.mfp-supplement-link {
	display: inline-block;
	width: 100%;
	padding: 14px 20px;
	background-color: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	font-size: 16px;
	text-align: left;
	transition: background-color 0.2s ease, transform 0.1s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mfp-supplement-link:hover {
	background-color: #135e96;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.mfp-supplement-link:active {
	transform: translateY(0);
}

.mfp-supplement-link:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.mfp-link-icon {
	float: right;
	font-size: 20px;
	font-weight: bold;
}

/* Supplement Unavailable */
.mfp-supplement-unavailable {
	display: block;
	padding: 14px 20px;
	background-color: #f0f0f1;
	color: #646970;
	border-radius: 4px;
	border: 1px solid #c3c4c7;
}

.mfp-supplement-unavailable .mfp-badge {
	float: right;
}

/* No Supplements / Error State */
.mfp-no-supplements {
	padding: 25px;
	background: #fcf3cf;
	border-left: 4px solid #b96e00;
	border-radius: 4px;
	color: #50575e;
}

.mfp-no-supplements h2 {
	color: #50575e;
	border-bottom: none;
	margin-bottom: 15px;
	font-size: 20px;
}

.mfp-no-supplements p {
	margin: 12px 0;
	line-height: 1.6;
}

.mfp-contact-link {
	color: #2271b1;
	text-decoration: underline;
	font-weight: 500;
}

.mfp-contact-link:hover {
	color: #135e96;
}

/* Confirmation Footer */
.mfp-confirmation-footer {
	margin-top: 25px;
	padding-top: 20px;
	border-top: 1px solid #dcdcde;
	text-align: center;
}

.mfp-help-text {
	color: #646970;
	font-size: 14px;
	margin: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 782px) {
	.mfp-cascade-dropdown {
		font-size: 16px;
		padding: 8px 10px;
	}

	.mfp-confirmation {
		padding: 20px;
		margin: 10px;
	}

	.mfp-confirmation h2 {
		font-size: 20px;
	}

	.mfp-supplement-link {
		display: block;
		text-align: center;
		padding: 14px 20px;
	}
}

@media screen and (max-width: 480px) {
	.mfp-cascade-field {
		margin-bottom: 12px;
	}

	.mfp-cascade-dropdown {
		font-size: 14px;
	}

	.mfp-confirmation {
		padding: 15px;
	}

	.mfp-confirmation h2 {
		font-size: 18px;
		margin-bottom: 15px;
	}

	.mfp-supplement-link {
		padding: 12px 16px;
		font-size: 14px;
	}
}

/* ==========================================================================
   Gravity Forms Integration
   ========================================================================== */

/* Override Gravity Forms default styles if needed */
.gform_wrapper .gfield.field_cascading_address .ginput_container {
	margin-top: 0;
}

.gform_wrapper .gfield.field_cascading_address .gfield_description {
	margin-top: 10px;
	padding-top: 10px;
}

/* Validation error styling */
.gform_wrapper .gfield_error.field_cascading_address {
	background-color: #fcf3cf;
	border-top: 1px solid #b96e00;
	border-bottom: 1px solid #b96e00;
	padding: 16px;
	margin-bottom: 20px !important;
}

.gform_wrapper .gfield_error.field_cascading_address .validation_message {
	background-color: transparent;
	border: none;
	color: #b32d2e;
	font-weight: 600;
	padding: 10px 0 0 0;
}

/* Required indicator */
.gform_wrapper .gfield_required {
	color: #d63638;
	margin-left: 3px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Screen reader only text */
.mfp-sr-only {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Focus visible for keyboard navigation */
.mfp-cascade-dropdown:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.mfp-supplement-link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.mfp-cascade-dropdown {
		border-width: 2px;
	}

	.mfp-supplement-link {
		border: 2px solid #fff;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.mfp-cascade-dropdown,
	.mfp-supplement-link {
		transition: none;
	}

	.mfp-spinner {
		animation: none;
		border-top-color: #2271b1;
		border-right-color: #2271b1;
	}

	@keyframes mfp-spin {
		0%, 100% {
			transform: rotate(0deg);
		}
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.mfp-cascade-loading,
	.mfp-spinner {
		display: none !important;
	}

	.mfp-supplement-link {
		color: #000;
		text-decoration: underline;
	}

	.mfp-supplement-link::after {
		content: " (" attr(href) ")";
		font-size: 0.9em;
		color: #666;
	}
}

