/* ========================================
   統一頁腳樣式 - 完全配合原網站配色
   ======================================== */

/* === 深色模式 (預設) === */
footer {
  width: 100%;
  background-color: #2a2a2a !important;
  border-top: 1px solid #3a3a3a !important;
  color: #d0d0d0 !important;
  padding-top: 3rem;
  padding-bottom: 3rem;
  position: relative;
  z-index: 10;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

/* 深色模式文字顏色 */
footer .text-gray-200 {
  color: #e0e0e0 !important;
}

footer .text-gray-300 {
  color: #d0d0d0 !important;
}

footer .text-gray-400 {
  color: #a0a0a0 !important;
}

footer .text-gray-500 {
  color: #888888 !important;
}

footer .text-white {
  color: #ffffff !important;
}

footer .border-gray-800 {
  border-color: #3a3a3a !important;
}

footer .border-lab-cyan {
  border-color: #8fa895 !important;
}

/* 深色模式標題顏色 */
footer h3,
footer h4,
footer h5 {
  color: #8fa895 !important;
}

/* 深色模式連結 - 移除懸停效果 */
footer a {
  color: #a0a0a0 !important;
  transition: none;
  cursor: default;
  text-decoration: none;
  pointer-events: none;
}

/* 如果需要保留某些特定連結的功能,可以加上 class 例外 */
footer a.active-link {
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.3s ease;
}

footer a.active-link:hover {
  color: #8fa895 !important;
}

/* Logo 和公司名稱區域 - 不要懸停效果 */
footer .footer-logo-dark,
footer .footer-logo-light,
footer img[alt="龍騰文化"] {
  pointer-events: none;
  cursor: default;
}

footer .font-medium.text-gray-200 {
  cursor: default;
  pointer-events: none;
}

/* 深色模式段落 */
footer p,
footer li {
  color: #d0d0d0 !important;
  cursor: default;
}

footer p:not(.copyright-summary),
footer li {
  pointer-events: none;
}

/* 深色模式版權聲明 */
footer .copyright-summary {
  color: #888888 !important;
  transition: color 0.3s ease;
}

footer .copyright-summary span {
  transition: color 0.3s ease;
}

footer .copyright-summary svg {
  transition:
    stroke 0.3s ease,
    transform 0.3s ease;
}

footer .copyright-summary:hover {
  color: #8fa895 !important;
}

footer .copyright-summary:hover span {
  color: #8fa895 !important;
}

footer .copyright-summary:hover svg {
  color: #8fa895 !important;
  stroke: #8fa895 !important;
}

/* Logo 切換 - 深色模式顯示白色 Logo */
.footer-logo-light {
  display: none;
}

.footer-logo-dark {
  display: block;
}

/* ========================================
   淺色模式 (body.dark-mode)
   使用原網站的淺色配色
   ======================================== */
body:not(.dark-mode) footer {
  background-color: #f8f7f4 !important;
  border-top-color: rgba(124, 144, 130, 0.28) !important;
  color: #333 !important;
}

/* 淺色模式文字顏色 */
body:not(.dark-mode) footer .text-gray-200 {
  color: #333 !important;
}

body:not(.dark-mode) footer .text-gray-300 {
  color: #333 !important;
}

body:not(.dark-mode) footer .text-gray-400 {
  color: #666 !important;
}

body:not(.dark-mode) footer .text-gray-500 {
  color: #666 !important;
}

body:not(.dark-mode) footer .text-white {
  color: #333 !important;
}

body:not(.dark-mode) footer .border-gray-800 {
  border-color: rgba(124, 144, 130, 0.37) !important;
}

body:not(.dark-mode) footer .border-lab-cyan {
  border-color: #7c9082 !important;
}

/* 淺色模式標題顏色 */
body:not(.dark-mode) footer h3,
body:not(.dark-mode) footer h4,
body:not(.dark-mode) footer h5 {
  color: #7c9082 !important;
}

/* 淺色模式連結 - 移除懸停效果 */
body:not(.dark-mode) footer a {
  color: #666 !important;
  transition: none;
  cursor: default;
  text-decoration: none;
  pointer-events: none;
}

/* 如果需要保留某些特定連結的功能 */
body:not(.dark-mode) footer a.active-link {
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.3s ease;
}

body:not(.dark-mode) footer a.active-link:hover {
  color: #7c9082 !important;
}

/* Logo 和公司名稱區域 - 不要懸停效果 */
body:not(.dark-mode) footer .footer-logo-dark,
body:not(.dark-mode) footer .footer-logo-light,
body:not(.dark-mode) footer img[alt="龍騰文化"] {
  pointer-events: none;
  cursor: default;
}

body:not(.dark-mode) footer .font-medium.text-gray-200 {
  cursor: default;
  pointer-events: none;
}

/* 淺色模式段落 */
body:not(.dark-mode) footer p,
body:not(.dark-mode) footer li {
  color: #333 !important;
  cursor: default;
}

body:not(.dark-mode) footer p:not(.copyright-summary),
body:not(.dark-mode) footer li {
  pointer-events: none;
}

/* 淺色模式版權聲明 */
body:not(.dark-mode) footer .copyright-summary {
  color: #666 !important;
  transition: color 0.3s ease;
}

body:not(.dark-mode) footer .copyright-summary span {
  transition: color 0.3s ease;
}

body:not(.dark-mode) footer .copyright-summary svg {
  transition:
    stroke 0.3s ease,
    transform 0.3s ease;
}

body:not(.dark-mode) footer .copyright-summary:hover {
  color: #7c9082 !important;
}

body:not(.dark-mode) footer .copyright-summary:hover span {
  color: #7c9082 !important;
}

body:not(.dark-mode) footer .copyright-summary:hover svg {
  color: #7c9082 !important;
  stroke: #7c9082 !important;
}

/* Logo 切換 - 淺色模式顯示黑色 Logo */
body:not(.dark-mode) .footer-logo-light {
  display: block;
}

body:not(.dark-mode) .footer-logo-dark {
  display: none;
}

/* ========================================
   Details/Summary 展開功能樣式
   ======================================== */
footer details summary {
  outline: none;
  transition: color 0.3s ease;
}

footer details summary::-webkit-details-marker {
  display: none;
}

/* 版權聲明摘要懸停效果 */
footer .copyright-summary:hover {
  color: #8fa895 !important;
}

footer .copyright-summary:hover span {
  color: #8fa895 !important;
}

footer .copyright-summary:hover svg {
  stroke: #8fa895 !important;
}

body:not(.dark-mode) footer .copyright-summary:hover {
  color: #7c9082 !important;
}

body:not(.dark-mode) footer .copyright-summary:hover span {
  color: #7c9082 !important;
}

body:not(.dark-mode) footer .copyright-summary:hover svg {
  stroke: #7c9082 !important;
}

/* SVG 箭頭基礎樣式 */
footer details summary svg {
  flex-shrink: 0;
  transition:
    transform 0.3s ease,
    stroke 0.3s ease;
}

/* 展開時箭頭旋轉 */
footer details[open] summary svg {
  transform: rotate(180deg);
}

/* 展開內容淡入動畫 */
footer details[open] > div {
  animation: fadeInFooter 0.3s ease-in-out;
}

@keyframes fadeInFooter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   響應式設計 (手機版)
   ======================================== */
@media (max-width: 768px) {
  footer {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* 移除桌面版的分欄邊框 */
  footer .md\:border-r {
    border-right: none !important;
    padding-right: 0 !important;
  }

  footer .md\:pl-12 {
    padding-left: 0 !important;
    margin-top: 1.5rem !important;
  }

  /* Logo 靠左對齊 */
  footer .self-start {
    align-self: flex-start !important;
  }

  footer h4 {
    font-size: 1rem !important;
    margin-bottom: 1rem !important;
  }

  footer .text-xs {
    font-size: 0.75rem !important;
  }

  footer .text-sm {
    font-size: 0.875rem !important;
  }

  /* 手機版製作團隊維持 2 欄網格 */
  footer .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem 1rem !important;
  }

  /* 保持橫向排列：職位在左，姓名在右 */
  footer .grid-cols-2 li {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  footer .gap-8 {
    gap: 1.5rem !important;
  }
}

/* ========================================
   頁腳自動隱藏功能 (選用)
   ======================================== */
footer.footer-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}
