/**
 * UniVoucher For WooCommerce - Admin Styles
 * @package UniVoucher_For_WooCommerce
 * @subpackage Admin
 */

/* Core Layout */


.postbox-header h2,
.postbox-header h3 {
	margin: 0;
	padding: 15px 20px;
}

.univoucher-inventory .inside {
	padding: 20px;
}

.univoucher-add-cards .inside.compact {
	padding: 15px 20px;
}

.univoucher-inventory h3 {
	margin: 25px 0 10px;
}

.univoucher-inventory ul {
	margin-left: 20px;
}

.univoucher-inventory .button + .button {
	margin-left: 10px;
}

/* Form Elements */
.univoucher-wc-row {
	vertical-align: top;
}

.univoucher-wc-row input[type="password"],
.univoucher-wc-row input[type="text"] {
	width: 25em;
}

.univoucher-wc-row input + .button {
	margin-left: 5px;
}

.univoucher-wc-row .description {
	margin-top: 5px;
	font-style: italic;
}

.univoucher-wc-row .description .dashicons {
	margin-right: 5px;
	vertical-align: middle;
}

.form-table th {
	width: 200px;
}

/* Product Admin */
.univoucher-gift-card-options {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 15px;
	margin-top: 10px;
	background: #fafafa;
}

.univoucher-erc20-field {
	display: none;
}

.univoucher-token-info {
	margin-top: 10px;
}

.univoucher-token-success {
	padding: 10px;
	border: 1px solid #46b450;
	border-radius: 4px;
	background: #f0fff4;
	color: #333;
}

.univoucher-token-success table {
	margin-top: 10px;
	width: 100%;
}

.univoucher-token-success td {
	padding: 5px 10px 5px 0;
	vertical-align: top;
}

.univoucher-token-error {
	padding: 10px;
	border: 1px solid #dc3232;
	border-radius: 4px;
	background: #fff5f5;
	color: #dc3232;
}

.univoucher-token-symbol {
	font-weight: bold;
	color: #0073aa;
	padding: 5px 10px;
	background: #f0f8ff;
	border: 1px solid #0073aa;
	border-radius: 3px;
	display: inline-block;
	min-width: 40px;
	text-align: center;
}

.univoucher-stock-display {
	font-size: 14px;
	color: #666;
}

.univoucher-stock-display strong {
	color: #333;
	font-size: 16px;
}

/* Stats Grid */
.univoucher-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.stats-card {
	background: white;
	padding: 20px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	text-align: center;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s;
}

.stats-card:hover {
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stats-card.available { border-color: #00a32a; }
.stats-card.sold { border-color: #dba617; }
.stats-card.inactive { border-color: #d63638; }

.stats-number {
	font-size: 36px;
	font-weight: 600;
	line-height: 1;
	margin-bottom: 5px;
}

.stats-card.available .stats-number { color: #00a32a; }
.stats-card.sold .stats-number { color: #dba617; }
.stats-card.inactive .stats-number { color: #d63638; }

.stats-label {
	font-size: 14px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Status Badges */
.status-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	color: #fff;
}

.status-badge.status-available { background-color: #00a32a; }
.status-badge.status-sold { background-color: #dba617; }
.status-badge.status-inactive { background-color: #d63638; }

/* Delivery Status Badges */
.delivery-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 6px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	background-color: #f0f0f1;
	color: #50575e;
	border: 1px solid #dcdcde;
}

.delivery-badge.delivery-never-delivered {
	background-color: #fff3cd;
	color: #856404;
	border-color: #ffeaa7;
}

.delivery-badge.delivery-delivered {
	background-color: #d1edff;
	color: #0073aa;
	border-color: #72aee6;
}

.delivery-badge.delivery-returned-after-delivery {
	background-color: #f8d7da;
	color: #721c24;
	border-color: #f5c6cb;
}

.delivery-badge .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

/* WordPress Standard Table Columns */
.wp-list-table .column-card_id { width: 15%; }
.wp-list-table .column-product_id { width: 15%; }
.wp-list-table .column-order_id { width: 12%; }
.wp-list-table .column-status { width: 10%; }
.wp-list-table .column-delivery_status { width: 12%; }
.wp-list-table .column-network { width: 12%; }
.wp-list-table .column-token { width: 12%; }
.wp-list-table .column-amount { width: 10%; text-align: right; }
.wp-list-table .column-created_at { width: 12%; }

.wp-list-table .column-product_id a,
.wp-list-table .column-order_id a {
	text-decoration: none;
}

.wp-list-table .column-product_id a:hover,
.wp-list-table .column-order_id a:hover {
	color: #0073aa;
}

.wp-list-table .column-amount {
	text-align: right;
}

.wp-list-table code {
	font-size: 11px;
	background: #f8f9fa;
	padding: 2px 4px;
	border-radius: 2px;
}

/* Method Selection */
.methods-container-inline {
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
	margin-top: 10px;
}

.method-box-inline {
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	padding: 15px;
	cursor: pointer;
	transition: all 0.3s ease;
	background: #fff;
	flex: 1;
	min-width: 200px;
	max-width: 300px;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 80px;
}

.method-box-inline.available {
	border-color: #e0e0e0;
}

.method-box-inline.available:hover {
	border-color: #005a87;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
	transform: translateY(-1px);
}

.method-box-inline.active {
	border-color: #0073aa;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
	background: #f8f9ff;
}

.method-box-inline.coming-soon {
	border-color: #ddd;
	background: #f9f9f9;
	cursor: not-allowed;
	opacity: 0.7;
}

.method-icon-inline {
	flex-shrink: 0;
	margin-top: 2px;
}

.method-icon-inline .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	color: #666;
}

.method-box-inline.available .method-icon-inline .dashicons {
	color: #666;
}

.method-box-inline.active .method-icon-inline .dashicons {
	color: #0073aa;
}

.method-content-inline {
	flex: 1;
}

.method-content-inline h4 {
	margin: 0 0 8px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.method-content-inline p {
	margin: 0;
	font-size: 12px;
	color: #666;
	line-height: 1.4;
}



/* Product Settings */
.product-settings-box {
	background: #f8f9fa;
	border: 1px solid #e1e5e9;
	border-radius: 6px;
	padding: 20px;
	margin: 20px 0;
	display: flex;
	flex-wrap: wrap;
	gap: 25px;
	align-items: center;
}

.product-settings-box .setting-item {
	display: flex;
	flex-direction: column;
	min-width: 120px;
}

.product-settings-box .setting-label {
	font-weight: 600;
	color: #1d2327;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 5px;
}

.product-settings-box .setting-value {
	color: #646970;
	font-size: 14px;
	word-break: break-all;
}

.product-settings-box .product-link {
	color: #0073aa;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.product-settings-box .product-link:hover {
	color: #005a87;
}

.product-settings-box .stock-info {
	color: #d63638;
	font-weight: 600;
}

.product-settings-box .stock-info.in-stock {
	color: #00a32a;
}

.product-settings-box .stock-info.on-backorder {
	color: #f56e28;
}

.product-settings-box .stock-info.out-of-stock {
	color: #d63638;
}

/* Gift Card Form */
.gift-card-row input.error {
	border-color: #d63638;
	box-shadow: 0 0 0 1px #d63638;
	background-color: #fdf2f2;
}

.gift-card-row input.valid {
	border-color: #00a32a;
	box-shadow: 0 0 0 1px #00a32a;
	background-color: #f0fff4;
}

.validation-error {
	color: #d63638;
	font-size: 12px;
	margin-top: 5px;
	line-height: 1.3;
	display: none;
}

.validation-error:before {
	content: "⚠ ";
	font-weight: bold;
}

.validation-col {
	text-align: center;
	width: 60px;
	vertical-align: middle;
}

.validation-icon {
	display: inline-block;
	font-size: 18px;
	margin: 0 auto;
}

.validation-icon.valid {
	color: #28a745;
}

.validation-icon.invalid {
	color: #d63638;
}

.validation-icon.pending {
	color: #646970;
}

.validation-icon.loading {
	color: #2271b1;
	animation: spin 1s linear infinite;
}

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

.validation-requirements-list {
	margin: 10px 0 15px 0;
	padding-left: 0;
}

.validation-requirements-list li {
	list-style: none;
	margin: 8px 0;
	padding: 4px 0;
	font-size: 14px;
	line-height: 1.4;
}

.validation-requirements-list .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 8px;
}

/* Cards Table */
#gift-cards-table th:nth-child(1),
#gift-cards-table th:nth-child(4),
#gift-cards-table th:nth-child(5),
#gift-cards-table th:nth-child(6),
#gift-cards-table th:nth-child(7),
#gift-cards-table th:nth-child(8),
#gift-cards-table th:nth-child(9),
#gift-cards-table th:nth-child(10) {
	text-align: center;
}

#gift-cards-table td:nth-child(1),
#gift-cards-table td:nth-child(4),
#gift-cards-table td:nth-child(5),
#gift-cards-table td:nth-child(6),
#gift-cards-table td:nth-child(7),
#gift-cards-table td:nth-child(8),
#gift-cards-table td:nth-child(9),
#gift-cards-table td:nth-child(10) {
	text-align: center;
}

.card-id-input,
.card-secret-input {
	width: 100%;
	font-family: 'Courier New', monospace;
	padding: 4px 8px;
}

.card-id-input::-webkit-outer-spin-button,
.card-id-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.card-id-input[type=number] {
	-moz-appearance: textfield;
}

.card-secret-input {
	text-transform: uppercase;
	letter-spacing: 1px;
}

.card-number {
	text-align: center;
	font-weight: bold;
	color: #646970;
	width: 30px;
}

.validate-card-btn {
	margin-right: 5px;
	font-size: 12px;
	padding: 2px 8px;
	height: auto;
	line-height: 1.4;
}

.validate-card-btn.validating {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Action Controls */
.cards-action-controls {
	padding: 15px 0;
	margin-bottom: 15px;
	border-bottom: 1px solid #dcdcde;
}

.disabled-message {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background-color: #fef7f1;
	border: 1px solid #f0b849;
	border-radius: 4px;
	color: #8a6914;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	max-width: 600px;
}

.disabled-message .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #f0b849;
	flex-shrink: 0;
}

.disabled-message.hidden {
	display: none;
}

.disabled-message.success {
	background-color: #f0f8f0;
	border-color: #46b450;
	color: #2d5016;
}

.disabled-message.success .dashicons {
	color: #46b450;
}

/* Button icons */
.csv-upload-btn .dashicons,
#validate-all-cards-btn .dashicons,
#add-cards-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin-right: 6px;
	vertical-align: middle;
}


/* Product Dropdown */
#selected-product {
	width: 100%;
}

/* Filter Controls */
.tablenav .actions {
	margin-right: 10px;
}

.tablenav .actions select {
	margin-right: 5px;
}

.search-box {
	float: right;
}

.search-box input {
	margin-right: 5px;
}

/* Table Responsive */
.table-responsive {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
	.univoucher-wc-row input[type="password"],
	.univoucher-wc-row input[type="text"] {
		width: 100%;
		max-width: 25em;
	}
	
	.univoucher-inventory .button + .button {
		margin-left: 0;
		margin-top: 5px;
		display: block;
	}
	
	.univoucher-stats-grid {
		grid-template-columns: 1fr;
	}
	
	.methods-container-inline {
		flex-direction: column;
		gap: 10px;
	}
	
	.method-box-inline {
		min-width: auto;
		max-width: none;
	}
	
	.product-settings-box {
		flex-direction: column;
		gap: 15px;
		align-items: stretch;
	}
	
	.product-settings-box .setting-item {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		min-width: auto;
	}
	
	.product-settings-box .setting-label {
		margin-bottom: 0;
		margin-right: 10px;
	}
	
	.cards-action-controls + div {
		flex-direction: column;
		align-items: stretch;
	}
	
	.cards-action-controls + div .button {
		width: 100%;
		margin-bottom: 8px;
		justify-content: center;
	}
	
	#selected-product {
		max-width: 100%;
		font-size: 16px;
	}
	
	.validation-col {
		width: 40px;
	}
	
	.validation-icon {
		width: 16px;
		height: 16px;
		line-height: 16px;
		font-size: 10px;
	}
	
	.validate-card-btn {
		font-size: 11px;
		padding: 1px 6px;
	}
	
	.tablenav .actions {
		margin-bottom: 10px;
	}
	
	.search-box {
		float: none;
		margin-top: 10px;
	}
	
	.disabled-message {
		font-size: 12px;
		padding: 6px 10px;
	}
}

@media (max-width: 768px) {
	.table-responsive {
		overflow-x: scroll;
		margin-bottom: 15px;
	}
	
	#gift-cards-table {
		min-width: 800px;
		font-size: 12px;
	}
	
	#gift-cards-table th,
	#gift-cards-table td {
		padding: 8px 4px;
		white-space: nowrap;
	}
	
	#gift-cards-table .card-id-input,
	#gift-cards-table .card-secret-input {
		width: 100%;
		min-width: 120px;
		font-size: 12px;
	}
	
	#gift-cards-table .validate-card-btn,
	#gift-cards-table .remove-card-btn {
		font-size: 11px;
		padding: 4px 8px;
		margin: 2px;
		display: block;
		width: 100%;
		margin-bottom: 4px;
	}
}

@media (max-width: 480px) {
	#gift-cards-table {
		min-width: 600px;
		font-size: 11px;
	}
	
	#gift-cards-table th,
	#gift-cards-table td {
		padding: 6px 2px;
	}
	
	#gift-cards-table .card-id-input,
	#gift-cards-table .card-secret-input {
		min-width: 100px;
		font-size: 11px;
	}
}

/* Simple Corner Notifications */
#univoucher-notifications {
	position: fixed;
	top: 52px;
	right: 40px;
	z-index: 100000;
	max-width: 400px;
}

.univoucher-notification {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	margin-bottom: 10px;
	padding: 12px 40px 12px 16px;
	position: relative;
	opacity: 0;
	transform: translateX(100%);
	transition: all 0.3s ease;
}

.univoucher-notification.show {
	opacity: 1;
	transform: translateX(0);
}

.univoucher-notification:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}



.univoucher-notification-content {
	font-size: 14px;
	line-height: 1.4;
	color: #23282d;
}

.univoucher-notification-close {
	position: absolute;
	top: 8px;
	right: 8px;
	background: none;
	border: none;
	font-size: 18px;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 24px;
	height: 24px;
	text-align: center;
	line-height: 1;
}

.univoucher-notification-close:hover {
	color: #d63638;
}

.univoucher-notification-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 3px;
	background: rgba(0,0,0,0.1);
	border-radius: 0 0 4px 4px;
	transition: width 0.1s linear;
}

.univoucher-notification-success .univoucher-notification-progress {
	background: #46b450;
}

.univoucher-notification-error .univoucher-notification-progress {
	background: #d63638;
}

/* Soon Tag */
.soon-tag {
	background: #fff3cd;
	color: #856404;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-left: 8px;
	border: 1px solid #ffeaa7;
	display: inline-block;
	vertical-align: middle;
}

.univoucher-notification-warning .univoucher-notification-progress {
	background: #ffb900;
}

.univoucher-notification-info .univoucher-notification-progress {
	background: #0073aa;
}

/* Special styling for notifications with transaction hashes */
.univoucher-notification-with-tx {
	max-width: 600px !important;
	word-wrap: break-word;
	word-break: break-all;
}

.univoucher-notification-with-tx .univoucher-notification-content {
	font-family: monospace;
	font-size: 13px;
	line-height: 1.5;
}

.univoucher-settings-box {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 15px;
}

.univoucher-settings-box-info {
	background: #d1ecf1;
	border: 1px solid #bee5eb;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 15px;
}

.univoucher-settings-box-success {
	background: #e8f5e8;
	border: 1px solid #c3e6c3;
	border-radius: 3px;
	padding: 10px;
	margin: 10px 0;
}

.univoucher-settings-box-warning {
	background: #fff3cd;
	border: 1px solid #ffeaa7;
	border-radius: 3px;
	padding: 10px;
	margin-bottom: 15px;
}

.univoucher-settings-box-danger {
	background: #dc3545;
	color: #fff;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 15px;
}

.univoucher-settings-box-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 15px;
}

.univoucher-settings-highlight {
	background: #e8f4f8;
	border-left: 3px solid #3498db;
	padding: 10px;
	margin: 10px 0;
	font-size: 14px;
}

.univoucher-settings-box h4,
.univoucher-settings-box-info h4 {
	margin: 0 0 12px 0;
	color: #2c3e50;
}

.univoucher-settings-box-danger h4 {
	margin: 0 0 10px 0;
	color: #fff;
}

.univoucher-settings-box-error h4 {
	margin: 0 0 10px 0;
	color: #721c24;
}

.univoucher-settings-highlight strong {
	color: #2980b9;
}

/* Wallet Details Styles */
#wallet-details-container {
	margin-top: 15px;
}

#wallet-address-display {
	font-family: 'Courier New', monospace;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 8px 12px;
}

#copy-address-btn,
#refresh-balances-btn {
	margin-left: 10px;
}

#balances-container {
	margin-top: 20px;
}

#balances-container h5 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
}

.balance-card {
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 15px;
	background: #f9f9f9;
	transition: all 0.2s ease;
	min-height: 120px;
}

.balance-card:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	transform: translateY(-1px);
}





#balances-loading,
#balances-error {
	padding: 15px;
	border-radius: 4px;
	background: #f9f9f9;
	border: 1px solid #ddd;
}

#balances-error {
	background: #f8d7da;
	border-color: #f5c6cb;
	color: #721c24;
}

/* Responsive design for wallet details */
@media (max-width: 768px) {
	#wallet-address-display {
		width: 100% !important;
		max-width: none !important;
	}
	
	#copy-address-btn,
	#refresh-balances-btn {
		margin-left: 5px;
		font-size: 12px;
		padding: 4px 8px;
	}
	
	.balance-card {
		min-height: auto;
		padding: 12px;
	}
	
	#balances-list > div {
		grid-template-columns: 1fr !important;
	}
}

/* Internal Wallet Styles */
.wallet-info-grid {
	border: 1px solid #ddd;
	padding: 15px;
	border-radius: 4px;
	background: #f9f9f9;
}

.cost-summary table {
	border-collapse: collapse;
}

.cost-summary table td {
	padding: 8px 12px;
	border-bottom: 1px solid #eee;
}

.cost-summary table tr:last-child td {
	border-bottom: none;
}

#allowance-section {
	border: 1px solid #ddd;
	padding: 15px;
	border-radius: 4px;
	background: #f9f9f9;
}

#allowance-insufficient {
	background: #fef7f7;
	border: 1px solid #f5c6cb;
	padding: 12px;
	border-radius: 4px;
}

#allowance-sufficient {
	background: #f0f9ff;
	border: 1px solid #bee5eb;
	padding: 12px;
	border-radius: 4px;
}

.step1-actions, .step2-actions, .step3-actions {
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #ddd;
}

#transaction-summary table {
	border-collapse: collapse;
}

#transaction-summary table td {
	padding: 8px 12px;
	border-bottom: 1px solid #eee;
}

#transaction-summary table tr:last-child td {
	border-bottom: none;
}

#created-cards-list {
	background: #f9f9f9;
	border: 1px solid #ddd;
	padding: 15px;
	border-radius: 4px;
	max-height: 200px;
	overflow-y: auto;
}

#transaction-link {
	word-break: break-all;
}

/* Internal Wallet Steps Navigation */
.internal-wallet-steps {
	display: flex;
	margin-bottom: 20px;
	border-bottom: 1px solid #ddd;
}

.internal-wallet-steps .step {
	padding: 10px 20px;
	background: #f1f1f1;
	margin-right: 1px;
	position: relative;
}

.internal-wallet-steps .step.active {
	background: #0073aa;
	color: white;
}

.internal-wallet-steps .step.completed {
	background: #46b450;
	color: white;
}

/* Balance display styling */
#wallet-balances {
	font-size: 13px;
	line-height: 1.4;
}

/* Responsive adjustments for internal wallet */
@media (max-width: 768px) {
	.wallet-info-grid {
		grid-template-columns: 1fr !important;
		gap: 10px;
	}
	
	.cost-summary table,
	#transaction-summary table {
		font-size: 12px;
	}
	
	.step2-actions .button {
		display: block;
		margin-bottom: 10px;
		width: 100%;
	}
} 