/**
 * User donations listing styles
 *
 * @package I_AM_Family_Portal
 */

/* Login Message */
.portal-login-message {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 40px;
	text-align: center;
	margin: 20px 0;
}

.portal-login-message p {
	margin: 10px 0;
	font-size: 16px;
	color: #23282d;
}

.portal-login-link {
	display: inline-block;
	padding: 10px 20px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	transition: background 0.2s;
}

.portal-login-link:hover {
	background: #135e96;
	color: #fff;
}

/* Main Container */
.portal-user-donations-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 and Filters */
.portal-payments-filters {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.portal-search-box {
	margin-bottom: 20px;
}

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

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

.portal-filters-row {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.portal-filters-row-first {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	align-items: end;
}

.portal-filters-row-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

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

.portal-filter-group label {
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 5px;
	color: #23282d;
}

.portal-filter-select {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s;
}

.portal-filter-select:focus {
	outline: none;
	border-color: #2271b1;
}


.portal-reset-btn,
.portal-export-btn {
	padding: 8px 16px;
	background: #f0f0f1;
	border: 1px solid #ddd;
	border-radius: 4px;
	color: #23282d;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.2s;
	white-space: nowrap;
}

.portal-reset-btn:hover,
.portal-export-btn:hover {
	background: #e0e0e0;
}

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

.portal-export-btn:hover {
	background: #135e96;
	border-color: #135e96;
}

/* Table Container */
.portal-payments-table-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-loading {
	text-align: center;
	padding: 40px;
	color: #646970;
}

.portal-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #2271b1;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-right: 10px;
	vertical-align: middle;
}

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

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

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

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

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

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

.portal-payments-table tbody td {
	border-right: 1px solid #eee;
}

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

.portal-payments-table th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #23282d;
}

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

.portal-payments-table td {
	padding: 12px 15px;
	color: #50575e;
	vertical-align: middle;
}

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

/* 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;
}

/* Actions */
.portal-payments-table th:last-child,
.portal-payments-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-btn {
	background: none;
	border: none !important;
	cursor: pointer;
	padding: 5px;
	margin: 0;
	color: #50575e;
	transition: color 0.2s;
	font-size: 18px;
	line-height: 1;
	box-shadow: none !important;
	outline: none !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

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

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

/* Pagination */
.portal-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 20px;
	padding: 15px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.portal-pagination-info {
	font-size: 14px;
	color: #646970;
}

.portal-pagination-controls {
	display: flex;
	align-items: center;
	gap: 10px;
}

.portal-pagination-btn {
	padding: 8px 16px;
	background: #f6f7f7;
	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;
}

.portal-pagination-number {
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	min-width: 40px;
	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;
}

.portal-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	cursor: pointer;
}

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

.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-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-section-content.portal-readonly {
	opacity: 0.8;
}

.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;
}

/* 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[type="number"] {
	-moz-appearance: textfield;
}

.portal-form-input[type="number"]::-webkit-outer-spin-button,
.portal-form-input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

textarea.portal-form-input {
	resize: vertical;
	min-height: 80px;
}

/* 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-user-donations-listing {
		padding: 10px;
	}

	.portal-filters-row-first {
		grid-template-columns: 1fr;
	}

	.portal-filters-row-actions {
		flex-direction: column;
		gap: 10px;
	}

	.portal-filters-row-actions .portal-reset-btn,
	.portal-filters-row-actions .portal-export-btn {
		width: 100%;
	}

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

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

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

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

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

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

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

	.portal-pagination-numbers {
		flex-wrap: wrap;
	}
}

