/* CommUnity 主樣式表 */
/* 整合自 index.html 內嵌樣式，已去除重複 */

body {
  font-family: "Noto Sans TC", sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

/* 漸層按鈕 */
.btn-gradient {
  background-image: linear-gradient(
    to right,
    #3b82f6 0%,
    #8b5cf6 51%,
    #3b82f6 100%
  );
  background-size: 200% auto;
  transition: all 0.3s ease-in-out;
}
.btn-gradient:hover {
  background-position: right center;
}

/* 淡入動畫 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal 進場動畫 */
.modal-enter {
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Blob 動態背景 */
@keyframes blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}
.animate-blob {
  animation: blob 7s infinite;
}
.animation-delay-2000 {
  animation-delay: 2s;
}
.animation-delay-4000 {
  animation-delay: 4s;
}

/* App 載入遮罩 */
#app-loader {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease-out;
  backdrop-filter: blur(5px);
}

/* 載入旋轉器 */
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #e2e8f0;
  border-bottom-color: #3b82f6;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 回到頂部按鈕 */
#scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  transform: translateY(20px);
}
#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 分頁 Tab 樣式 */
.coupon-tab-btn.active {
  border-color: #3b82f6;
  background-color: #eff6ff;
  color: #2563eb;
}
.points-filter-btn.active {
  background-color: #3b82f6;
  color: white;
}

/* 通知徽章 */
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #ef4444;
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 確保 hidden class 優先級高於 display: flex */
.notification-badge.hidden {
  display: none !important;
  visibility: hidden !important;
}

/* ========== Pull-to-Refresh 下拉刷新 ========== */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  overflow: hidden;
  transition: height 0.2s ease-out, opacity 0.2s ease-out;
  z-index: 9998;
  opacity: 0;
}

.ptr-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #bfdbfe;
  border-top-color: #3b82f6;
  border-radius: 50%;
  transition: transform 0.1s linear;
}

.ptr-indicator.ptr-refreshing .ptr-spinner {
  animation: rotation 0.8s linear infinite;
}

.ptr-text {
  margin-top: 8px;
  font-size: 12px;
  color: #3b82f6;
  font-weight: 500;
}

.ptr-indicator.ptr-ready .ptr-text {
  color: #2563eb;
}
