/* Modern Service Cards Styles - Interactive Glassmorphism Design */
/* 從平面到立體空間：懸停時卡片浮起並展開隱藏資訊 */
/* 暗色科技質感：深色系配合光暈製造高級感 */
/* 流暢的微互動：資訊優雅滑入視野 */

/* --- 基礎設定 --- */
:root {
  --tech-bg-dark: #0B192E; /* 深午夜藍背景 */
  --card-bg-dark: rgba(255, 255, 255, 0.05); /* 卡片半透明背景 */
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --accent-blue: #3B82F6;
  --accent-purple: #8B5CF6;
  --accent-cyan: #06B6D4;
}

.dark-theme-section {
  background-color: var(--tech-bg-dark);
  padding: 80px 20px;
  color: var(--text-primary);
}

.dark-theme-section .section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 60px;
  background: linear-gradient(to right, #fff, #a0aec0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- 卡片核心設計 (Service Card Core) --- */
.service-card {
  background: var(--card-bg-dark);
  /* 玻璃擬態邊框效果 */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  /* 關鍵：設定初始高度和隱藏溢出，製造展開效果 */
  max-height: 340px; /* 依據實際內容調整初始高度 */
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* 使用貝茲曲線讓動畫更滑順 */
  backdrop-filter: blur(12px); /* 背景模糊，增加層次感 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* --- 懸停互動效果 (Hover Interactions) --- */
.service-card:hover {
  /* 懸停時增加最大高度，顯示隱藏內容 */
  max-height: 650px; /* 確保這個高度足夠容納展開後的內容 */
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-8px); /* 微微上浮 */
  /* 強烈的科技感光暈陰影 */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(59, 130, 246, 0.3); /* 藍色微光 */
}

/* --- 內容樣式 --- */
.card-content-visible {
  /* 讓既有內容在展開時保持穩定 */
  position: relative;
  z-index: 2;
}

.service-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 25px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* 不同顏色的光暈圖標 */
.box-glow-blue { 
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0)); 
  color: var(--accent-blue);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.box-glow-purple { 
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0)); 
  color: var(--accent-purple);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.box-glow-cyan { 
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(6, 182, 212, 0)); 
  color: var(--accent-cyan);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
}

.service-card:hover .service-icon-wrapper {
  transform: scale(1.15) rotate(5deg); /* 圖標微動，增加活力 */
  filter: brightness(1.2);
}

.service-card:hover .box-glow-blue {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.service-card:hover .box-glow-purple {
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.service-card:hover .box-glow-cyan {
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

.service-icon-wrapper i {
  font-size: 26px;
  transition: all 0.3s ease;
}

.service-card h3 {
  font-size: 1.6rem;
  margin-bottom: 16px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.service-card:hover h3 {
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.service-card p {
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.7;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.service-card:hover p {
  color: #c7d2e0;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px; /* 增加底部距離，為展開內容留空間 */
  justify-content: center;
}

.service-tags span {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.service-card:hover .service-tags span {
  background: rgba(59, 130, 246, 0.2); /* 懸停時標籤變亮 */
  color: #fff;
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* --- 隱藏的細節區塊 (The Reveal Section) --- */
.service-details-reveal {
  /* 初始狀態：隱藏、透明、位置偏下 */
  opacity: 0;
  max-height: 0;
  transform: translateY(30px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  /* 延遲動畫，讓卡片先變大，內容再滑入 */
  transition-delay: 0.1s;
  padding-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0);
  margin-top: 10px;
  overflow: hidden;
}

.service-card:hover .service-details-reveal {
  /* 懸停狀態：顯示、不透明、回到原位 */
  opacity: 1;
  max-height: 300px;
  transform: translateY(0);
  padding-top: 20px;
  border-top-color: rgba(255, 255, 255, 0.15);
}

.service-details-reveal ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.service-details-reveal li {
  display: flex;
  align-items: flex-start;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.service-details-reveal li:last-child {
  margin-bottom: 0;
}

.service-card:hover .service-details-reveal li {
  color: #c7d2e0;
}

.service-details-reveal li i {
  color: var(--accent-blue); /* 打勾圖標顏色 */
  margin-right: 12px;
  margin-top: 2px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.service-details-reveal li span {
  flex: 1;
}

/* --- 手機版優化 (Mobile Responsive) --- */
@media (max-width: 768px) {
  .dark-theme-section {
    padding: 60px 20px;
  }

  .dark-theme-section .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 10px;
  }
  
  /* 手機版直接顯示全部內容 */
  .service-card {
    max-height: none; /* 取消高度限制 */
    padding: 28px;
  }
  
  .service-details-reveal {
    opacity: 1;
    max-height: none;
    transform: translateY(0);
    padding-top: 18px;
    margin-top: 18px;
    border-top-color: rgba(255, 255, 255, 0.15);
  }
  
  .service-icon-wrapper {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
  
  .service-icon-wrapper i {
    font-size: 22px;
  }
  
  .service-card h3 {
    font-size: 1.4rem;
  }
  
  .service-card p {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .service-tags {
    gap: 8px;
    margin-bottom: 18px;
  }

  .service-tags span {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .service-details-reveal li {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .service-details-reveal li i {
    margin-right: 10px;
    font-size: 0.85rem;
  }
}

/* --- 平板優化 --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .service-card {
    max-height: 360px;
  }

  .service-card:hover {
    max-height: 680px;
  }
}
