/**
 * WooCommerce Gift Card - Checkout Fields Styles
 *
 * Styles for the gift card recipient fields at checkout.
 *
 * @package Dzine\WooCommerceGiftCard
 * @version 3.0.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

.wc-gift-card-recipient-fields {
	--gc-primary: #96588a;
	--gc-primary-hover: #7a4871;
	--gc-text: #333;
	--gc-text-muted: #666;
	--gc-border: #e5e5e5;
	--gc-bg: #fff;
	--gc-bg-alt: #faf8f9;
	--gc-radius: 8px;
	--gc-radius-sm: 4px;
	--gc-transition: 0.3s ease;
}

/* ==========================================================================
   Recipient Fields Container
   ========================================================================== */

.wc-gift-card-recipient-fields {
	position: relative;
	background: var(--gc-bg-alt);
	padding: 28px 24px;
	border-radius: var(--gc-radius);
	margin-bottom: 28px;
	border: 1px solid var(--gc-border);
	clear: both;
}

/* Decorative gift icon */
.wc-gift-card-recipient-fields::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 24px;
	width: 40px;
	height: 40px;
	background: linear-gradient(135deg, var(--gc-primary) 0%, #b06aa8 100%);
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 7h-1.26A4.5 4.5 0 0 0 12 4.02a4.5 4.5 0 0 0-6.74 2.98H4a2 2 0 0 0-2 2v2h20V9a2 2 0 0 0-2-2zM2 13v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-7H2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 20px 20px;
	box-shadow: 0 4px 12px rgba(150, 88, 138, 0.3);
}

/* ==========================================================================
   Header
   ========================================================================== */

.wc-gift-card-recipient-fields h3 {
	margin: 0 0 8px 0;
	padding: 0 0 16px 36px;
	color: var(--gc-primary);
	font-size: 1.25rem;
	font-weight: 700;
	border-bottom: 1px solid var(--gc-border);
}

.wc-gift-card-recipient-intro {
	color: var(--gc-text-muted);
	margin: 16px 0 24px;
	font-size: 0.9rem;
	line-height: 1.6;
}

/* ==========================================================================
   Form Field Rows
   ========================================================================== */

.wc-gift-card-field-row {
	margin-bottom: 20px;
}

.wc-gift-card-field-row:last-child {
	margin-bottom: 0;
}

/* Half-width fields layout */
.wc-gift-card-field-row--half {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

.wc-gift-card-field-row--half .form-row {
	width: 100% !important;
	float: none !important;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   Form Labels
   ========================================================================== */

.wc-gift-card-recipient-fields .form-row label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--gc-text);
	font-size: 0.9rem;
}

.wc-gift-card-recipient-fields .optional {
	font-size: 0.75rem;
	font-weight: 400;
	color: #999;
	margin-left: 4px;
}

.wc-gift-card-recipient-fields .required {
	color: var(--gc-primary);
}

/* ==========================================================================
   Form Inputs
   ========================================================================== */

.wc-gift-card-recipient-fields input[type="text"],
.wc-gift-card-recipient-fields input[type="email"],
.wc-gift-card-recipient-fields input[type="tel"],
.wc-gift-card-recipient-fields textarea,
.wc-gift-card-recipient-fields select {
	width: 100%;
	padding: 12px 14px;
	font-size: 1rem;
	border: 1px solid #ddd;
	border-radius: var(--gc-radius-sm);
	background: var(--gc-bg);
	color: var(--gc-text);
	transition: border-color var(--gc-transition), box-shadow var(--gc-transition);
}

.wc-gift-card-recipient-fields input:hover,
.wc-gift-card-recipient-fields textarea:hover,
.wc-gift-card-recipient-fields select:hover {
	border-color: #bbb;
}

.wc-gift-card-recipient-fields input:focus,
.wc-gift-card-recipient-fields textarea:focus,
.wc-gift-card-recipient-fields select:focus {
	border-color: var(--gc-primary);
	box-shadow: 0 0 0 3px rgba(150, 88, 138, 0.1);
	outline: none;
}

.wc-gift-card-recipient-fields textarea {
	min-height: 120px;
	resize: vertical;
	line-height: 1.5;
}

/* Placeholder styling */
.wc-gift-card-recipient-fields input::placeholder,
.wc-gift-card-recipient-fields textarea::placeholder {
	color: #aaa;
}

/* ==========================================================================
   Field Descriptions
   ========================================================================== */

.wc-gift-card-recipient-fields .description {
	margin-top: 6px;
	font-size: 0.8rem;
	color: var(--gc-text-muted);
	line-height: 1.4;
}

/* ==========================================================================
   Personal Message Field
   ========================================================================== */

.wc-gift-card-field-row:last-child .form-row {
	position: relative;
}

/* Character count hint (if implemented) */
.wc-gift-card-recipient-fields .char-count {
	position: absolute;
	bottom: 8px;
	right: 12px;
	font-size: 0.75rem;
	color: #999;
}

/* ==========================================================================
   Validation States
   ========================================================================== */

.wc-gift-card-recipient-fields .form-row.woocommerce-invalid input,
.wc-gift-card-recipient-fields .form-row.woocommerce-invalid textarea {
	border-color: #dc3232;
}

.wc-gift-card-recipient-fields .form-row.woocommerce-invalid input:focus,
.wc-gift-card-recipient-fields .form-row.woocommerce-invalid textarea:focus {
	box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1);
}

.wc-gift-card-recipient-fields .form-row.woocommerce-validated input,
.wc-gift-card-recipient-fields .form-row.woocommerce-validated textarea {
	border-color: #46b450;
}

/* ==========================================================================
   Custom Amount Field (if on product page)
   ========================================================================== */

.wc-gift-card-custom-amount {
	margin: 20px 0;
	padding: 20px;
	background: var(--gc-bg-alt);
	border: 1px solid var(--gc-border);
	border-radius: var(--gc-radius);
}

.wc-gift-card-custom-amount label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
	color: var(--gc-text);
}

.wc-gift-card-custom-amount-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wc-gift-card-custom-amount-input {
	width: 150px;
	padding: 14px 18px;
	font-size: 1.25rem;
	font-weight: 700;
	border: 2px solid var(--gc-primary);
	border-radius: var(--gc-radius-sm);
	text-align: center;
	color: var(--gc-primary);
}

.wc-gift-card-custom-amount-input:focus {
	outline: none;
	box-shadow: 0 0 0 4px rgba(150, 88, 138, 0.15);
}

.wc-gift-card-custom-amount-currency {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--gc-text-muted);
}

/* Amount presets */
.wc-gift-card-amount-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.wc-gift-card-amount-preset {
	padding: 8px 16px;
	background: var(--gc-bg);
	border: 1px solid var(--gc-border);
	border-radius: 20px;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--gc-text);
	cursor: pointer;
	transition: all 0.2s ease;
}

.wc-gift-card-amount-preset:hover {
	border-color: var(--gc-primary);
	color: var(--gc-primary);
}

.wc-gift-card-amount-preset.active {
	background: var(--gc-primary);
	border-color: var(--gc-primary);
	color: #fff;
}

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

@media (max-width: 768px) {
	.wc-gift-card-recipient-fields {
		padding: 24px 20px;
		margin-left: -15px;
		margin-right: -15px;
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.wc-gift-card-recipient-fields::before {
		left: 20px;
	}

	.wc-gift-card-recipient-fields h3 {
		font-size: 1.1rem;
	}

	.wc-gift-card-field-row--half {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

@media (max-width: 480px) {
	.wc-gift-card-recipient-fields {
		padding: 20px 16px;
	}

	.wc-gift-card-recipient-fields::before {
		width: 36px;
		height: 36px;
		top: -10px;
		left: 16px;
		background-size: 18px 18px;
	}

	.wc-gift-card-recipient-fields h3 {
		padding-left: 32px;
	}

	.wc-gift-card-custom-amount-input {
		width: 100%;
	}
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .wc-gift-card-recipient-fields::before {
	left: auto;
	right: 24px;
}

[dir="rtl"] .wc-gift-card-recipient-fields h3 {
	padding-left: 0;
	padding-right: 36px;
}

[dir="rtl"] .wc-gift-card-recipient-fields .optional {
	margin-left: 0;
	margin-right: 4px;
}

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

@media print {
	.wc-gift-card-recipient-fields {
		background: #fff;
		border: 1px solid #ddd;
		box-shadow: none;
	}

	.wc-gift-card-recipient-fields::before {
		display: none;
	}
}
