/* ===== GSAP 動畫輔助樣式 ===== */

/* 頁面載入器 */
.page-loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 滾動進度條 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #6366f1);
  background-size: 200% 100%;
  transform-origin: left;
  z-index: 9999;
  width: 100%;
}

/* 背景裝飾 */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  will-change: transform;
}

.bg-circle-1 {
  width: 600px;
  height: 600px;
  background: #6366f1;
  top: -200px;
  right: -200px;
}

.bg-circle-2 {
  width: 400px;
  height: 400px;
  background: #06b6d4;
  bottom: 20%;
  left: -100px;
}

.bg-circle-3 {
  width: 300px;
  height: 300px;
  background: #8b5cf6;
  top: 50%;
  right: 10%;
}

/* 卡片 3D 效果 */
.post {
  perspective: 1000px;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

/* 文字漸變效果 */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 閃光效果 */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% { left: 100%; }
}

/* 脈動效果 */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 浮動效果 */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 淡入動畫類 */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* 懸停提升效果 */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* 按鈕波紋效果 */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}

/* 文字打字效果 */
.typewriter {
  overflow: hidden;
  border-right: 2px solid #6366f1;
  white-space: nowrap;
  animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* 旋轉進入 */
.rotate-in {
  opacity: 0;
  transform: rotate(-10deg) scale(0.9);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotate-in.visible {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* 彈跳效果 */
.bounce-in {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 滑入效果 */
.slide-in-bottom {
  animation: slideInBottom 0.5s ease forwards;
}

@keyframes slideInBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 模糊進入 */
.blur-in {
  animation: blurIn 0.6s ease forwards;
}

@keyframes blurIn {
  from {
    filter: blur(10px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}

/* 自定義游標 */
.custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid #6366f1;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.15s ease;
}

/* 滾動提示 */
.scroll-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  animation: bounce 2s infinite;
}

.scroll-indicator::after {
  content: '';
  width: 24px;
  height: 40px;
  border: 2px solid #64748b;
  border-radius: 12px;
  position: relative;
}

.scroll-indicator::before {
  content: '';
  width: 4px;
  height: 8px;
  background: #6366f1;
  border-radius: 2px;
  position: absolute;
  bottom: 28px;
  animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

/* 響應式隱藏動畫效果 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 移動端優化 */
@media (max-width: 768px) {
  .bg-circle {
    opacity: 0.08;
  }
  
  .custom-cursor {
    display: none;
  }
}
