/**
 * EMG Fundraising Helper - Public Styles
 *
 * @package    EMG_Fundraising_Helper
 * @subpackage EMG_Fundraising_Helper/assets/css
 * @since      1.0.0
 */

/* ========================================
   My Projects Page
   ======================================== */

.emg-my-projects-container {
	padding: 20px 0;
}

/* Projects Grid */
.emg-projects-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	margin-bottom: 40px;
}

/* Project Card */
.emg-project-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.emg-project-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Project Image */
.emg-project-image {
	position: relative;
	width: 100%;
	padding-bottom: 66.67%; /* 3:2 aspect ratio */
	overflow: hidden;
	background: #f5f5f5;
}

.emg-project-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.emg-project-card:hover .emg-project-image img {
	transform: scale(1.05);
}

.emg-project-no-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f5f5f5;
}

.emg-project-no-image .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	color: #ccc;
}

/* Project Overlay */
.emg-project-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.emg-project-card:hover .emg-project-overlay {
	opacity: 1;
}

.emg-project-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: center;
}

.emg-project-action {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: #fff;
	border-radius: 50%;
	text-decoration: none;
	color: #333;
	transition: all 0.2s ease;
	width: 48px;
	height: 48px;
}

.emg-project-action:hover {
	background: #2271b1;
	color: #fff;
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.emg-project-action .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.emg-project-action.emg-loading {
	cursor: not-allowed;
	opacity: 0.7;
}

.emg-project-action .dashicons-spin {
	animation: emg-spin 1s linear infinite;
}

@keyframes emg-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Project Details */
.emg-project-details {
	padding: 20px;
}

.emg-project-title {
	margin: 0 0 10px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

.emg-project-title a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

.emg-project-title a:hover {
	color: #2271b1;
}

.emg-project-raised {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #2271b1;
}

/* Pagination */
.emg-projects-pagination {
	margin: 40px 0 20px;
	text-align: center;
}

.emg-projects-pagination .page-numbers {
	display: inline-flex;
	gap: 8px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.emg-projects-pagination .page-numbers li {
	display: inline-block;
}

.emg-projects-pagination a,
.emg-projects-pagination span {
	display: inline-block;
	padding: 10px 15px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	color: #333;
	text-decoration: none;
	transition: all 0.2s ease;
	font-size: 14px;
	line-height: 1;
}

.emg-projects-pagination a:hover {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.emg-projects-pagination .current {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
	font-weight: 700;
}

.emg-projects-pagination .dots {
	border: none;
	background: transparent;
	cursor: default;
}

/* No Projects State */
.emg-no-projects {
	text-align: center;
	padding: 60px 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.emg-no-projects .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	color: #ccc;
	margin-bottom: 15px;
}

.emg-no-projects p {
	font-size: 18px;
	color: #666;
	margin: 0;
}

/* Responsive Design */

/* Tablet (landscape and portrait) */
@media (max-width: 1024px) {
	.emg-projects-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 25px;
	}
}

/* Mobile */
@media (max-width: 768px) {
	.emg-projects-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.emg-projects-pagination a,
	.emg-projects-pagination span {
		padding: 8px 12px;
		font-size: 13px;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.emg-my-projects-container {
		padding: 15px 0;
	}

	.emg-project-actions {
		gap: 10px;
	}

	.emg-project-action {
		width: 44px;
		height: 44px;
		padding: 10px;
	}

	.emg-project-action .dashicons {
		font-size: 22px;
		width: 22px;
		height: 22px;
	}
}

/* ========================================
   Contributions Modal
   ======================================== */

/* Modal Overlay */
.emg-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 9998;
}

/* Modal Container */
.emg-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 8px;
	max-width: 95%;
	max-height: 90vh;
	width: 1200px;
	z-index: 9999;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
}

/* Modal Header */
.emg-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 25px;
	border-bottom: 1px solid #e0e0e0;
}

.emg-modal-header h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: #333;
}

.emg-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.emg-modal-close:hover {
	color: #333;
}

/* Modal Body */
.emg-modal-body {
	padding: 25px;
	overflow: auto;
	flex: 1;
}

/* Prevent body scroll when modal is open */
body.emg-modal-open {
	overflow: hidden;
}

/* Contributions Table */
.emg-contributions-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.emg-contributions-table thead {
	background: #f5f5f5;
	position: sticky;
	top: 0;
}

.emg-contributions-table th {
	padding: 12px 10px;
	text-align: left;
	font-weight: 700;
	color: #333;
	border-bottom: 2px solid #ddd;
	white-space: nowrap;
}

.emg-contributions-table tbody tr {
	border-bottom: 1px solid #e0e0e0;
	transition: background 0.2s ease;
}

.emg-contributions-table tbody tr:hover {
	background: #f9f9f9;
}

.emg-contributions-table td {
	padding: 12px 10px;
	color: #555;
	vertical-align: top;
}

.emg-contributions-table tbody tr:last-child {
	border-bottom: none;
}

/* Hid the default edit price link on cart and checkout for nyp line items */
a.wc-block-cart-item__edit-link {
	display: none !important;
}

/* Responsive Modal */
@media (max-width: 768px) {
	.emg-modal {
		width: 95%;
		max-height: 95vh;
	}

	.emg-modal-header {
		padding: 15px 20px;
	}

	.emg-modal-header h2 {
		font-size: 20px;
	}

	.emg-modal-body {
		padding: 20px;
	}

	.emg-contributions-table {
		font-size: 12px;
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.emg-contributions-table th,
	.emg-contributions-table td {
		padding: 8px 6px;
	}
}

/* ========================================
   Campaign Display
   ======================================== */

/* Campaign Display */
.emg-campaign-container {
	margin: 30px 0;
	padding: 0;
}

.emg-campaign {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 30px;
	margin-bottom: 30px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.emg-campaign-title {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 20px;
	color: #333;
}

.emg-campaign-description {
	font-size: 16px;
	line-height: 1.6;
	color: #555;
	margin-bottom: 25px;
}

/* Progress Bar */
.emg-progress-container {
	margin: 25px 0;
}

.emg-progress-bar {
	width: 100%;
	height: 30px;
	background: #f0f0f0;
	border-radius: 15px;
	overflow: hidden;
	position: relative;
}

.emg-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #2271b1 0%, #1557a0 100%);
	border-radius: 15px;
	transition: width 0.5s ease;
	position: relative;
}

.emg-progress-text {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Campaign Stats */
.emg-campaign-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 20px;
	margin: 25px 0;
}

.emg-stat-item {
	text-align: center;
	padding: 15px;
	background: #f9f9f9;
	border-radius: 6px;
}

.emg-stat-item .value {
	font-size: 24px;
	font-weight: 700;
	color: #2271b1;
	display: block;
	margin-bottom: 5px;
}

.emg-stat-item .label {
	font-size: 12px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Donation Form */
.emg-donation-form {
	background: #f9f9f9;
	padding: 25px;
	border-radius: 8px;
	margin: 25px 0;
}

.emg-form-group {
	margin-bottom: 20px;
}

.emg-form-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}

.emg-form-group input[type="text"],
.emg-form-group input[type="number"],
.emg-form-group input[type="email"],
.emg-form-group select,
.emg-form-group textarea {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.3s ease;
}

.emg-form-group input:focus,
.emg-form-group select:focus,
.emg-form-group textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

/* Donation Amount Buttons */
.emg-amount-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 10px;
	margin-bottom: 15px;
}

.emg-amount-btn {
	padding: 15px;
	background: #fff;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
}

.emg-amount-btn:hover {
	border-color: #2271b1;
	background: #f0f6fc;
}

.emg-amount-btn.active {
	border-color: #2271b1;
	background: #2271b1;
	color: #fff;
}

/* Submit Button */
.emg-submit-btn {
	width: 100%;
	padding: 15px 30px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.3s ease;
}

.emg-submit-btn:hover {
	background: #135e96;
}

.emg-submit-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* Campaign List */
.emg-campaigns-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
	margin: 30px 0;
}

.emg-campaign-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.emg-campaign-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.emg-campaign-card-content {
	padding: 20px;
}

.emg-campaign-card-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 15px;
}

.emg-campaign-card-excerpt {
	font-size: 14px;
	color: #666;
	margin-bottom: 15px;
	line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
	.emg-campaign {
		padding: 20px;
	}

	.emg-campaign-title {
		font-size: 24px;
	}

	.emg-campaign-stats {
		grid-template-columns: 1fr;
	}

	.emg-campaigns-grid {
		grid-template-columns: 1fr;
	}

	.emg-amount-options {
		grid-template-columns: repeat(2, 1fr);
	}
}
