/* ==========================================================================
   BORNO APC 2027 CAMPAIGN - COMPONENTS STYLESHEET
   Modals, Toasts, Lightbox, Badges, Tabs & Micro-Interactions
   ========================================================================== */

/* ==========================================================================
   Modal Backdrop & Containers
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 47, 73, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  min-width: 0;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-normal);
  position: relative;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.75rem 2rem 1.25rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  min-width: 0;
}

.modal-close-btn {
  background: var(--bg-slate-100);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-slate-600);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--apc-red-light);
  color: var(--apc-red);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1.25rem 2rem;
  background: var(--bg-slate-50);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

/* ==========================================================================
   Donation / Support Tier Component
   ========================================================================== */

.donation-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.tier-btn {
  padding: 1rem 0.5rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-slate-50);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  min-width: 0;
  overflow-wrap: break-word;
}

.tier-btn:hover {
  border-color: var(--apc-blue);
  background: var(--apc-blue-subtle);
  color: var(--apc-blue);
}

.tier-btn.selected {
  border-color: var(--apc-blue);
  background: var(--apc-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.support-types-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.support-type-btn {
  flex: 1;
  min-width: 0;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.support-type-btn.active {
  background: var(--apc-green-subtle);
  border-color: var(--apc-green);
  color: var(--apc-green-dark);
}

/* ==========================================================================
   Toast Notification Component
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xl);
  border-left: 5px solid var(--apc-green);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transform: translateX(120%);
  transition: transform var(--transition-smooth);
}

.toast-body {
  min-width: 0;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  border-left-color: var(--apc-red);
}

.toast.info {
  border-left-color: var(--apc-blue);
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--apc-green-light);
  color: var(--apc-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.toast.error .toast-icon {
  background: var(--apc-red-light);
  color: var(--apc-red);
}

.toast-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
}

.toast-body p {
  font-size: 0.85rem;
  color: var(--text-slate-600);
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   Lightbox Gallery Viewer
   ========================================================================== */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 2rem;
}

.lightbox-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  text-align: center;
  font-family: var(--font-heading);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: var(--apc-red);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox-nav:hover {
  background: var(--apc-blue);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

/* ==========================================================================
   Floating Action CTA (Quick Volunteer/PVC)
   ========================================================================== */

.floating-action-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--apc-blue);
  color: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.4);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid #ffffff;
}

.floating-action-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 136, 204, 0.5);
  background: var(--apc-blue-hover);
}

.floating-action-btn .pulse-dot {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (max-width: 768px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0.75rem;
  }

  .modal-card,
  .modal-card[style] {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 1.15rem 1.25rem 1rem;
  }

  .modal-title {
    font-size: 1.1rem;
    padding-right: 0.75rem;
  }

  .modal-body {
    padding: 1.25rem;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 1rem 1.25rem;
  }

  .donation-tiers {
    grid-template-columns: 1fr;
  }

  .support-types-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .lightbox-backdrop {
    padding: 1rem;
  }

  .lightbox-content {
    max-width: 100%;
    max-height: 88dvh;
  }

  .lightbox-img {
    max-height: 68dvh;
  }

  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
    width: 42px;
    height: 42px;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }

  .lightbox-caption {
    padding: 0 3.25rem;
    font-size: 0.9rem;
  }

  .floating-action-btn {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    justify-content: center;
    padding: 0.85rem 1rem;
    max-width: calc(100vw - 2rem);
  }
}

@media (max-width: 480px) {
  .modal-backdrop {
    padding: 0.5rem;
  }

  .modal-card,
  .modal-card[style] {
    border-radius: var(--radius-md);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .tier-btn {
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  .modal-header {
    gap: 0.75rem;
  }

  .modal-close-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .toast {
    padding: 1rem;
  }

  .lightbox-caption {
    padding: 0 2.75rem;
  }
}
