/* ==========================================================================
   KADAPLAMATTOM COMMUNITY CARE BANK & ITEM DONATION PORTAL STYLES
   ========================================================================== */

/* Page Hero */
.donate-hero-section {
  background: linear-gradient(135deg, #0a3d24 0%, #0d5c36 50%, #15803d 100%);
  color: #ffffff;
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.donate-hero-section::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.donate-hero-section::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
}

.donate-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.25rem;
}

.donate-breadcrumb a {
  color: #f6e27a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.donate-breadcrumb a:hover {
  color: #ffffff;
}

.donate-hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.donate-hero-subtitle {
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 820px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Donor Highlights Banner */
.donate-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.donate-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.donate-badge-pill i {
  color: #f6e27a;
}

/* Hero Action Buttons */
.donate-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.btn-donate-gold {
  background: linear-gradient(135deg, #d4af37 0%, #f6e27a 50%, #cb9b2b 100%);
  color: #06341f;
  font-weight: 800;
  padding: 0.9rem 1.7rem;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-donate-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
}

.btn-donate-outline {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-weight: 600;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-donate-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  color: #ffffff;
}

/* 3-Step Explainer Ribbon */
.carebank-ribbon {
  background: #ffffff;
  border-bottom: 1px solid rgba(10, 77, 46, 0.1);
  padding: 1.35rem 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.carebank-ribbon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: center;
}

.carebank-step {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.cb-step-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: #e8f4ed;
  color: #0a4d2e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.cb-step-text h5 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #192a20;
  margin-bottom: 0.15rem;
}

.cb-step-text p {
  font-size: 0.82rem;
  color: #57685d;
  line-height: 1.45;
}

/* Item Card Grid */
.donation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.item-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(10, 77, 46, 0.12);
  box-shadow: 0 4px 16px rgba(10, 77, 46, 0.05);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(10, 77, 46, 0.12);
  border-color: rgba(10, 77, 46, 0.25);
}

.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.item-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #e8f4ed;
  color: #0a4d2e;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.condition-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.condition-pill.new {
  background: #dcfce7;
  color: #15803d;
}

.condition-pill.like_new {
  background: #e0f2fe;
  color: #0369a1;
}

.condition-pill.gently_used {
  background: #fef3c7;
  color: #b45309;
}

.condition-pill.usable {
  background: #f3f4f6;
  color: #4b5563;
}

.item-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #192a20;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.item-code-line {
  font-size: 0.75rem;
  color: #57685d;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.item-card-desc {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

/* Donor metadata card */
.donor-meta-box {
  background: #f8faf9;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(10, 77, 46, 0.08);
  margin-bottom: 1.25rem;
  font-size: 0.84rem;
  color: #374151;
}

.donor-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.donor-meta-line:last-child {
  margin-bottom: 0;
}

.donor-meta-line i {
  color: #0a4d2e;
  width: 16px;
}

.btn-request-item {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #0a4d2e;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-request-item:hover {
  background: #137547;
  box-shadow: 0 4px 14px rgba(10, 77, 46, 0.25);
}

.btn-item-pledged {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: not-allowed;
}

/* ==========================================================================
   ITEM PHOTO DISPLAY & UPLOAD DROPZONE STYLES
   ========================================================================== */

/* Item Card Photo */
.item-card-photo-wrap {
  position: relative;
  width: 100%;
  height: 185px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #f0f4f2;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(10, 77, 46, 0.08);
}

.item-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.item-card-photo-wrap:hover .item-card-img {
  transform: scale(1.05);
}

.photo-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  background: rgba(10, 77, 46, 0.88);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.photo-zoom-icon {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.item-card-photo-wrap:hover .photo-zoom-icon {
  opacity: 1;
  transform: scale(1.05);
}

.item-card-placeholder-wrap {
  display: none;
}

/* Donor Modal Photo Dropzone */
.photo-dropzone {
  border: 2px dashed #b5cebf;
  background: #fbfdfc;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.photo-dropzone:hover,
.photo-dropzone.dragover {
  border-color: #0a4d2e;
  background: #f0f7f3;
}

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.photo-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8f4ed;
  color: #0a4d2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: transform 0.25s ease;
}

.photo-dropzone:hover .photo-icon-circle {
  transform: translateY(-2px);
}

.photo-prompt-text strong {
  display: block;
  font-size: 0.95rem;
  color: #0a4d2e;
  margin-bottom: 0.2rem;
}

.photo-prompt-text p {
  font-size: 0.78rem;
  color: #57685d;
  margin: 0;
  line-height: 1.4;
}

.dropzone-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.dropzone-preview img {
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #d1d5db;
}

.preview-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.photo-name {
  font-size: 0.8rem;
  color: #374151;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.btn-remove-photo {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.2s;
}

.btn-remove-photo:hover {
  background: #fecaca;
}

/* Photo Lightbox Modal */
.photo-lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.photo-lightbox-modal.active {
  display: flex;
}

.photo-lightbox-box {
  position: relative;
  max-width: 780px;
  width: 100%;
  text-align: center;
  animation: modalPop 0.25s ease;
}

.photo-lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.photo-lightbox-title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1rem;
}

.photo-lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.photo-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
  .donate-hero-section {
    padding: 2.25rem 0 3.5rem !important;
    text-align: center;
  }

  .donate-breadcrumb {
    justify-content: center;
  }

  .donate-pills-bar {
    justify-content: center;
    gap: 0.5rem !important;
  }

  .donate-badge-pill {
    font-size: 0.78rem !important;
    padding: 0.35rem 0.75rem !important;
  }

  .donate-hero-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }

  .donate-hero-subtitle {
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
    margin: 0 auto 1.5rem !important;
  }

  /* Full-width Stack for Hero Action Buttons on Mobile */
  .donate-hero-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .btn-donate-gold,
  .btn-donate-outline {
    width: 100% !important;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    white-space: normal !important;
    text-align: center !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .carebank-ribbon {
    padding: 1rem 0 !important;
  }

  .carebank-ribbon-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .carebank-step {
    padding: 0.65rem 0.85rem !important;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(10, 77, 46, 0.08);
  }

  .service-filter-wrapper {
    padding: 1rem !important;
    margin: -1.5rem 0 1.75rem !important;
    border-radius: 14px !important;
  }

  .filter-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }

  .search-input-group,
  .locality-select-group {
    width: 100% !important;
    flex: none !important;
  }

  .filter-row .btn-outline {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Horizontal touch scrolling for category pills */
  .category-pills-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    scrollbar-width: none !important;
  }

  .category-pills-bar::-webkit-scrollbar {
    display: none !important;
  }

  .category-pill {
    flex-shrink: 0 !important;
    font-size: 0.82rem !important;
    padding: 0.5rem 0.85rem !important;
  }

  /* Donation Grid */
  .donation-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .item-card {
    padding: 1.25rem !important;
  }

  /* Modals Mobile Fixes */
  .modal-overlay {
    padding: 0.5rem !important;
    align-items: flex-start !important;
    overflow-y: auto !important;
  }

  .modal-box {
    width: 96% !important;
    max-width: 96% !important;
    margin: 1rem auto !important;
    max-height: calc(100vh - 2rem) !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .modal-header-hub {
    padding: 0.9rem 1.15rem !important;
    flex-shrink: 0 !important;
  }

  .modal-header-hub h3 {
    font-size: 1.15rem !important;
  }

  .modal-header-hub p {
    font-size: 0.78rem !important;
  }

  .modal-body-hub {
    padding: 1.15rem !important;
    max-height: calc(100vh - 7rem) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-body-hub form>div[style*="grid-template-columns"],
  .modal-body-hub div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .admin-table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@media (max-width: 420px) {
  .donate-hero-actions {
    grid-template-columns: 1fr !important;
  }
}