/* v36-places-photos.css — Task #35 장소·사진 인사이트 카드
 * RULE #41: 데이터 인사이트 엔진 / RULE #46: 카드 동일높이 / RULE #49: Circle legend
 * 홈 대시보드에서 memory-today 바로 아래에 배치되는 복합 카드
 */

.pp-insight-card {
  margin-bottom: var(--sp-5, 20px);
}

/* ── 인사이트 텍스트 블록 (RULE #41) ──────────────────────── */
.pp-insights {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  margin: 4px 0 16px;
  background: linear-gradient(90deg, rgba(136, 199, 20, 0.08), rgba(136, 199, 20, 0.02));
  border-left: 3px solid var(--c-primary, #88c714);
  border-radius: 0 8px 8px 0; /* RULE #15 — 좌측 액센트가 있으므로 좌측 직각 */
}

.pp-insight-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--c-text, #222);
}

.pp-insight-row .pp-insight-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--c-primary, #88c714);
}

.pp-insight-row .pp-insight-text strong {
  font-weight: 600;
  color: var(--c-text, #222);
}

/* ── 2-column grid (RULE #46: 동일 행 카드 세로폭 통일) ───── */
.pp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4, 16px);
  align-items: stretch;
}

@media (max-width: 899px) {
  .pp-grid-2 {
    grid-template-columns: 1fr;
  }
}

.pp-section {
  display: flex;
  flex-direction: column;
  background: var(--c-surface-2, #fafbfa);
  border: 1px solid var(--c-line, #e4e6e2);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 240px;
}

.pp-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.pp-section-head .pp-ico {
  width: 14px;
  height: 14px;
  color: var(--c-text-soft, #777);
}

.pp-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text, #222);
  flex: 1;
}

/* ── Top 5 방문 장소 리스트 ────────────────────────────────── */
.pp-place-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.pp-place-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--c-line, #e4e6e2);
  cursor: pointer;
  transition: background 0.15s;
}

.pp-place-row:last-child {
  border-bottom: none;
}

.pp-place-row:hover {
  background: rgba(136, 199, 20, 0.06);
}

.pp-place-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-primary, #88c714);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.pp-place-row:nth-child(n+4) .pp-place-rank {
  background: var(--c-text-soft, #999);
}

.pp-place-info {
  min-width: 0;
  overflow: hidden;
}

.pp-place-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}

.pp-place-name strong {
  font-weight: 600;
  color: var(--c-text, #222);
}

.pp-place-meta {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

.pp-place-bar {
  margin-top: 4px;
  height: 3px;
  background: var(--c-line, #e4e6e2);
  border-radius: 2px;
  overflow: hidden;
}

.pp-place-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary, #88c714), #a6db4d);
  border-radius: 2px;
  transition: width 0.3s;
}

.pp-place-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text, #222);
  text-align: right;
  white-space: nowrap;
}

.pp-place-count .small {
  font-size: 10px;
  font-weight: 500;
  margin-left: 2px;
}

/* ── 최근 6개월 사진 월별 바차트 ───────────────────────────── */
.pp-month-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  align-items: end;
  flex: 1;
  min-height: 160px;
  padding-top: 16px;
}

.pp-month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
  min-height: 140px;
}

.pp-month-col:hover {
  opacity: 0.8;
}

.pp-month-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-soft, #777);
  min-height: 12px;
}

.pp-month-bar {
  width: 70%;
  max-width: 32px;
  min-height: 3px;
  background: linear-gradient(180deg, var(--c-primary, #88c714), #5fa008);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s, background 0.15s;
}

.pp-month-col:hover .pp-month-bar {
  background: linear-gradient(180deg, #a6db4d, var(--c-primary, #88c714));
}

.pp-month-label {
  font-size: 11px;
  color: var(--c-text-soft, #777);
  font-weight: 500;
  padding-top: 4px;
}

/* ── 반응형 ────────────────────────────────────────────────── */
@media (max-width: 599px) {
  .pp-insights {
    padding: 10px 12px;
  }
  .pp-insight-row {
    font-size: 12px;
  }
  .pp-section {
    min-height: 200px;
    padding: 10px 12px;
  }
  .pp-place-row {
    grid-template-columns: 20px 1fr auto;
    gap: 8px;
  }
  .pp-place-name {
    font-size: 12px;
  }
  .pp-place-count {
    font-size: 13px;
  }
  .pp-month-chart {
    min-height: 120px;
    gap: 4px;
  }
  .pp-month-col {
    min-height: 110px;
  }
}

/* ── 다크모드 ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .pp-insights {
    background: linear-gradient(90deg, rgba(136, 199, 20, 0.12), rgba(136, 199, 20, 0.02));
  }
}

body.dark-mode .pp-insights,
[data-theme='dark'] .pp-insights {
  background: linear-gradient(90deg, rgba(136, 199, 20, 0.12), rgba(136, 199, 20, 0.02));
}

body.dark-mode .pp-section,
[data-theme='dark'] .pp-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .pp-place-row:hover,
[data-theme='dark'] .pp-place-row:hover {
  background: rgba(136, 199, 20, 0.1);
}
