/*
 * PARTIBRICKS™ Student Check-In — Stylesheet v1.0.0
 * 部署路徑：wp-content/themes/generatepress-child/partibricks-checkin.css
 */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Noto+Sans+TC:wght@400;700;900&display=swap');

/* ─── 基礎重設 ──────────────────────────────────────────────────────── */
#pb-checkin-root *,
#pb-checkin-root *::before,
#pb-checkin-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── 外層容器 ──────────────────────────────────────────────────────── */
.pbc-wrap {
  font-family: 'Nunito', 'Noto Sans TC', sans-serif;
  background: #fdf6ec;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 60px;
  color: #2d1a00;
}

/* ─── 頂部品牌列 ──────────────────────────────────────────────────── */
.pbc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: #fff;
  border-bottom: 2px solid #f4a820;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(244,168,32,.15);
}

.pbc-logo {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  color: #f4a820;
  text-transform: uppercase;
}

.pbc-student-name {
  font-size: 16px;
  font-weight: 800;
  color: #2d1a00;
}

/* ─── 能量儀表板 ─────────────────────────────────────────────────── */
.pbc-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 0;
}

.pbc-dash-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  border: 1.5px solid #f0e0c0;
  box-shadow: 0 2px 8px rgba(180,130,60,.08);
}

.pbc-dash-highlight {
  background: linear-gradient(135deg, #f4a820, #e8840a);
  border-color: #f4a820;
}

.pbc-dash-highlight .pbc-dash-num,
.pbc-dash-highlight .pbc-dash-label {
  color: #fff;
}

.pbc-dash-num {
  font-size: 28px;
  font-weight: 900;
  color: #f4a820;
  line-height: 1;
}

.pbc-dash-label {
  font-size: 10px;
  color: #9a7d50;
  margin-top: 4px;
  font-weight: 600;
  line-height: 1.3;
}

/* ─── 本週熱門積木 ───────────────────────────────────────────────── */
.pbc-week-bricks {
  padding: 16px 16px 0;
}

.pbc-section-title {
  font-size: 13px;
  font-weight: 800;
  color: #5a3e1b;
  margin-bottom: 10px;
  letter-spacing: .03em;
}

.pbc-week-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pbc-week-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid;
  background: transparent;
}

/* ─── 打卡區 ────────────────────────────────────────────────────── */
.pbc-checkin-zone {
  padding: 20px 16px;
}

/* ── 計時器 ── */
.pbc-timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pbc-timer-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f4a820, #e05a8a);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(244,168,32,.4), 0 0 0 0 rgba(244,168,32,.3);
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}

.pbc-timer-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  transform: scale(0);
  transition: transform .3s;
}

.pbc-timer-btn:active::before {
  transform: scale(1);
}

.pbc-timer-btn.running {
  background: linear-gradient(135deg, #2aab78, #0d9488);
  box-shadow: 0 8px 32px rgba(42,171,120,.4), 0 0 0 8px rgba(42,171,120,.15);
  animation: pulse 1.5s ease-in-out infinite;
}

.pbc-timer-btn.done {
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  box-shadow: 0 8px 32px rgba(37,99,235,.4);
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(42,171,120,.4), 0 0 0 8px rgba(42,171,120,.15); }
  50%       { box-shadow: 0 8px 32px rgba(42,171,120,.4), 0 0 0 20px rgba(42,171,120,.05); }
}

.pbc-timer-icon {
  font-size: 32px;
  line-height: 1;
}

.pbc-timer-display {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
}

.pbc-timer-hint {
  font-size: 14px;
  color: #9a7d50;
  font-weight: 600;
  text-align: center;
}

/* ── 積木區 ── */
.pbc-bricks-section {
  margin-top: 28px;
  animation: slideUp .4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pbc-bricks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.pbc-brick {
  background: #fff;
  border: 2.5px solid var(--brick-color);
  border-radius: 18px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  -webkit-tap-highlight-color: transparent;
}

.pbc-brick:active {
  transform: scale(.94);
}

.pbc-brick.checked {
  background: var(--brick-color);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--brick-color) 50%, transparent);
}

.pbc-brick.checked .pbc-brick-label,
.pbc-brick.checked .pbc-brick-zh {
  color: #fff;
}

.pbc-brick.pop {
  animation: brickPop .3s ease-out;
}

@keyframes brickPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.pbc-brick-emoji {
  font-size: 32px;
  line-height: 1;
}

.pbc-brick-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--brick-color);
  text-align: center;
}

.pbc-brick-zh {
  font-size: 11px;
  color: #9a7d50;
  font-weight: 600;
}

/* 提交按鈕 */
.pbc-submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #2aab78, #0d9488);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(42,171,120,.35);
  transition: transform .15s, box-shadow .15s;
  font-family: 'Nunito', sans-serif;
  letter-spacing: .02em;
}

.pbc-submit-btn:active {
  transform: scale(.97);
  box-shadow: 0 2px 8px rgba(42,171,120,.2);
}

.pbc-submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ─── 完成畫面 ───────────────────────────────────────────────────── */
.pbc-done-zone {
  padding: 20px 16px;
  animation: fadeIn .5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pbc-done-msg {
  text-align: center;
  padding: 24px 16px;
  background: #fff;
  border-radius: 20px;
  margin-bottom: 24px;
  border: 2px solid #f4a820;
  box-shadow: 0 4px 16px rgba(244,168,32,.15);
}

.pbc-done-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 8px;
}

.pbc-done-title {
  font-size: 24px;
  font-weight: 900;
  color: #f4a820;
  margin-bottom: 8px;
}

.pbc-done-sub {
  font-size: 15px;
  color: #5a3e1b;
  margin-bottom: 10px;
}

.pbc-stamp-count {
  font-size: 14px;
  color: #9a7d50;
  font-weight: 700;
}

/* ─── 分享卡區 ───────────────────────────────────────────────────── */
.pbc-card-section {
  background: #fff;
  border-radius: 20px;
  padding: 20px 16px;
  margin-bottom: 20px;
  border: 1.5px solid #f0e0c0;
  box-shadow: 0 2px 12px rgba(180,130,60,.08);
}

.pbc-theme-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pbc-theme-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #e8d5b0;
  background: #fdf6ec;
  font-size: 12px;
  font-weight: 700;
  color: #5a3e1b;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Nunito', sans-serif;
}

.pbc-theme-btn.active {
  background: #f4a820;
  border-color: #f4a820;
  color: #fff;
}

.pbc-quote-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.pbc-quote-btn {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid #e8d5b0;
  background: #fdf6ec;
  font-size: 12px;
  font-weight: 600;
  color: #5a3e1b;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  font-family: 'Nunito', 'Noto Sans TC', sans-serif;
  line-height: 1.4;
}

.pbc-quote-btn.active {
  background: #fff3d0;
  border-color: #f4a820;
  color: #5a3e1b;
}

.pbc-card-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 16px;
}

.pbc-share-card {
  border-radius: 20px;
}

.pbc-download-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #e05a8a, #c2185b);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(224,90,138,.35);
  font-family: 'Nunito', sans-serif;
  transition: transform .15s;
}

.pbc-download-btn:active {
  transform: scale(.97);
}

.pbc-download-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ─── 兌換券 ────────────────────────────────────────────────────── */
.pbc-coupon {
  margin-bottom: 20px;
  animation: bounceIn .6s cubic-bezier(.36,.07,.19,.97);
}

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

.pbc-coupon-inner {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  font-size: 16px;
  color: #2d1a00;
  font-weight: 700;
  line-height: 1.8;
  box-shadow: 0 4px 20px rgba(255,165,0,.4);
  border: 3px dashed rgba(255,255,255,.6);
}

.pbc-coupon-code {
  display: inline-block;
  margin-top: 10px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .15em;
  color: #2d1a00;
  background: rgba(255,255,255,.5);
  padding: 6px 16px;
  border-radius: 8px;
}

/* ─── 響應式（手機保護）───────────────────────────────────────── */
@media (max-width: 360px) {
  .pbc-timer-btn {
    width: 150px;
    height: 150px;
  }
  .pbc-timer-display {
    font-size: 28px;
  }
  .pbc-bricks-grid {
    gap: 8px;
  }
}
