/**
 * Donors listing styles
 *
 * @package I_AM_Family_Portal
 */

/* Main Container */
.portal-donors-listing {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search */
.portal-donors-search {
	position: relative;
	margin-bottom: 20px;
}

.portal-donors-search .portal-search-input {
	width: 100%;
	padding: 12px 15px 12px 40px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s;
}

.portal-donors-search .portal-search-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.portal-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #646970;
	font-size: 18px;
	pointer-events: none;
}

/* Container */
.portal-donors-container {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	position: relative;
	min-height: 200px;
}

.portal-donors-loading {
	text-align: center;
	padding: 40px;
	color: #646970;
}

.portal-donors-loading .spin {
	animation: spin 1s linear infinite;
	margin-right: 10px;
}

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

/* Table */
.portal-donors-table-wrapper {
	overflow-x: auto;
}

.portal-donors-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	border: 1px solid #ddd;
}

.portal-donors-table thead {
	background-color: #f6f7f7;
	border-bottom: 2px solid #ddd;
}

.portal-donors-table thead th {
	border-right: 1px solid #ddd;
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #23282d;
}

.portal-donors-table thead th:last-child {
	border-right: 1px solid #ddd;
}

.portal-donors-table tbody tr {
	border-bottom: 1px solid #eee;
	transition: background-color 0.2s;
}

.portal-donors-table tbody tr:hover {
	background-color: #f9f9f9;
}

.portal-donors-table tbody td {
	padding: 12px 15px;
	color: #50575e;
	vertical-align: middle;
	border-right: 1px solid #eee;
}

.portal-donors-table tbody td:last-child {
	border-right: 1px solid #ddd;
}

.portal-no-results {
	text-align: center;
	padding: 40px;
	color: #646970;
	font-style: italic;
}

/* Actions */
.portal-donors-table th.portal-actions,
.portal-donors-table td.portal-actions {
	text-align: left;
	padding: 12px 15px;
	border: none;
	background: transparent;
}

.portal-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: flex-start;
}

.portal-action-icon {
	cursor: pointer;
	color: #50575e;
	font-size: 18px;
	line-height: 1;
	transition: color 0.2s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.portal-action-icon:hover {
	color: #2271b1;
}

.portal-action-icon .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

/* Pagination */
.portal-donors-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 20px;
	padding: 15px;
	background: #f6f7f7;
	border-top: 1px solid #ddd;
}

.portal-pagination-btn {
	padding: 8px 16px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.2s;
}

.portal-pagination-btn:hover:not(.disabled) {
	background: #e0e0e0;
}

.portal-pagination-btn.disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.portal-pagination-numbers {
	display: flex;
	gap: 5px;
	align-items: center;
}

.portal-pagination-number {
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	min-width: 40px;
	text-align: center;
	transition: all 0.2s;
}

.portal-pagination-number:hover {
	background: #f6f7f7;
	border-color: #2271b1;
}

.portal-pagination-number.active {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.portal-pagination-dots {
	padding: 8px 5px;
	color: #646970;
}

/* Modal */
.portal-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.7);
}

.portal-modal-content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	z-index: 1;
}

.portal-modal-large {
	max-width: 1200px;
}

.portal-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	border-bottom: 1px solid #ddd;
}

.portal-modal-header h2 {
	margin: 0;
	font-size: 20px;
	color: #23282d;
}

.portal-modal-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px;
	color: #646970;
	font-size: 24px;
	line-height: 1;
	transition: color 0.2s;
}

.portal-modal-close:hover {
	color: #23282d;
}

.portal-modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

.portal-modal-footer {
	padding: 20px;
	border-top: 1px solid #ddd;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

/* Modal Sections */
.portal-modal-section {
	margin-bottom: 30px;
}

.portal-modal-section:last-child {
	margin-bottom: 0;
}

.portal-donor-info-section {
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 20px;
}

.portal-section-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 15px 0;
	color: #23282d;
	padding-bottom: 10px;
	border-bottom: 2px solid #f0f0f1;
}

.portal-section-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 15px;
}

.portal-field-group {
	display: flex;
	flex-direction: column;
}

.portal-field-group.portal-field-full {
	grid-column: 1 / -1;
}

.portal-field-label {
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 5px;
	color: #646970;
}

.portal-field-value {
	font-size: 14px;
	color: #23282d;
	word-break: break-word;
}

.portal-field-value a {
	color: #2271b1;
	text-decoration: none;
}

.portal-field-value a:hover {
	text-decoration: underline;
}

.portal-empty {
	color: #a7aaad;
	font-style: italic;
}

.required {
	color: #d63638;
}

/* Tabs */
.portal-donor-tabs {
	margin-top: 20px;
}

.portal-tab-nav {
	display: flex;
	border-bottom: 2px solid #ddd;
	margin-bottom: 20px;
}

.portal-tab-btn {
	background: none;
	border: none;
	padding: 12px 20px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #646970;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	gap: 8px;
}

.portal-tab-btn:hover {
	color: #23282d;
}

.portal-tab-btn.active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

.portal-tab-count {
	font-size: 12px;
	font-weight: normal;
	color: #646970;
}

.portal-tab-btn.active .portal-tab-count {
	color: #2271b1;
}

.portal-tab-content {
	display: none;
}

.portal-tab-content.active {
	display: block;
}

/* Donations Table in Modal */
.portal-donations-table-wrapper {
	overflow-x: auto;
}

.portal-donations-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.portal-donations-table thead {
	background-color: #f6f7f7;
	border-bottom: 2px solid #ddd;
}

.portal-donations-table thead th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #23282d;
	border-right: 1px solid #ddd;
}

.portal-donations-table tbody tr {
	border-bottom: 1px solid #eee;
	transition: background-color 0.2s;
}

.portal-donations-table tbody tr:hover {
	background-color: #f9f9f9;
}

.portal-donations-table tbody td {
	padding: 12px 15px;
	color: #50575e;
	vertical-align: middle;
	border-right: 1px solid #eee;
}

/* Status Badge */
.portal-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.portal-status-completed {
	background: #d4edda;
	color: #155724;
}

.portal-status-pending {
	background: #fff3cd;
	color: #856404;
}

.portal-status-failed {
	background: #f8d7da;
	color: #721c24;
}

.portal-status-refunded {
	background: #d1ecf1;
	color: #0c5460;
}

/* Notes Tab */
.portal-notes-placeholder {
	padding: 40px;
	text-align: center;
	color: #646970;
	font-style: italic;
}

/* Sync Notice */
.portal-sync-notice {
	background: #e7f5ff;
	border: 1px solid #2271b1;
	border-radius: 4px;
	padding: 12px 15px;
	margin-bottom: 20px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.portal-sync-notice .dashicons {
	color: #2271b1;
	font-size: 20px;
	margin-top: 2px;
}

.portal-sync-notice p {
	margin: 0;
	font-size: 14px;
	color: #135e96;
}

/* Form Elements */
.portal-form-input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	width: 100%;
	transition: border-color 0.2s;
}

.portal-form-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.portal-form-input:disabled {
	background: #f0f0f1;
	color: #646970;
	cursor: not-allowed;
}

.portal-field-help {
	font-size: 12px;
	color: #646970;
	margin-top: 5px;
}

/* Buttons */
.portal-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.portal-btn-primary {
	background: #2271b1;
	color: #fff;
}

.portal-btn-primary:hover {
	background: #135e96;
}

.portal-btn-secondary {
	background: #f6f7f7;
	color: #23282d;
	border: 1px solid #ddd;
}

.portal-btn-secondary:hover {
	background: #e0e0e0;
}

/* Form Messages */
.portal-form-messages {
	margin-top: 15px;
	padding: 10px;
	border-radius: 4px;
	display: none;
}

.portal-form-messages.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	display: block;
}

.portal-form-messages.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	display: block;
}

/* Responsive */
@media (max-width: 768px) {
	.portal-donors-listing {
		padding: 10px;
	}

	.portal-donors-table {
		font-size: 12px;
	}

	.portal-donors-table th,
	.portal-donors-table td {
		padding: 8px 10px;
	}

	.portal-donors-pagination {
		flex-direction: column;
		gap: 15px;
	}

	.portal-pagination-numbers {
		flex-wrap: wrap;
		justify-content: center;
	}

	.portal-modal-content {
		width: 95%;
		max-height: 95vh;
	}

	.portal-section-content {
		grid-template-columns: 1fr;
	}

	.portal-tab-nav {
		flex-wrap: wrap;
	}
}

@media (max-width: 480px) {
	.portal-donors-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}

