/* Custom Properties */
:root {
  --color-primary: #006b5f;
  --color-secondary: #008476;
  --color-accent: #00a190;
  --color-light: #e0f2f1;
  --color-lighter: #f1f8f7;
  --color-dark: #004d45;
  --transition-speed: 0.3s;
}

.text-primary {
  color: var(--color-primary) !important;
}

/* ปรับทุก element ที่ใช้ text-primary */
.gift-icon.text-primary {
  color: var(--color-primary) !important;
}

.info-icon.text-primary {
  color: var(--color-primary) !important;
}

/* ถ้ามี link ที่ใช้ text-primary */
a.text-primary {
  color: var(--color-primary) !important;
}

a.text-primary:hover {
  color: var(--color-dark) !important;
}
/* General Styles */
body {
  font-family: "Sarabun", sans-serif;
  overflow-x: hidden;
}

/* Layout */
.section-padding {
  padding: 100px 0;
}

/* Navbar */
.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: all var(--transition-speed) ease;
}

.navbar.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
  height: 50px;
  transition: height var(--transition-speed) ease;
}

.navbar.scrolled .navbar-brand img {
  height: 40px;
}

/* Hero Section */
.hero {
  position: relative;
  background: url("https://www.pharmacy.su.ac.th/donation/images/01.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  height: 85vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  margin-top: 76px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(0 67 60 / 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Section Header */
.section-tag {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-primary);
  color: white;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 14px;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 0;
  padding-bottom: 120%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
}

.btn:active::after {
  transform: translate(-50%, -50%) scale(1);
}

.btn-primary {
  background-color: var(--color-primary);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 107, 95, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 107, 95, 0.3);
}

.btn-light {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  border: none;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-light:hover {
  background: white;
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.btn-outline-primary {
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  background-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 107, 95, 0.1);
}

.btn-outline-primary:hover {
  color: white;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 107, 95, 0.2);
}

/* Gift Card Styles */

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

/* Card and Image Container */
/* .gift-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: white;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-speed) ease;
} */

.gift-card {
  background: white;
  border-radius: 20px;
  padding: 0.5rem;
  position: relative;
  height: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.gift-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Image Container */
.gift-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* สัดส่วน 3:2 (2/3 = 66.67%) */
  overflow: hidden;
  background-color: var(--color-lighter);
}

/* Image Styling */
.gift-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1; /* ให้รูปอยู่ด้านบนของ loading effect */
  transition: transform 0.5s ease;
}

/* Loading Effect */
.gift-image-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 0; /* ให้ loading effect อยู่ด้านล่างของรูป */
}

/* Remove opacity transitions */
.gift-image-wrapper img {
  opacity: 1 !important;
}

/* Tags */
.recommend-tag {
  position: absolute;
  background-color: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  font-weight: 500;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-speed) ease;
}

.price-tag {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background-color: rgba(0, 107, 95, 0.9);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.gift-card:hover .price-tag {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Card Content */
.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.gift-description {
  font-size: 1.35rem;
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

/* Gift List */
.gift-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  flex-grow: 1;
}

.gift-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  background-color: var(--color-lighter);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.gift-item:hover {
  background-color: var(--color-light);
  transform: translateX(5px);
}

.gift-icon {
  color: var(--color-primary);
  width: 20px;
  height: 20px;
  margin-right: 12px;
  flex-shrink: 0;
}

/* Donate Button */
.donate-btn {
  width: 100%;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  transition: all var(--transition-speed) ease;
}

.donate-btn:hover {
  background-color: var(--color-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 107, 95, 0.2);
}

/* Modal Styles */
.modal-content {
  border-radius: 15px;
  border: none;
  overflow: hidden;
}

.modal-header {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 1.5rem;
}

.modal .btn-close {
  filter: brightness(0) invert(1);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: none;
  padding: 1.5rem;
}

.modal .btn.copy-btn {
  transition: all 0.2s ease;
}

.modal .btn.copy-btn:hover {
  transform: translateY(-1px);
}

.modal .btn.copy-btn.copied {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.modal-backdrop {
  background-color: var(--color-dark);
}

.modal-backdrop.show {
  opacity: 0.7;
}

.bank-info {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Project Cards */
.project-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  transition: all var(--transition-speed) ease;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-card img {
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

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

.project-card .card-body {
  padding: 2rem;
}

/* Donation Methods */
.donation-method {
  background: white;
  border-radius: 15px;
  padding: 2.5rem;
  height: 100%;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.donation-method::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform var(--transition-speed) ease;
}

.donation-method:hover::before {
  transform: scaleX(1);
}

.donation-method:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.donation-method i {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

/* Swiper Styles */
.swiper-container {
  width: 100%;
  height: auto;
  padding-bottom: 40px;
}

.swiper-slide {
  height: auto !important;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--color-primary);
  background-color: rgba(255, 255, 255, 0.9);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed) ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background-color: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 18px;
}

.swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
  opacity: 0.5;
  transition: all var(--transition-speed) ease;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.2);
}

/* Loading Animation */
.gift-image-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.gift-image-wrapper img[src] {
  opacity: 1;
}

.gift-image-wrapper img:not([src]) {
  opacity: 0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--color-lighter);
  border-bottom-color: var(--color-primary);
  border-radius: 50%;
  animation: rotation 1s linear infinite;
}

/* Footer */
.footer {
  background-color: var(--color-dark);
  color: white;
  padding: 4rem 0 2rem;
}

.footer h4 {
  color: var(--color-lighter);
  margin-bottom: 1.5rem;
}

.footer p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
}

.footer a {
  color: white;
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.footer a:hover {
  color: var(--color-lighter);
}

.footer .social-links {
  display: flex;
  gap: 1.5rem;
}

.footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all var(--transition-speed) ease;
}

.footer .social-links a:hover {
  background: var(--color-lighter);
  transform: translateY(-3px);
}

/* Info Section */
.info-section {
  margin-top: 4rem;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  padding: 1.5rem;
  background-color: var(--color-lighter);
  border-radius: 16px;
  transition: all var(--transition-speed) ease;
}

.info-item:hover {
  transform: translateY(-5px);
  background-color: var(--color-light);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.info-icon {
  color: var(--color-primary);
  width: 28px;
  height: 28px;
  margin-right: 1rem;
  flex-shrink: 0;
}

.info-content {
  flex: 1;
}

.info-text {
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

.info-description {
  color: #666;
  line-height: 1.5;
}

/* Gift Slider Navigation */
.gift-slider::after,
.gift-slider::before {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  width: 50px;
  pointer-events: none;
  z-index: 1;
}

.gift-slider::after {
  right: 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3));
}

.gift-slider::before {
  left: 0;
  background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.3));
}

/* Animations */
@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

/* Responsive Styles */
@media (max-width: 768px) {
  .section-padding {
    padding: 60px 0;
  }

  .hero {
    height: 60vh;
    min-height: 500px;
  }

  .navbar-brand img {
    height: 40px;
  }

  .donation-method {
    padding: 1.5rem;
  }

  .btn {
    margin: 0.5rem;
    display: block;
    width: auto;
  }

  .hero-content {
    margin: 1rem;
    padding: 1.5rem;
  }

  .gift-image-wrapper {
    height: 200px;
  }

  .price-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Gift Content */
  .gift-content {
    padding-top: 1rem;
  }

  .gift-title {
    font-size: 1.2rem;
  }

  .donate-btn {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-item {
    padding: 1.2rem;
  }
}

/* Tags Position Adjustment */
.price-tag {
  bottom: 1rem;
  right: 0;
  z-index: 2; /* ให้ tag อยู่ด้านบนสุด */
}

.recommend-tag {
  top: 1rem;
  left: 0;
  z-index: 2;
}

/* Content Spacing */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  padding-top: 1rem; /* ลดระยะห่างด้านบนลงเล็กน้อย */
}


/* Responsive Adjustments */
@media (max-width: 768px) {
  .gift-image-wrapper {
    padding-top: 75%; /* สัดส่วน 4:3 สำหรับมือถือ */
  }
}

@media (max-width: 576px) {
  .gift-image-wrapper {
    padding-top: 75%; /* กลับไปที่สัดส่วน 3:2 สำหรับมือถือขนาดเล็ก */
  }
}

@media (max-width: 991px) {
  .gift-slider::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
    z-index: 1;
  }

  .swiper-slide-visible:not(.swiper-slide-active) {
    opacity: 0.6;
    transition: opacity 0.3s ease;
  }
}

.swiper-pagination {
  position: relative;
  bottom: 0;
  margin-top: 1rem;
}

.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 4px;
}

.swiper-pagination-bullet-active {
  background-color: var(--color-primary);
}