/**
 * Frontend Styles - Checkout & Thank You Page
 */

/* ============================================================================
   BNPL-Style Gateway Display (Checkout Page)
   ============================================================================ */

/**
 * Gateway container - BNPL-style display matching Zip/Afterpay/Klarna
 * Layout: [Radio Button] → [PayID Logo] → [Text: "Scan & Pay"]
 * Uses inline-flex for perfect vertical alignment
 */
.scanpay-gateway-container {
	display: inline-flex !important;
	align-items: center;
	white-space: nowrap;
	vertical-align: middle;
}

/**
 * PayID logo - Premium BNPL styling
 * Appears BEFORE the text to match Afterpay/Klarna layout
 * 24px height for elegant, professional look
 * 12px margin-right provides breathing room for text
 */
.scanpay-gateway-logo {
	max-height: 24px;
	width: auto;
	height: auto;
	margin-right: 12px;
	vertical-align: middle;
	display: inline-block;
}

/**
 * Gateway text label - "Scan & Pay"
 * Appears AFTER the logo (no "(PayID)" suffix needed)
 * Logo handles the branding
 */
.scanpay-gateway-text {
	display: inline-block;
	vertical-align: middle;
	font-size: inherit;
	line-height: 1;
}

/**
 * WooCommerce payment method label override
 * Ensures proper spacing between radio button and gateway container
 */
.wc_payment_method label[for="payment_method_scanpay"] {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/**
 * Mobile responsiveness - maintain professional appearance
 * Logo scales down slightly, margin reduces for compact layout
 */
@media (max-width: 768px) {
	.scanpay-gateway-logo {
		max-height: 20px;
		margin-right: 8px;
	}
}

/* ============================================================================
   Thank You Page QR Display
   ============================================================================ */

/* Ensure plugin styles don't interfere with theme navigation */
.scanpay-custom-payment-page {
	position: relative;
	z-index: 1;
}

.scanpay-thankyou {
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin: 20px 0;
	text-align: center;
}

.scanpay-thankyou h2 {
	margin-top: 0;
	color: #333;
}

.scanpay-qr-wrapper {
	margin: 20px 0;
}

.scanpay-qr-image {
	width: 250px !important;
	height: 250px !important;
	max-width: 100%;
	border: 2px solid #333;
	border-radius: 8px;
	padding: 10px;
	background: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	display: block;
	margin: 0 auto;
}

.scanpay-session-id {
	color: #666;
	font-size: 13px;
	margin-top: 10px;
}

.scanpay-session-id code {
	background: #f5f5f5;
	padding: 2px 6px;
	border-radius: 3px;
	font-family: 'Courier New', monospace;
}

.scanpay-loading {
	font-style: italic;
	color: #999;
	padding: 20px;
	text-align: center;
}

.scanpay-scan-instruction {
	margin-top: 15px;
	padding: 12px 20px;
	background: #f0f7ff;
	border-left: 4px solid #2271b1;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.6;
	text-align: center;
}

.scanpay-instruction-text {
	margin-bottom: 20px;
	font-size: 15px;
	color: #50575e;
}

/* Payment status block - POS style */
.scanpay-status-block {
	margin: 20px 0;
	padding: 16px 20px;
	background: #f0f7ff;
	border-left: 4px solid #2271b1;
	border-radius: 4px;
	text-align: left;
}

.scanpay-status-title {
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 8px 0;
}

.scanpay-status-text {
	font-size: 14px;
	color: #50575e;
	line-height: 1.6;
	margin: 0;
}

/* Success state */
.scanpay-status-block.success {
	background: #d4edda;
	border-left-color: #28a745;
}

.scanpay-status-block.success .scanpay-status-title {
	color: #155724;
}

.scanpay-status-block.success .scanpay-status-text {
	color: #155724;
}

/* Failed state */
.scanpay-status-block.failed {
	background: #f8d7da;
	border-left-color: #dc3545;
}

.scanpay-status-block.failed .scanpay-status-title {
	color: #721c24;
}

.scanpay-status-block.failed .scanpay-status-text {
	color: #721c24;
}

.scanpay-status-message {
	margin-top: 15px;
	padding: 10px;
	border-radius: 4px;
}

.scanpay-paid {
	padding: 20px;
	background: #d4edda;
	border: 1px solid #c3e6cb;
	border-radius: 4px;
	margin: 20px 0;
	text-align: center;
}

.scanpay-paid h2 {
	color: #155724;
	margin-top: 0;
}

.scanpay-paid p {
	color: #155724;
	margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.scanpay-qr-image {
		max-width: 250px;
	}

	.scanpay-thankyou,
	.scanpay-paid {
		padding: 15px;
	}
}

/* Fallback payment link block */
.scanpay-fallback-link {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4f8;
    border: 1px solid #b8d4e3;
    border-radius: 8px;
    text-align: center;
}

.scanpay-fallback-link p {
    margin: 0 0 10px 0;
    color: #2c5282;
    font-size: 14px;
}

.scanpay-fallback-link-url {
    display: inline-block;
    color: #2b6cb0;
    font-weight: 600;
    text-decoration: underline;
    font-size: 14px;
    transition: color 0.2s ease;
}

.scanpay-fallback-link-url:hover {
    color: #1a4971;
}

/* Hide fallback link until session_id is available */
.scanpay-fallback-link[data-ready="false"] {
    display: none;
}

/* Scan & PayID Header */
.scanpay-header {
	text-align: center;
	margin-bottom: 15px;
}

.scanpay-header > div {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 24px;
	font-weight: 600;
	color: #333;
}

.scanpay-header img {
	height: 28px;
	vertical-align: middle;
}

@media (max-width: 768px) {
	.scanpay-header > div {
		font-size: 20px;
	}

	.scanpay-header img {
		height: 24px;
	}
}
