/**
 * ====================================
 *    Shared Donations Card Styles
 *    (Used by both Grid and Slider)
 * ====================================
 *
 * @format
 */

/* Donation Card */
.donation-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #70023d;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.donation-card > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.donation-card:hover {
  border-color: #cccccc;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Donation Image */
.donation-image {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  margin: 0 !important;
  padding: 0 !important;
  top: 0;
  flex-shrink: 0;
  border-radius: 10px 10px 0 0;
}

.donation-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  border: none;
  position: relative;
  top: 0;
  left: 0;
  border-radius: 10px 10px 0 0;
}

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

/* Category Badge */
.donation-image .category-badge {
  position: absolute;
  bottom: 10px;
  left: 15px;
  background: #70023d;
  color: #ffffff;
  padding: 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s ease, transform 0.2s ease;
}

.donation-image a.category-badge:hover {
  background: #550230;
  color: #ffffff;
  transform: scale(1.05);
  text-decoration: none;
}

.donation-image a.category-badge:focus {
  outline: 2px solid rgba(112, 2, 61, 0.5);
  outline-offset: 2px;
}

/* Donation Content */
.donation-content {
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin: 0 !important;
}

/* Title */
.donation-title {
  font-size: 22px;
  font-weight: 700;
  color: #2d2d2d;
  margin: 5px 0 10px 0 !important;
  line-height: 1.3;
  min-height: auto;
}

.donation-title a {
  color: #2d2d2d !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}

.donation-title a:hover {
  color: #70023d !important;
  text-decoration: none;
}

.entry-content .donation-title,
.entry-content .donations-grid h3.donation-title,
.entry-content .donations-slider-wrapper h3.donation-title {
  margin-top: 5px !important;
}

/* Excerpt */
.donation-excerpt {
  color: #666666;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

/* Donate Button */
.donate-button {
  display: block;
  width: 100%;
  background: #70023d;
  color: #ffffff !important;
  text-align: center;
  padding: 14px 20px;
  border-radius: 8px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-top: auto;
  margin-bottom: 18px;
  border: none;
  cursor: pointer;
}

.donate-button:hover {
  background: #550230;
  transform: translateY(-2px);
}

.donate-button:active {
  transform: translateY(0);
}

.donate-button:focus {
  outline: 3px solid rgba(139, 21, 56, 0.3);
  outline-offset: 2px;
}

/* Progress Bar Wrapper */
.progress-bar-wrapper {
  position: relative;
  margin-bottom: 12px;
  margin-top: 15px;
}

/* Progress Percentage Label */
.progress-percentage-label {
  position: absolute;
  top: -30px;
  left: 0;
  font-size: 16px;
  font-weight: 700;
  color: #70023d;
  transition: left 0.8s ease;
  z-index: 10;
  transform: translateX(-100%);
  white-space: nowrap;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 10px;
  overflow: visible;
  position: relative;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, #70023d 0%, #70023d 50%, #70023d 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  position: relative;
  width: 0;
}

.donation-card.in-viewport .progress {
  animation: progressFill 1.5s ease-out forwards,
    progressShimmer 2s ease-in-out infinite;
}

@keyframes progressFill {
  from {
    width: 0;
  }
  to {
    width: var(--progress-width, 0%);
  }
}

@keyframes progressShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Progress Stats */
.progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 14px;
}

.amount-raised,
.goal-amount {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.amount-raised {
  align-items: flex-start;
}

.goal-amount {
  align-items: flex-end;
  text-align: right;
}

.amount-raised .amount-display {
  font-size: 15px;
  font-weight: 700;
  color: #2d2d2d;
  line-height: 1.3;
}

.goal-amount .amount-display {
  font-size: 15px;
  font-weight: 700;
  color: #666666;
  line-height: 1.3;
}

.amount-raised .label-display,
.goal-amount .label-display {
  font-size: 10px;
  color: #999999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .donation-image {
    height: 220px;
  }

  .donation-content {
    padding: 18px;
  }

  .progress-percentage-label {
    font-size: 14px;
    top: -22px;
  }
}

@media (max-width: 480px) {
  .donation-image {
    height: 180px;
  }

  .donation-content {
    padding: 15px;
  }

  .donate-button {
    padding: 12px 18px;
    font-size: 13px;
  }

  .progress-percentage-label {
    font-size: 12px;
    top: -20px;
  }
}

/* Print Styles */
@media print {
  .donation-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .donate-button {
    background: #70023d;
    color: #ffffff;
  }
}
