/* APMIC 認識同事 — 座位圖樣式（v2 平面圖底圖版） */

:root {
  --apmic-navy:  #0a2540;
  --apmic-blue:  #0a5286;
  --apmic-gold:  #c8860d;
  --apmic-red:   #a8362f;
  --apmic-bg:    #f0f4f8;
  --apmic-card:  #ffffff;
  --wfh-blue:    #0a5286;
  --wfh-orange:  #d97706;
  --wfh-green:   #15803d;
  --radius:      10px;
  --shadow-sm:   0 1px 2px rgba(10, 37, 64, 0.08);
  --shadow-md:   0 4px 12px rgba(10, 37, 64, 0.12);
  --shadow-lg:   0 8px 24px rgba(10, 37, 64, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang TC", "Heiti TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--apmic-navy);
  background: var(--apmic-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  background: var(--apmic-navy);
  color: #fff;
  padding: 22px 0;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}
.site-header h1 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.site-header .subtitle { margin: 6px 0 0; font-size: 14px; opacity: 0.85; }

/* ===== Legend ===== */
.legend {
  max-width: 1400px;
  margin: 20px auto 0;
  padding: 14px 22px;
  background: var(--apmic-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--apmic-navy);
}
.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}
.legend-swatch.wfh-blue   { background: var(--wfh-blue); }
.legend-swatch.wfh-orange { background: var(--wfh-orange); }
.legend-swatch.wfh-green  { background: var(--wfh-green); }
.legend-demo {
  margin-left: auto;
  background: var(--apmic-gold);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease;
}
.legend-demo:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===== Floorplan section ===== */
.floorplan-section {
  max-width: 1400px;
  margin: 20px auto;
  padding: 18px;
  background: var(--apmic-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.floorplan-wrapper {
  position: relative;
  width: 100%;
  /* 將透過 JS 設定 aspect-ratio = 842/595 */
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.floorplan-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.32;        /* 淡化 PDF 底圖（含原本名字文字） */
  filter: grayscale(35%) contrast(0.95);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.seats-layer {
  position: absolute;
  inset: 0;
}

/* ===== Seat pill（絕對定位的名字標籤） ===== */
.seat-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--apmic-navy);
  box-shadow: var(--shadow-sm);
  border: 2px solid;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, z-index 0s;
  z-index: 1;
  line-height: 1.2;
}
.seat-pill .pill-id {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.55;
  margin-top: -1px;
}
.seat-pill:hover {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}
.seat-pill:focus-visible {
  outline: 3px solid var(--apmic-gold);
  outline-offset: 2px;
}

.seat-pill.wfh-blue   { border-color: var(--wfh-blue);   color: var(--wfh-blue); }
.seat-pill.wfh-orange { border-color: var(--wfh-orange); color: var(--wfh-orange); }
.seat-pill.wfh-green  { border-color: var(--wfh-green);  color: var(--wfh-green); }

.seat-pill .pill-id { color: var(--apmic-navy); }

/* Tooltip on hover */
.seat-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--apmic-navy);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.seat-pill:hover::after { opacity: 1; }

/* ===== Footer ===== */
.site-footer {
  max-width: 1400px;
  margin: 16px auto 32px;
  padding: 0 32px;
  color: #6b7785;
  font-size: 12px;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .header-inner, .legend, .site-footer { padding-left: 14px; padding-right: 14px; }
  .legend-demo { margin-left: 0; }
  .seat-pill { font-size: 11px; padding: 4px 7px; }
  .seat-pill .pill-id { font-size: 8px; }
  .floorplan-bg { opacity: 0.4; }
}

@media (max-width: 500px) {
  /* 手機上 floor plan 很擠，給個 overflow-x 並讓 wrapper 維持原寬 */
  .floorplan-section {
    padding: 8px;
    overflow-x: auto;
  }
  .floorplan-wrapper {
    min-width: 720px;
  }
  .seat-pill { font-size: 10px; padding: 3px 6px; }
}
