/**
 * Fundraiser Styles
 *
 * Styles for fundraiser campaigns listing and cards.
 *
 * @package EM_Epic_HQ
 */

/* ==========================================================================
   Page Layout
   ========================================================================== */

.em-portal-fundraisers .em-portal-page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	flex-wrap: wrap;
	gap: 1rem;
}

.em-portal-fundraisers .em-portal-page-header h1 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: #1a1a1a;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.em-portal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.em-portal-btn:hover {
	text-decoration: none;
}

.em-portal-btn--primary {
	background: linear-gradient(135deg, #5BBCC6 0%, #4AA8B2 100%);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(91, 188, 198, 0.3);
}

.em-portal-btn--primary:hover {
	background: linear-gradient(135deg, #4AA8B2 0%, #3D99A3 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(91, 188, 198, 0.4);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.em-portal-section {
	margin-bottom: 2.5rem;
}

.em-portal-section__title {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
	color: #1a1a1a;
}

.em-portal-section__title--toggle {
	cursor: pointer;
	user-select: none;
}

.em-portal-section__title--toggle:hover {
	color: #5BB8C1;
}

.em-portal-section--collapsed .em-campaign-grid {
	display: none;
}

.em-toggle-icon {
	margin-left: auto;
	font-weight: 400;
	font-size: 1.25rem;
	line-height: 1;
	transition: transform 0.2s ease;
	color: #6b7280;
}

.em-portal-section:not(.em-portal-section--collapsed) .em-toggle-icon {
	transform: rotate(45deg);
}

/* Status dots */
.em-status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.em-status-dot--active {
	background: linear-gradient(135deg, #22c55e, #16a34a);
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.em-status-dot--draft {
	background: #9ca3af;
}

.em-status-dot--ended {
	background: #ef4444;
}

.em-status-dot--archived {
	background: #6b7280;
}

/* Count badge */
.em-count {
	background: #f3f4f6;
	color: #6b7280;
	font-size: 0.75rem;
	padding: 0.25rem 0.625rem;
	border-radius: 12px;
	font-weight: 500;
}

/* ==========================================================================
   Campaign Grid
   ========================================================================== */

.em-campaign-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.5rem;
}

/* ==========================================================================
   Campaign Card
   ========================================================================== */

.em-campaign-card {
	display: flex;
	flex-direction: column;
	background: #ffffff !important;
	background-color: #ffffff !important;
	border: 1px solid rgba(0, 0, 0, 0.08) !important;
	border-radius: 12px !important;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.em-campaign-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
	transform: translateY(-3px);
}

/* Card link */
.em-campaign-card__link {
	display: block;
	flex: 1;
	text-decoration: none;
	color: inherit;
}

.em-campaign-card__link:hover {
	text-decoration: none;
}

/* Card image */
.em-campaign-card__image {
	position: relative;
	height: 180px;
	min-height: 180px;
	background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
	overflow: hidden;
}

.em-campaign-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.em-campaign-card:hover .em-campaign-card__image img {
	transform: scale(1.05);
}

.em-campaign-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #9ca3af;
}

.em-campaign-card__placeholder svg {
	opacity: 0.5;
}

/* Status badge */
.em-campaign-card__status {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	padding: 0.375rem 0.875rem;
	border-radius: 6px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.em-campaign-card__status--active {
	background: linear-gradient(135deg, #22c55e, #16a34a);
	color: #fff;
}

.em-campaign-card__status--draft {
	background: #6b7280;
	color: #fff;
}

.em-campaign-card__status--ended {
	background: #ef4444;
	color: #fff;
}

.em-campaign-card__status--archived {
	background: #374151;
	color: #fff;
}

/* Card content */
.em-campaign-card__content {
	padding: 1.25rem;
	background: #ffffff;
}

.em-campaign-card__title {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 1rem;
	color: #1a1a1a;
	line-height: 1.3;
}

/* Progress section */
.em-campaign-card__progress {
	margin-bottom: 1rem;
}

.em-campaign-card__progress-bar {
	position: relative;
	height: 24px;
	background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
	border-radius: 12px;
	overflow: visible;
	margin-bottom: 0.625rem;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.em-campaign-card__progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #22c55e 0%, #34d399 50%, #22c55e 100%);
	background-size: 200% 100%;
	border-radius: 12px;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 0;
	box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
	animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

.em-campaign-card__progress-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.4) 50%,
		transparent 100%
	);
	animation: shimmer 2.5s infinite;
	border-radius: 12px;
}

@keyframes shimmer {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

/* Progress percentage label (inside fill) */
.em-campaign-card__progress-label {
	position: relative;
	z-index: 1;
	padding: 0 10px;
	font-size: 0.6875rem;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	white-space: nowrap;
}

/* Progress percentage label (outside fill - for low percentages) */
.em-campaign-card__progress-label--outside {
	position: absolute;
	left: calc(var(--progress, 0%) + 8px);
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.6875rem;
	font-weight: 700;
	color: #22c55e;
	white-space: nowrap;
}

.em-campaign-card__progress-text {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.875rem;
}

.em-campaign-card__raised {
	font-weight: 700;
	color: #22c55e;
	font-size: 1rem;
}

.em-campaign-card__goal {
	color: #6b7280;
	font-size: 0.8125rem;
}

/* Stats without goal */
.em-campaign-card__stats {
	margin-bottom: 1rem;
}

.em-campaign-card__stats .em-campaign-card__raised {
	font-size: 1.125rem;
}

/* Meta info */
.em-campaign-card__meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.8125rem;
	color: #6b7280;
	padding-top: 0.75rem;
	border-top: 1px solid #e5e7eb;
}

.em-campaign-card__items {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.em-campaign-card__items::before {
	content: '';
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'%3E%3C/path%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'%3E%3C/path%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	flex-shrink: 0;
}

.em-campaign-card__date {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-weight: 500;
}

.em-campaign-card__date::before {
	content: '';
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	flex-shrink: 0;
}

/* ==========================================================================
   Card Actions
   ========================================================================== */

.em-campaign-card__actions {
	display: flex;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-top: 1px solid #e5e7eb;
	background: linear-gradient(to bottom, #fafafa, #ffffff);
}

.em-campaign-card__actions .em-portal-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	font-size: 0.8125rem;
	font-weight: 600;
	border-radius: 8px;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
}

.em-portal-btn--primary,
.em-campaign-card__actions .em-portal-btn--primary {
	background: linear-gradient(135deg, #5BBCC6 0%, #4AA8B2 100%);
	color: #fff;
	box-shadow: 0 2px 6px rgba(91, 188, 198, 0.3);
}

.em-portal-btn--primary:hover,
.em-campaign-card__actions .em-portal-btn--primary:hover {
	background: linear-gradient(135deg, #4AA8B2 0%, #3D99A3 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(91, 188, 198, 0.4);
}

.em-portal-btn--outline,
.em-campaign-card__actions .em-portal-btn--outline {
	background: #fff;
	color: #5BBCC6;
	border: 2px solid #5BBCC6;
}

.em-portal-btn--outline:hover,
.em-campaign-card__actions .em-portal-btn--outline:hover {
	background: rgba(91, 188, 198, 0.08);
	border-color: #4AA8B2;
	color: #4AA8B2;
	transform: translateY(-1px);
}

.em-portal-btn--ghost,
.em-campaign-card__actions .em-portal-btn--ghost {
	background: transparent;
	color: #6b7280;
	border: 1px solid transparent;
}

.em-portal-btn--ghost:hover,
.em-campaign-card__actions .em-portal-btn--ghost:hover {
	background: #f3f4f6;
	color: #5BBCC6;
}

.em-portal-btn--sm,
.em-campaign-card__actions .em-portal-btn--sm {
	padding: 0.625rem 1rem;
	font-size: 0.8125rem;
}

/* "Copied!" success state */
.em-campaign-card__actions .em-portal-btn[style*="Copied"] {
	background: #22c55e !important;
	color: #fff !important;
	border-color: #22c55e !important;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.em-portal-empty {
	text-align: center;
	padding: 4rem 2rem;
	background: #fff;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.em-portal-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	background: #f3f4f6;
	border-radius: 50%;
	color: #9ca3af;
	margin-bottom: 1.5rem;
}

.em-portal-empty__icon svg {
	opacity: 0.6;
}

.em-portal-empty h3 {
	margin: 0 0 0.625rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: #1a1a1a;
}

.em-portal-empty p {
	color: #6b7280;
	margin-bottom: 1.5rem;
	max-width: 400px;
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
	.em-campaign-grid {
		grid-template-columns: 1fr;
	}

	.em-campaign-card__actions {
		flex-direction: column;
	}

	.em-portal-fundraisers .em-portal-page-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
