/* ==========================================================================
   基礎重置與全域設定
   ========================================================================== */

/* 重置所有元素的預設邊距與內距 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS 變數定義 - 品牌色彩 */
:root {
  --futsu-orange: #ed6d00; /* 互助營造主色 */
  --netverse-blue: #06c; /* 網宇資訊主色 */
}

/* 頁面主體樣式 */
body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei',
    '微軟正黑體', sans-serif;
  background: #f8f9fa; /* 參考 week-01 的背景色 */
  height: 100vh; /* 固定為視窗高度 */
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden; /* 防止頁面滾動 */
}

/* ==========================================================================
   標題區域樣式
   ========================================================================== */

/* 標題區域容器 */
.title-section {
  text-align: center;
  padding: 40px 20px 0;  /* 移除底部 padding */
  flex-shrink: 0; /* 防止被壓縮 */
}

/* 標題 Logo */
.title-logo {
  height: 50px;
  margin-bottom: 15px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* 主標題 */
.main-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--futsu-orange);
  margin-bottom: 0;  /* 移除底部間距 */
  letter-spacing: 1px;
}

/* 英文副標題 */
.subtitle {
  font-size: 16px;
  color: #6c757d;
  font-weight: 400;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

/* 系統名稱 - 已不使用 */
.system-name {
  font-size: 18px;
  color: #495057;
  font-weight: 400;
  margin-bottom: 20px;
}

/* 標題分隔線 - 參考 week-01 的漸層線 */
.title-divider {
  width: 80%;
  max-width: 800px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--futsu-orange), transparent);
  margin: 25px auto 0;  /* 上方間距與原本的 padding-bottom 相同 */
}

/* 公司徽章 - 頁面底部 */
.company-footer {
  text-align: center;
  padding: 15px 20px 20px;
  font-size: 16px;
  color: #6c757d;
}

/* 互助營造文字樣式 */
.company-footer .futsu {
  color: var(--futsu-orange);
  font-weight: 600;
}

/* 網宇資訊文字樣式 */
.company-footer .netverse {
  color: var(--netverse-blue);
  font-weight: 600;
}

/* ==========================================================================
   主要內容區塊
   ========================================================================== */

/* 主要內容容器 */
.main-container {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto; /* 標題 | 卡片區 | 分隔線 | 公司徽章 */
  overflow: hidden; /* 防止滾動 */
}

/* 卡片區域容器 - 新增 */
.carousel-section {
  display: grid;
  place-items: center; /* 完美置中 */
  position: relative;
  overflow: hidden;
  padding: 20px 0;
}

/* 底部分隔線 - 新增 */
.bottom-divider {
  width: 80%;
  max-width: 800px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--futsu-orange), transparent);
  margin: 0 auto;
  align-self: end; /* 貼近底部 */
}

/* ==========================================================================
   週報卡片樣式
   ========================================================================== */

/* 週報項目卡片 */
.report-item {
  position: relative;
  display: block;
  width: 320px;
  height: 420px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none; /* 移除連結底線 */
  color: inherit; /* 繼承文字顏色 */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

/* 卡片懸停效果 - 使用縮放代替上浮，避免被截斷 */
.report-item:hover {
  transform: scale(1.02); /* 微微放大而非上浮 */
  box-shadow: 0 12px 32px rgb(0 0 0 / 15%);
  z-index: 10; /* 確保在最上層 */
}

/* 週次標記 - 頂部色塊 */
.week-indicator {
  height: 140px; /* 擴大高度以覆蓋數字區域 */
  background: linear-gradient(135deg, var(--futsu-orange), #ff9020);
  position: relative;
  padding: 2rem; /* 增加內距 */
  padding-bottom: 1.5rem; /* 底部內距 */
  display: flex;
  align-items: flex-end; /* 靠下對齊 */
}

/* 卡片內容區 */
.card-content {
  padding: 2rem 2.5rem 2.5rem;
  height: calc(100% - 140px); /* 扣除頂部色塊高度 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 週次數字容器 */
.week-number {
  color: white;
  display: flex;
  align-items: baseline; /* 基線對齊 */
  gap: 0.4rem; /* 增加間距 */
}

/* week 文字 - 較小 */
.week-text {
  font-size: 1.2rem; /* 加大 */
  font-weight: 400;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

/* 數字部分 - 較大 */
.week-num {
  font-size: 3.8rem; /* 加大 */
  font-weight: 300;
  line-height: 1;
}

/* 週次標題 */
.week-title {
  font-size: 1.35rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.2rem; /* 再縮小與日期的間距 */
}

/* 日期資訊 */
.date-range {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: auto;
}

/* 狀態標示 */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

/* 狀態點 */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

/* 查看詳情文字 - 簡約風格 */
.view-detail {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--futsu-orange);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.3s ease;
}

/* 箭頭符號 */
.view-detail::after {
  content: '→';
}

/* 懸停時箭頭動畫 */
.report-item:hover .view-detail {
  gap: 0.5rem;
}

/* ==========================================================================
   進度顯示元件
   ========================================================================== */

/* 進度顯示容器 - 在卡片內容區 */
.progress-display {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 3.6rem; /* 再增加與下方狀態指示的間距 */
}

/* 進度條背景 */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

/* 進度條填充 */
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--futsu-orange), #ff9020);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* 進度文字 */
.progress-display .progress-text {
  color: #666;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 狀態指示器變化 */
.status-indicator.submitted .status-dot {
  background: #22c55e;
}

.status-indicator.in-progress .status-dot {
  background: #f59e0b;
}

.status-indicator.pending .status-dot {
  background: #94a3b8;
}

/* 未提交的卡片樣式 - 灰階效果 */
.report-item.not-submitted {
  opacity: 0.6;
  filter: grayscale(100%);
  cursor: not-allowed;
}

/* 未提交卡片的頂部色塊 */
.report-item.not-submitted .week-indicator {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
}

/* 未提交卡片懸停效果減弱 */
.report-item.not-submitted:hover {
  transform: scale(1);
  box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

/* 未提交卡片的文字顏色調整 */
.report-item.not-submitted .week-title {
  color: #6b7280;
}

.report-item.not-submitted .progress-display .progress-text {
  color: #9ca3af;
}

.report-item.not-submitted .view-detail {
  color: #9ca3af;
  pointer-events: none;
}

/* 未提交卡片的進度條 */
.report-item.not-submitted .progress-bar-fill {
  background: linear-gradient(90deg, #9ca3af, #6b7280);
}

/* 未提交卡片的進度條背景（更淡） */
.report-item.not-submitted .progress-bar-bg {
  background: #e5e5e5;
  opacity: 0.5;
}

/* ==========================================================================
   Flipster 輪播容器
   ========================================================================== */

/* Flipster 主容器 - 確保全寬顯示 */
#flipster {
  width: 100%;
  max-width: 100vw;
  padding: 0; /* 移除內距，讓 grid 控制位置 */
}

/* 在 Flipster 初始化前完全隱藏內容 */
#flipster:not(.flipster--active) {
  visibility: hidden;
}

/* Flipster 初始化後顯示 */
#flipster.flipster--active {
  visibility: visible;
}

/* Flipster 內部容器樣式覆蓋 */
.flipster__container {
  padding: 10px 0 !important; /* 確保有足夠空間顯示 hover 效果 */
}
