/**
 * Admin styles.
 *
 * @package AfriDirect_Payment
 */

.afridirect-dashboard {
	margin: 20px 0;
}

.afridirect-dashboard h1 {
	margin-bottom: 10px;
}

.afridirect-dashboard-section {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 8px;
	padding: 20px;
	margin-top: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.afridirect-dashboard-section h2 {
	margin-top: 0;
	margin-bottom: 8px;
	font-size: 20px;
	color: #1d2327;
}

.afridirect-dashboard-section .description {
	margin-bottom: 15px;
	color: #646970;
}

/* Bulk Actions Bar */
.afridirect-bulk-actions-bar {
	margin: 15px 0;
	padding: 12px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.afridirect-bulk-actions-bar select {
	min-width: 150px;
}

/* Orders Table */
.afridirect-orders-table {
	margin-top: 15px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
}

.afridirect-orders-table thead th {
	background: #f6f7f7;
	font-weight: 600;
	color: #1d2327;
	padding: 12px;
	border-bottom: 2px solid #c3c4c7;
}

.afridirect-orders-table tbody td {
	padding: 12px;
	vertical-align: middle;
}

.afridirect-orders-table tbody tr:hover {
	background: #f6f7f7;
}

.afridirect-meta {
	color: #646970;
	font-size: 13px;
}

/* Proof Thumbnail */
.afridirect-proof-thumbnail {
	display: inline-block;
	transition: transform 0.2s ease;
}

.afridirect-proof-thumbnail:hover {
	transform: scale(1.1);
}

/* Action Buttons */
.afridirect-action-buttons {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.afridirect-action-buttons .button {
	margin: 0;
}

.afridirect-action-buttons .button:focus,
.afridirect-approve-btn:focus,
.afridirect-reject-btn:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	box-shadow: 0 0 0 1px #2271b1;
}

.afridirect-bulk-actions-bar select:focus,
.afridirect-bulk-actions-bar button:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.afridirect-orders-table input[type="checkbox"]:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.afridirect-modal textarea:focus,
.afridirect-modal input:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-color: #2271b1;
}

/* Status Badges */
.afridirect-dashboard .status-afridirect-pending {
	color: #856404;
	background: #fff3cd;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

.afridirect-dashboard .status-afridirect-proof {
	color: #004085;
	background: #cce5ff;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

.afridirect-dashboard .status-afridirect-approved {
	color: #155724;
	background: #d4edda;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

.afridirect-dashboard .status-afridirect-rejected {
	color: #721c24;
	background: #f8d7da;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

.afridirect-dashboard .status-afridirect-expired {
	color: #721c24;
	background: #f5c6cb;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

/* Standalone Payment Status Badges */
.afridirect-status-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.afridirect-status-badge.afridirect-status-pending_proof {
	color: #856404;
	background: #fff3cd;
	border: 1px solid #ffc107;
}

.afridirect-status-badge.afridirect-status-needs_review {
	color: #004085;
	background: #cce5ff;
	border: 1px solid #0d6efd;
}

.afridirect-status-badge.afridirect-status-approved {
	color: #155724;
	background: #d4edda;
	border: 1px solid #28a745;
}

.afridirect-status-badge.afridirect-status-rejected {
	color: #721c24;
	background: #f8d7da;
	border: 1px solid #dc3545;
}

/* Payments Page Styles */
.afridirect-payments-page {
	margin: 20px 0;
}

.afridirect-payments-table {
	margin-top: 15px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
}

.afridirect-payments-table thead th {
	background: #f6f7f7;
	font-weight: 600;
	color: #1d2327;
	padding: 12px;
	border-bottom: 2px solid #c3c4c7;
}

.afridirect-payments-table tbody td {
	padding: 12px;
	vertical-align: middle;
}

.afridirect-payments-table tbody tr:hover {
	background: #f6f7f7;
}

.afridirect-payments-table .column-reference {
	width: 180px;
}

.afridirect-payments-table .column-payer {
	width: 200px;
}

.afridirect-payments-table .column-amount {
	width: 120px;
	text-align: right;
}

.afridirect-payments-table .column-method {
	width: 150px;
}

.afridirect-payments-table .column-status {
	width: 140px;
}

.afridirect-payments-table .column-date {
	width: 160px;
}

.afridirect-payments-table .column-actions {
	width: 100px;
}

/* Payment Edit Screen Styles */
.afridirect-payment-actions {
	display: flex;
	flex-direction: column;
	gap: var(--afridirect-space-sm, 10px);
}

.afridirect-action-approve .button,
.afridirect-action-reject .button {
	width: 100%;
	text-align: center;
}

.afridirect-status-message {
	padding: var(--afridirect-space-sm, 10px);
	border-radius: var(--afridirect-radius, 4px);
	margin: 0;
}

.afridirect-status-message.approved {
	background: var(--afridirect-success-bg, #d4edda);
	color: var(--afridirect-success-text, #155724);
	border: 1px solid var(--afridirect-success-border, #c3e6cb);
}

.afridirect-status-message.rejected {
	background: var(--afridirect-error-bg, #f8d7da);
	color: var(--afridirect-error-text, #721c24);
	border: 1px solid var(--afridirect-error-border, #f5c6cb);
}

.afridirect-rejection-reason {
	margin-top: var(--afridirect-space-sm, 10px);
	padding: var(--afridirect-space-sm, 10px);
	background: #fff3cd;
	border-left: 4px solid #ffc107;
	border-radius: var(--afridirect-radius, 4px);
}

.afridirect-proof-preview-admin {
	margin: var(--afridirect-space-md, 15px) 0;
}

.afridirect-proof-image-admin img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--afridirect-border, #ddd);
	border-radius: var(--afridirect-radius, 4px);
}

.afridirect-proof-file-admin {
	margin: var(--afridirect-space-md, 15px) 0;
}

.afridirect-proof-date {
	margin-top: var(--afridirect-space-sm, 10px);
	color: var(--afridirect-text-light, #666);
	font-size: 0.875rem;
}

.afridirect-no-proof {
	color: var(--afridirect-text-light, #666);
	font-style: italic;
}

/* Standalone Dashboard Styles */
.afridirect-dashboard-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: var(--afridirect-space-lg, 20px);
	margin-top: var(--afridirect-space-lg, 20px);
}

.afridirect-widget {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: var(--afridirect-radius, 4px);
	padding: var(--afridirect-space-lg, 20px);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.afridirect-widget h2 {
	margin: 0 0 var(--afridirect-space-md, 15px) 0;
	font-size: 1.125rem;
	color: var(--afridirect-text, #333);
}

.afridirect-stat {
	font-size: 2rem;
	font-weight: bold;
	color: var(--afridirect-primary, #0073aa);
	margin: var(--afridirect-space-md, 15px) 0;
}

.afridirect-widget .button {
	margin-top: var(--afridirect-space-sm, 10px);
}

/* Modal Styles */
.afridirect-modal,
.afridirect-modal {
	position: fixed;
	z-index: 100000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
}

.afridirect-modal-content,
.afridirect-modal-content {
	background-color: #fff;
	margin: auto;
	padding: 0;
	border-radius: 12px;
	width: 90%;
	max-width: 900px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	position: relative;
}

.afridirect-modal-small {
	max-width: 500px;
	width: 90%;
}

.afridirect-modal-header,
.afridirect-modal-header {
	padding: 20px 30px;
	border-bottom: 1px solid #e0e0e0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f6f7f7;
	border-radius: 12px 12px 0 0;
}

.afridirect-modal-header h2,
.afridirect-modal-header h2 {
	margin: 0;
	font-size: 20px;
	color: #1d2327;
	font-weight: 600;
}

.afridirect-modal-header .afridirect-modal-close,
.afridirect-modal-header .afridirect-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	font-weight: 300;
	color: #646970;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	line-height: 1;
	transition: color 0.2s ease;
	border-radius: 4px;
}

.afridirect-modal-header .afridirect-modal-close:hover,
.afridirect-modal-header .afridirect-modal-close:hover {
	color: #1d2327;
	background: #fff;
}

.afridirect-modal-header .afridirect-modal-close:focus,
.afridirect-modal-header .afridirect-modal-close:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	color: #1d2327;
	background: #fff;
}

.afridirect-modal-body,
.afridirect-modal-body {
	padding: 30px;
	max-height: calc(90vh - 120px);
	overflow-y: auto;
	display: block !important;
	text-align: left !important;
}

.afridirect-modal-content form {
	width: 100%;
	display: block;
}

.afridirect-form-row {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
}

.afridirect-form-row label {
	display: block;
	margin-bottom: 0;
	font-weight: 600;
	color: #1d2327;
}

.afridirect-modal-body textarea {
	flex: 1;
	width: 100% !important;
	max-width: none !important;
	min-height: 120px;
	padding: 8px 12px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
	box-sizing: border-box;
}

.afridirect-modal-body textarea:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-color: #2271b1;
}

.afridirect-modal-footer {
	padding: 20px 30px;
	border-top: 1px solid #e0e0e0;
	background: #f6f7f7;
	border-radius: 0 0 12px 12px;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.afridirect-modal-footer .button {
	margin: 0;
	min-width: 100px;
}

/* Review Content */
.review-order-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}

.order-info {
	background: #f8f9fa;
	padding: 20px;
	border-radius: 4px;
}

.order-info h3 {
	margin-top: 0;
	color: #2c3e50;
}

.order-info p {
	margin: 10px 0;
	color: #495057;
}

.proof-preview {
	grid-column: 1 / -1;
	margin-bottom: 20px;
}

.proof-preview h3 {
	margin-bottom: 15px;
	color: #2c3e50;
}

.proof-preview img,
.proof-preview iframe {
	max-width: 100%;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.proof-preview .button {
	margin-top: 15px;
}

.review-actions {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin-top: 20px;
}

.review-actions form {
	background: #f8f9fa;
	padding: 20px;
	border-radius: 4px;
	border: 2px solid transparent;
}

.review-actions form h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #2c3e50;
}

.review-actions #approve-form {
	border-color: #28a745;
}

.review-actions #reject-form {
	border-color: #dc3545;
}

.review-actions label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #495057;
}

.review-actions textarea {
	width: 100%;
	margin-bottom: 15px;
}

.review-actions .button {
	margin-top: 10px;
}

/* Table Enhancements */
.afridirect-orders-table .column-order {
	width: 100px;
}

.afridirect-orders-table .column-customer {
	width: 180px;
}

.afridirect-orders-table .column-total {
	width: 100px;
	text-align: right;
}

.afridirect-orders-table .column-method {
	width: 150px;
}

.afridirect-orders-table .column-uploaded {
	width: 160px;
}

.afridirect-orders-table .column-proof {
	width: 100px;
	text-align: center;
}

.afridirect-orders-table .column-actions {
	width: 200px;
}

.afridirect-orders-table .check-column {
	width: 40px;
}

/* Responsive */
@media (max-width: 1200px) {
	.afridirect-orders-table {
		font-size: 13px;
	}

	.afridirect-action-buttons {
		flex-direction: column;
	}

	.afridirect-action-buttons .button {
		width: 100%;
	}
}

@media (max-width: 768px) {
	.review-order-content {
		grid-template-columns: 1fr;
	}

	.review-actions {
		grid-template-columns: 1fr;
	}

	.afridirect-modal-content,
	.afridirect-modal-content {
		width: 95%;
		max-height: 95vh;
	}

	.afridirect-modal-small {
		max-width: 95%;
		width: 95%;
	}

	.afridirect-modal-body,
	.afridirect-modal-body {
		padding: 20px;
	}

	.afridirect-form-row {
		flex-direction: column;
	}

	.afridirect-orders-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.afridirect-bulk-actions-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.afridirect-bulk-actions-bar select,
	.afridirect-bulk-actions-bar button {
		width: 100%;
	}
}

