/**
 * Pingpower 共用樣式
 * 統一管理所有頁面的基礎樣式、變數和元件
 */

/* ===== CSS Variables ===== */
:root {
  --color-primary-yellow: #fec809;
  --color-primary-orange: #f5832b;
  --color-primary-red: #e9423a;
  --color-text-dark: #374151;
}

/* ===== Base Styles ===== */
body {
  font-family: "Noto Sans TC", sans-serif;
  background-color: #f8f9fa;
}

/* ===== Glass Morphism Effect ===== */
.glass-morphism {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
  background: rgba(255, 255, 255, 0.8);
}

/* ===== Navigation Link Underline Animation ===== */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary-orange);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ===== Hero Section ===== */
.hero-bg {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--color-primary-yellow) 0%,
    var(--color-primary-orange) 50%,
    var(--color-primary-red) 100%
  );
  overflow: hidden;
}

/* ===== Card Components ===== */
.stat-card {
  background: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.stat-card .card-content {
  flex-grow: 1;
}

.stat-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

.artisan-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.artisan-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.article-card {
  transition: all 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

.tool-card {
  transition: all 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

/* ===== Modal Styles ===== */
.modal-overlay {
  transition: opacity 0.3s ease;
}

.modal-container {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===== Button Styles ===== */
.submit-button {
  background-color: var(--color-primary-orange);
}

.submit-button:hover {
  background-color: var(--color-primary-red);
}

/* ===== Article Content (Prose) ===== */
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #374151;
}

.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
  color: #4b5563;
}

.prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose img {
  border-radius: 0.5rem;
  margin: 2rem 0;
  width: 100%;
}

/* ===== Timeline Mobile Responsive ===== */
@media (max-width: 768px) {
  /* Hide the timeline center line on mobile */
  #events .relative > .absolute.left-1\/2 {
    left: 1rem;
    transform: none;
  }

  /* Stack timeline items vertically */
  #events .flex.items-center {
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    padding-left: 2rem;
  }

  /* Hide spacer divs on mobile */
  #events .flex.items-center > .w-1\/2:empty {
    display: none;
  }

  /* Make content full width */
  #events .flex.items-center > .w-1\/2 {
    width: 100%;
  }

  /* Move timeline number to left */
  #events .flex.items-center > .w-10 {
    position: absolute;
    left: -0.5rem;
  }

  /* Adjust card margin */
  #events .flex.items-center > .w-1\/2 > div {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ===== Font Display Optimization ===== */
/* Note: font-display is controlled via the Google Fonts URL parameter */
/* &display=swap is already added in the HTML link tag */

/* ===== Performance: Reduce Motion for Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
