/**
 * Frontend styles
 *
 * @package EGC
 */

.egc-balance-check,
.egc-giftcard-form {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.egc-form-with-preview {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin-top: 20px;
}

.egc-preview-container {
	position: sticky;
	top: 20px;
	height: fit-content;
}

.egc-card-preview {
	max-width: 500px;
	margin: 0 auto;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 400px;
	position: relative;
}

.egc-preview-card {
	min-height: 400px;
	position: relative;
	padding: 40px;
	color: #fff;
}

.egc-balance-check h2,
.egc-giftcard-form h2 {
	margin-top: 0;
	color: #333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 10px;
}

.egc-form {
	margin-top: 20px;
}

.egc-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.egc-form-column {
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.egc-form-column h3 {
	margin-top: 0;
	color: #0073aa;
}

.egc-form-group {
	margin-bottom: 15px;
}

.egc-form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #333;
}

.egc-form-group input[type="text"],
.egc-form-group input[type="email"],
.egc-form-group input[type="tel"],
.egc-form-group input[type="number"],
.egc-form-group input[type="date"],
.egc-form-group input[type="time"],
.egc-form-group input[type="file"],
.egc-form-group select,
.egc-form-group textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
	line-height: 1.5;
}

.egc-form-group input:focus,
.egc-form-group select:focus,
.egc-form-group textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.egc-button {
	padding: 12px 24px;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s;
}

.egc-button-primary {
	background: #0073aa;
	color: #fff;
}

.egc-button-primary:hover {
	background: #005a87;
}

.egc-form-actions {
	margin-top: 20px;
	text-align: center;
}

/* Balance Result */
.egc-balance-result {
	margin-top: 30px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.egc-card-preview {
	display: flex;
	gap: 20px;
	margin-bottom: 30px;
	padding: 20px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.egc-card-image {
	width: 200px;
	height: 200px;
	border-radius: 8px;
	background: #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.egc-card-image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: cover;
}

.egc-card-info {
	flex: 1;
}

.egc-card-number {
	font-size: 18px;
	font-weight: bold;
	color: #333;
	margin-bottom: 15px;
	font-family: monospace;
}

.egc-card-balance {
	font-size: 24px;
	margin-bottom: 10px;
}

.egc-card-balance strong {
	color: #666;
	font-size: 16px;
}

.egc-card-balance span {
	color: #4CAF50;
	font-weight: bold;
}

.egc-card-expiry,
.egc-card-status {
	margin-top: 10px;
	color: #666;
}

/* Statement */
.egc-statement,
.egc-statement-section {
	margin-top: 20px;
}

.egc-statement h3,
.egc-statement-section h3 {
	margin-bottom: 15px;
	color: #333;
}

.egc-statement-filters {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.egc-statement-btn {
	margin: 0;
}

#egc-statement-loading {
	text-align: center;
	padding: 20px;
	color: #666;
}

.egc-txn-type {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.egc-txn-issue {
	background: #e3f2fd;
	color: #1976d2;
}

.egc-txn-redeem {
	background: #ffebee;
	color: #c62828;
}

.egc-txn-recharge {
	background: #e8f5e9;
	color: #2e7d32;
}

.egc-positive {
	color: #2e7d32;
	font-weight: 600;
}

.egc-negative {
	color: #c62828;
	font-weight: 600;
}

.egc-statement-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.egc-statement-table thead {
	background: #0073aa;
	color: #fff;
}

.egc-statement-table th,
.egc-statement-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #ddd;
}

.egc-statement-table tbody tr:hover {
	background: #f9f9f9;
}

.egc-statement-table tbody tr:last-child td {
	border-bottom: none;
}

/* Error message */
.egc-error {
	padding: 15px;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	color: #721c24;
	margin-top: 20px;
}

.egc-message {
	padding: 15px;
	border-radius: 4px;
	margin-top: 20px;
}

.egc-message.success {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.egc-message.error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

/* Payment Gateway Selection - Professional Design */
.egc-payment-gateways {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.egc-gateway-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 12px 10px;
	border: 2px solid #1e3a8a;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: #ffffff;
	position: relative;
	min-height: 80px;
	overflow: visible;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Hide radio button visually but keep for accessibility */
.egc-gateway-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.egc-gateway-option:hover {
	border-color: #1e40af;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.egc-gateway-option.selected {
	border-color: #6b21a8;
	border-width: 2.5px;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3), 0 4px 16px rgba(107, 33, 168, 0.2);
}

.egc-gateway-option .egc-gateway-logo-container {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
	min-height: 35px;
	width: 100%;
	flex-shrink: 0;
}

.egc-gateway-option img {
	max-width: 100%;
	max-height: 32px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	transition: transform 0.25s ease;
}

.egc-gateway-option:hover img {
	transform: scale(1.05);
}

.egc-gateway-option.selected img {
	transform: scale(1.05);
}

/* When no logo in both mode, make name bigger */
.egc-gateway-option.display-both:not(:has(.egc-gateway-logo-container img)) .egc-gateway-name,
.egc-gateway-option.display-both .egc-gateway-logo-container:empty ~ .egc-gateway-name {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.egc-gateway-option.display-both:not(:has(.egc-gateway-logo-container img)) .egc-gateway-logo-container,
.egc-gateway-option.display-both .egc-gateway-logo-container:empty {
	display: none;
}

/* Display mode specific styles */
.egc-gateway-option.display-logo-only .egc-gateway-logo-container {
	margin-bottom: 0;
}

.egc-gateway-option.display-name-only .egc-gateway-logo-container {
	display: none;
}

.egc-gateway-option.display-logo-only .egc-gateway-name {
	display: none;
}

.egc-gateway-option .egc-gateway-name {
	font-weight: 600;
	color: #1f2937;
	font-size: 12px;
	text-align: center;
	width: 100%;
	margin: 0 auto;
	line-height: 1.4;
	letter-spacing: 0.01em;
	transition: all 0.25s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.egc-gateway-option:hover .egc-gateway-name {
	color: #1e40af;
}

.egc-gateway-option.selected .egc-gateway-name {
	color: #6b21a8;
	font-weight: 700;
}

.egc-gateway-option.display-name-only {
	min-height: 60px;
	padding: 15px 10px;
	justify-content: center;
}

.egc-gateway-option.display-name-only .egc-gateway-name {
	font-size: 13px;
	font-weight: 700;
}

.egc-gateway-option.display-logo-only {
	min-height: 75px;
	padding: 18px 10px;
}

.egc-gateway-placeholder {
	width: 45px;
	height: 45px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 10px;
	margin-bottom: 8px;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.egc-gateway-placeholder span {
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.egc-form-section {
	margin-top: 30px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.egc-form-section h3 {
	margin-top: 0;
	color: #0073aa;
}

/* reCAPTCHA */
#egc-recaptcha-container {
	margin: 15px 0;
}

/* Responsive */
@media (max-width: 968px) {
	.egc-form-with-preview {
		grid-template-columns: 1fr;
	}
	
	.egc-preview-container {
		position: relative;
		top: 0;
	}
}

@media (max-width: 768px) {
	.egc-form-grid {
		grid-template-columns: 1fr;
	}
	
	.egc-card-preview {
		flex-direction: column;
	}
	
	.egc-card-image {
		width: 100%;
		height: 200px;
	}
	
	.egc-statement-table {
		font-size: 12px;
	}
	
	.egc-statement-table th,
	.egc-statement-table td {
		padding: 8px;
	}
	
	.egc-payment-gateways {
		grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
		gap: 10px;
	}
	
	.egc-gateway-option {
		min-height: 70px;
		padding: 10px 8px;
	}
	
	.egc-gateway-option .egc-gateway-logo-container {
		min-height: 30px;
		margin-bottom: 6px;
	}
	
	.egc-gateway-option img {
		max-height: 28px;
	}
	
	.egc-gateway-option .egc-gateway-name {
		font-size: 11px;
	}
	
	.egc-gateway-placeholder {
		width: 40px;
		height: 40px;
		margin-bottom: 6px;
	}
	
	.egc-gateway-placeholder span {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.egc-payment-gateways {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
	
	.egc-gateway-option {
		min-height: 70px;
		padding: 10px 8px;
		border-radius: 10px;
	}
	
	.egc-gateway-option .egc-gateway-logo-container {
		min-height: 28px;
		margin-bottom: 6px;
	}
	
	.egc-gateway-option img {
		max-height: 26px;
	}
	
	.egc-gateway-option .egc-gateway-name {
		font-size: 10px;
	}
	
	.egc-gateway-placeholder {
		width: 35px;
		height: 35px;
		margin-bottom: 6px;
	}
	
	.egc-gateway-placeholder span {
		font-size: 14px;
	}
}

