/* Main Activity Section Styles */
.activity-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.activity-header {
  text-align: center;
  margin-bottom: 30px;
}

.activity-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.activity-header p {
  font-size: 1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
}

/* Search Container */
.search-container {
  max-width: 600px;
  margin: 0 auto 30px;
}

.search-details {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.search-details i {
  color: #888;
  margin-right: 10px;
}

.search-details input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #333;
  text-align: left;
  padding-left: 46px;
}

.search-details .fa-search {
  position: absolute;
  left: 35px;
  color: #8bb8df;
  pointer-events: none;
  font-size: 14px;
}

/* Activities Grid */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.activity-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.activity-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.activity-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
}

.activity-image:hover {
  opacity: 0.9;
}

.activity-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.activity-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.activity-description {
  color: #666;
  margin-bottom: 15px;
  flex-grow: 1;
}

.activity-meta {
  margin-top: auto;
}

.activity-amount {
  font-weight: 600;
  color: #2c7a7b;
  margin-bottom: 5px;
}

.activity-date {
  font-size: 0.875rem;
  color: #888;
}

/* Lightbox Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  position: relative;
  background-color: transparent;
  margin: auto;
  padding: 0;
  width: 90%;
  max-width: 1200px;
}

.close {
  color: white;
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 35px;
  font-weight: bold;
  z-index: 1010;
}

.close:hover,
.close:focus {
  color: #999;
  text-decoration: none;
  cursor: pointer;
}

.mySlides {
  display: none;
  text-align: center;
}

.mySlides img {
  max-height: 70vh;
  max-width: 100%;
  object-fit: contain;
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
  background-color: rgba(0, 0, 0, 0.3);
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

.caption-container {
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px 16px;
  color: white;
  margin-top: 10px;
  border-radius: 4px;
}

.thumbnails-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.thumbnail {
  width: 100px;
  height: 70px;
  object-fit: cover;
  opacity: 0.6;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.3s;
}

.active,
.thumbnail:hover {
  opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .activities-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .modal-content {
    width: 95%;
  }

  .thumbnail {
    width: 80px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .activities-grid {
    grid-template-columns: 1fr;
  }

  .activity-header h1 {
    font-size: 1.75rem;
  }

  .prev,
  .next {
    padding: 10px;
  }
}

/* ========================================= */
/* ปรับปรุงพื้นหลังให้มีความน่าสนใจมากขึ้น */
body {
  background: white;
  background-attachment: fixed;
  position: relative;
}

/* ปรับปรุงส่วนหลักให้ดูมีมิติและน่าสนใจ */
.activity-section {
  position: relative;
  background-color: #e1f1ff;
  backdrop-filter: blur(15px);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.02);
  padding: 40px;
  margin-top: 30px;
  margin-bottom: 50px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.activity-section::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: linear-gradient(
    135deg,
    rgba(139, 184, 223, 0.3),
    rgba(74, 137, 220, 0.2)
  );
  border-radius: 50%;
  z-index: -1;
}

.activity-section::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: linear-gradient(
    135deg,
    rgba(74, 137, 220, 0.2),
    rgba(139, 184, 223, 0.1)
  );
  border-radius: 50%;
  z-index: -1;
}

/* ปรับปรุงส่วนหัวให้ดูมีสไตล์และโดดเด่น */
.activity-header {
  position: relative;
  padding-bottom: 30px;
  margin-bottom: 50px;
  text-align: center;
}

.activity-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(45deg, #1a365d, #4a89dc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.activity-header h1::before,
.activity-header h1::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 4px;
  background: linear-gradient(to right, #8bb8df, #4a89dc);
  top: 50%;
  transform: translateY(-50%);
  border-radius: 4px;
}

.activity-header h1::before {
  left: -45px;
}

.activity-header h1::after {
  right: -45px;
}

.activity-header p {
  font-size: 1.1rem;
  color: #4a5568;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ปรับปรุงกริดให้ดูมีระยะห่างที่สวยงาม */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 35px;
  padding: 15px 5px;
  position: relative;
}

/* ปรับปรุงการ์ดกิจกรรมให้ดูหรูหราและน่าสนใจ */
.activity-card {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06), 0 8px 15px rgba(0, 0, 0, 0.03);
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  text-decoration: none;
  background: white;
  position: relative;
  height: 100%;
  transform-origin: center bottom;
}

.activity-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 15px 20px rgba(0, 0, 0, 0.08);
}

.activity-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 70%,
    rgba(255, 255, 255, 1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.activity-card:hover::before {
  opacity: 0.1;
}

/* เพิ่มเอฟเฟกต์ให้รูปภาพแบบมืออาชีพ */
.activity-image {
  transition: all 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 250px;
  position: relative;
  overflow: hidden;
}

.activity-card:hover .activity-image {
  transform: scale(1.1);
}

.activity-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
  opacity: 0.8;
  transition: opacity 0.4s ease;
}

.activity-card:hover .activity-image::after {
  opacity: 0.5;
}

/* ปรับปรุงส่วนเนื้อหาในการ์ด */
.activity-content {
  padding: 30px;
  border-top: none;
  display: flex;
  flex-direction: column;
  height: calc(100% - 250px);
  position: relative;
  z-index: 2;
}

.activity-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 16px;
  line-height: 1.4;
  position: relative;
  padding-bottom: 15px;
}

.activity-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, #8bb8df, #4a89dc);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.activity-card:hover .activity-title::after {
  width: 80px;
}

.activity-description {
  color: #4a5568;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 25px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* ปรับปรุงแท็กประเภทกิจกรรม */
.activity-type {
  display: inline-block;
  background: linear-gradient(135deg, #e6f7ff, #d1e9ff);
  color: #0072b1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 30px;
  margin-bottom: 16px;
  box-shadow: 0 4px 8px rgba(0, 114, 177, 0.15);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.activity-type::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #d1e9ff, #e6f7ff);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.activity-card:hover .activity-type::before {
  opacity: 1;
}

/* ปรับปรุงส่วนข้อมูลเพิ่มเติม */
.activity-meta {
  padding-top: 20px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  margin-top: auto;
}

.activity-amount {
  font-weight: 700;
  color: #2c7a7b;
  margin-bottom: 12px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.activity-card:hover .activity-amount {
  transform: translateX(5px);
}

.activity-card:hover .activity-amount::before {
  background: rgba(44, 122, 123, 0.2);
}

.activity-date {
  font-size: 0.9rem;
  color: #718096;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.activity-card:hover .activity-date {
  transform: translateX(5px);
}

.activity-card:hover .activity-date::before {
  background: rgba(113, 128, 150, 0.2);
}

/* เพิ่มเอฟเฟกต์ hover ที่น่าสนใจ */
.activity-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(to right, #8bb8df, #4a89dc);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.activity-card:hover::after {
  transform: scaleX(1);
}

/* เพิ่มเอฟเฟกต์เมื่อไม่มีข้อมูล */
.no-activities {
  text-align: center;
  padding: 60px 40px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
  margin: 50px auto;
  max-width: 700px;
  position: relative;
  overflow: hidden;
}

.no-activities::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 150px;
  height: 150px;
  background: linear-gradient(
    135deg,
    rgba(139, 184, 223, 0.2),
    rgba(74, 137, 220, 0.1)
  );
  border-radius: 50%;
  z-index: 0;
}

.no-activities i {
  font-size: 5rem;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #8bb8df, #4a89dc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.no-activities p {
  color: #4a5568;
  font-size: 1.3rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* เพิ่มเอฟเฟกต์การโหลดที่สวยงาม */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.loading-card {
  height: 450px;
  background: #f6f7f8;
  background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%);
  background-size: 2000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.loading-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
  100% {
    transform: translateX(100%);
  }
}

/* เพิ่มเอฟเฟกต์เมื่อมีการเลื่อนหน้า */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activity-card {
  animation: fadeInUp 0.6s ease backwards;
}

.activities-grid .activity-card:nth-child(1) {
  animation-delay: 0.1s;
}

.activities-grid .activity-card:nth-child(2) {
  animation-delay: 0.2s;
}

.activities-grid .activity-card:nth-child(3) {
  animation-delay: 0.3s;
}

.activities-grid .activity-card:nth-child(4) {
  animation-delay: 0.4s;
}

.activities-grid .activity-card:nth-child(5) {
  animation-delay: 0.5s;
}

.activities-grid .activity-card:nth-child(6) {
  animation-delay: 0.6s;
}

/* เพิ่มเอฟเฟกต์ scroll-to-top */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #8bb8df, #4a89dc);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(74, 137, 220, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 100;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(74, 137, 220, 0.4);
}

.scroll-top i {
  font-size: 1.2rem;
}

/* ปรับปรุง responsive design */
@media (max-width: 992px) {
  .activity-section {
    padding: 30px 25px;
  }

  .activity-header h1 {
    font-size: 2.2rem;
  }

  .activity-header h1::before,
  .activity-header h1::after {
    width: 25px;
  }

  .activity-header h1::before {
    left: -35px;
  }

  .activity-header h1::after {
    right: -35px;
  }

  .activities-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .activity-section {
    padding: 25px 20px;
    margin-top: 20px;
    margin-bottom: 30px;
  }

  .activity-header h1 {
    font-size: 2rem;
  }

  .activity-header h1::before,
  .activity-header h1::after {
    display: none;
  }

  .activity-header p {
    font-size: 1rem;
  }

  .activities-grid {
    gap: 20px;
  }

  .activity-image {
    height: 220px;
  }

  .activity-content {
    padding: 25px;
    height: calc(100% - 220px);
  }

  .activity-title {
    font-size: 1.3rem;
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .activity-section {
    padding: 20px 15px;
  }

  .activity-header h1 {
    font-size: 1.8rem;
  }

  .activity-card:hover {
    transform: translateY(-10px);
  }

  .activity-content {
    padding: 20px;
  }

  .activity-title {
    font-size: 1.2rem;
    padding-bottom: 12px;
  }

  .activity-description {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .activity-type {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .activity-amount,
  .activity-date {
    font-size: 0.9rem;
  }

  .activity-amount::before,
  .activity-date::before {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .scroll-top {
    width: 40px;
    height: 40px;
    bottom: 15px;
    right: 15px;
  }
}

/* ==================================================================================================== */

/* เพิ่มส่วนนี้ต่อจาก CSS เดิม */

/* Pagination Styles */
.pagination-container {
  margin-top: 20px;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pagination-info {
  color: #4a5568;
  font-size: 0.95rem;
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  color: #4a5568;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 120px;
  justify-content: center;
}

.pagination-btn:hover:not(.disabled) {
  background: linear-gradient(135deg, #8bb8df, #4a89dc);
  color: white;
  border-color: #4a89dc;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 137, 220, 0.3);
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f7fafc;
  color: #a0aec0;
}

.pagination-btn i {
  font-size: 0.8rem;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  width: 45px;
  height: 45px;
  border: 2px solid #e2e8f0;
  background: white;
  color: #4a5568;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  background: #f7fafc;
  border-color: #8bb8df;
  color: #4a89dc;
  transform: translateY(-1px);
}

.page-btn.active {
  background: linear-gradient(135deg, #8bb8df, #4a89dc);
  border-color: #4a89dc;
  color: white;
  box-shadow: 0 4px 12px rgba(74, 137, 220, 0.3);
}

.page-dots {
  color: #a0aec0;
  font-weight: bold;
  padding: 0 5px;
  display: flex;
  align-items: center;
}

/* Loading Styles */
.loading-container {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  margin: 30px 0;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a89dc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-container p {
  color: #4a5568;
  font-size: 1.1rem;
  margin: 0;
  font-weight: 500;
}

/* Enhanced No Activities Styles */
.no-activities {
  text-align: center;
  padding: 80px 40px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
  margin: 50px auto;
  max-width: 600px;
  position: relative;
  overflow: hidden;
}

.no-activities::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: linear-gradient(
    135deg,
    rgba(139, 184, 223, 0.1),
    rgba(74, 137, 220, 0.05)
  );
  border-radius: 50%;
  z-index: 0;
}

.no-activities i {
  font-size: 4rem;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #8bb8df, #4a89dc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.no-activities p {
  color: #4a5568;
  font-size: 1.2rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  margin: 0;
}

/* Pagination Animation Effects */
.pagination-btn,
.page-btn {
  position: relative;
  overflow: hidden;
}

.pagination-btn::before,
.page-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.pagination-btn:hover::before,
.page-btn:hover::before {
  left: 100%;
}

/* Smooth page transition effect */
.activities-grid {
  transition: opacity 0.3s ease;
}

.activities-grid.loading {
  opacity: 0.6;
}

/* Enhanced responsive design for pagination */
@media (max-width: 768px) {
  .pagination-container {
    margin-top: 40px;
    padding: 25px 0;
    gap: 15px;
  }

  .pagination-controls {
    gap: 10px;
    flex-direction: column;
    width: 100%;
  }

  .pagination-btn {
    min-width: 100px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .page-numbers {
    order: -1;
    justify-content: center;
    width: 100%;
  }

  .page-btn {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }

  .pagination-info {
    font-size: 0.9rem;
    text-align: center;
  }

  .loading-container {
    padding: 40px 20px;
  }

  .loading-spinner {
    width: 40px;
    height: 40px;
  }

  .no-activities {
    padding: 60px 30px;
    margin: 30px auto;
  }

  .no-activities i {
    font-size: 3rem;
  }

  .no-activities p {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .pagination-container {
    margin-top: 30px;
    padding: 20px 0;
  }

  .pagination-btn {
    min-width: 90px;
    padding: 8px 12px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .page-btn {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .page-numbers {
    gap: 6px;
  }

  .pagination-info {
    font-size: 0.85rem;
  }

  .loading-container {
    padding: 30px 15px;
  }

  .no-activities {
    padding: 40px 20px;
  }

  .no-activities i {
    font-size: 2.5rem;
    margin-bottom: 20px;
  }

  .no-activities p {
    font-size: 1rem;
  }
}

/* Accessibility improvements */
.pagination-btn:focus,
.page-btn:focus {
  outline: 2px solid #4a89dc;
  outline-offset: 2px;
}

.pagination-btn:focus:not(.disabled),
.page-btn:focus {
  box-shadow: 0 0 0 3px rgba(74, 137, 220, 0.2);
}

/* Print styles */
@media print {
  .pagination-container,
  .search-container,
  .loading-container {
    display: none !important;
  }

  .activities-grid {
    display: block !important;
  }

  .activity-card {
    break-inside: avoid;
    margin-bottom: 20px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .pagination-btn,
  .page-btn {
    border-width: 3px;
  }

  .page-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .pagination-btn,
  .page-btn,
  .loading-spinner,
  .activities-grid {
    transition: none;
    animation: none;
  }

  .loading-spinner {
    border-top-color: #4a89dc;
    animation: none;
  }

  .loading-spinner::after {
    content: "⟳";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #4a89dc;
  }
}


 /* ปุ่มกลับขึ้นด้านบน */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: none;
  width: 55px;
  height: 55px;
  background-color: rgba(255, 255, 255, 0.25); /* สีใส */
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 80, 157, 0.2);
  box-shadow: 0 8px 20px rgba(0, 80, 157, 0.10);
  color: #00509d;
  border-radius: 50%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#back-to-top:hover {
  transform: translateY(-5px);
  background-color: rgba(0, 80, 157, 0.15); /* สีใสเข้มขึ้น */
  box-shadow: 0 12px 25px rgba(0, 80, 157, 0.18);
  color: #003366;
}

#back-to-top i {
  font-size: 1.2rem;
}