/* ═══════════════════════════════════════
   Leaflet.PhotoFilter.css
   使用方法：在 HTML 中引入此文件
   <link rel="stylesheet" href="./assets/Leaflet.PhotoFilter.css" />
═══════════════════════════════════════ */

/* ── 控件容器 ── */
.leaflet-control-photo-filter {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.3);
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* ── 标题行（折叠时仅图标，紧凑正方形按钮） ── */
.leaflet-control-photo-filter .pf-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  cursor: pointer;
  user-select: none;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
  transition: all 0.2s ease;
}
.leaflet-control-photo-filter .pf-header:hover {
  background: #eaeaea;
}
.leaflet-control-photo-filter .pf-header svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}
/* 展开时标题栏变宽，显示完整标题 */
.leaflet-control-photo-filter.open .pf-header {
  width: auto;
  height: auto;
  padding: 5px 10px;
  gap: 5px;
  justify-content: flex-start;
  font-size: 12px;
  color: #333;
}
.leaflet-control-photo-filter.open .pf-header svg {
  width: 16px;
  height: 16px;
}
.leaflet-control-photo-filter.open .pf-header .pf-title-text {
  display: inline;
}
/* 折叠时隐藏标题文字 */
.leaflet-control-photo-filter .pf-header .pf-title-text {
  display: none;
  white-space: nowrap;
}

/* ── 内容区 ── */
.leaflet-control-photo-filter .pf-body {
  padding: 8px 10px;
  font-size: 12px;
  border-bottom: 1px solid #eee;
}

/* ── 时间行 ── */
.pf-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.pf-time-row label {
  width: 26px;
  color: #666;
  flex-shrink: 0;
  font-size: 11px;
}
.pf-time-row input[type="date"] {
  flex: 1;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
}

/* ── 按钮行 ── */
.pf-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.pf-btn-row button {
  flex: 1;
  padding: 3px 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  transition: background 0.15s;
}

.pf-btn-filter {
  background: #1976d2;
  color: #fff;
}
.pf-btn-filter:hover {
  background: #1565c0;
}
.pf-btn-filter.loading {
  background: #90caf9;
  pointer-events: none;
}

.pf-btn-reset {
  background: #eee;
  color: #555;
}
.pf-btn-reset:hover {
  background: #ddd;
}
.pf-btn-reset.loading {
  background: #e0e0e0;
  pointer-events: none;
}

/* ── 快捷时间按钮 ── */
.pf-shortcut-row {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: nowrap;
  min-height: 26px;
}
.pf-btn-shortcut {
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  font-size: 11px;
  border: 1px solid #1976d2;
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.pf-btn-shortcut:hover {
  background: #1976d2;
  color: #fff;
}

/* ── 正射点位开关 ── */
.pf-btn-nadir {
  width: 100%;
  margin-top: 6px;
  padding: 3px 0;
  border: 2px solid #2e7d32;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  background: #fff;
  color: #2e7d32;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pf-btn-nadir.active {
  background: #2e7d32;
  color: #fff;
}
.pf-btn-nadir:hover {
  opacity: 0.85;
}

/* ── 普通照片开关 ── */
.pf-btn-normal {
  width: 100%;
  margin-top: 6px;
  padding: 3px 0;
  border: 2px solid #1976d2;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  background: #fff;
  color: #1976d2;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pf-btn-normal.active {
  background: #1976d2;
  color: #fff;
}
.pf-btn-normal:hover {
  opacity: 0.85;
}

/* ── 展开箭头开关 ── */
.pf-btn-spread {
  width: 100%;
  margin-top: 6px;
  padding: 3px 0;
  border: 2px solid #e65100;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  background: #fff;
  color: #e65100;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pf-btn-spread.active {
  background: #e65100;
  color: #fff;
}
.pf-btn-spread:hover {
  opacity: 0.85;
}

/* ── 计数标签 ── */
.pf-count {
  text-align: center;
  font-size: 11px;
  color: #888;
  margin-top: 6px;
  min-width: 200px;
  display: inline-block;
}

/* ── 加载动画 ── */
.pf-spin {
  display: inline-block;
  animation: pf-spin 0.8s linear infinite;
}
@keyframes pf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 悬浮照片卡片（由插件自动注入 body） ── */
.pf-photo-tooltip {
  position: fixed;
  z-index: 1500;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  display: none;
  pointer-events: auto;
  overflow: visible;
}
/* × 关闭按钮 */
.pf-photo-tooltip .pf-tt-close {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  transition: all 0.15s;
  line-height: 1;
}
.pf-photo-tooltip .pf-tt-close:hover {
  transform: scale(1.25);
}
/* 主体内容区（左侧） */
.pf-photo-tooltip .pf-tt-main {
  max-width: 340px;
  padding: 8px;
}
/* 照片列表 — 叠加在预览图右上角，默认窄条只露序号 */
.pf-photo-tooltip .pf-tt-photo-list {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 100%;
  overflow-y: auto;
  background: rgba(255,255,255,0.15);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  border-radius: 0;
  display: none;
  z-index: 2;
  transition: width 0.25s ease;
  scrollbar-width: thin;
}
.pf-photo-tooltip .pf-tt-photo-list::-webkit-scrollbar {
  width: 3px;
}
.pf-photo-tooltip .pf-tt-photo-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
}
.pf-photo-tooltip .pf-tt-photo-list:hover {
  width: 60%;
  max-width: 200px;
}
/* 照片列表项 */
.pf-photo-tooltip .pf-tt-photo-item {
  padding: 6px 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.15s;
  user-select: none;
}
.pf-photo-tooltip .pf-tt-photo-item:hover {
  background: rgba(0,0,0,0.06);
}
.pf-photo-tooltip .pf-tt-photo-item.active {
  background: rgba(0,0,0,0.1);
  font-weight: 600;
  color: #000;
}
.pf-photo-tooltip .pf-tt-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: 4px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0,0,0,0.06) 25%, transparent 25%),
    linear-gradient(225deg, rgba(0,0,0,0.06) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0,0,0,0.06) 25%, transparent 25%),
    linear-gradient(315deg, rgba(0,0,0,0.06) 25%, transparent 25%);
  background-size: 20px 20px;
  background-position:
    10px 0,
    10px 0,
    0 0,
    0 0;
  background-color: #f0f0f0;
}
.pf-photo-tooltip .pf-tt-img-wrap::after {
  content: "📷";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s;
}
.pf-photo-tooltip .pf-tt-img-wrap.loaded::after {
  opacity: 0;
}
.pf-photo-tooltip .pf-tt-img {
  display: block;
  width: 100%;
  height: 240px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.pf-photo-tooltip .pf-tt-path-row {
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pf-photo-tooltip .pf-tt-name {
  font-size: 10px;
  color: #555;
  word-break: break-all;
  line-height: 1.4;
  user-select: text;
  cursor: text;
  background: #f5f5f5;
  border-radius: 3px;
  padding: 3px 5px;
  border: 1px solid #e0e0e0;
}
.pf-photo-tooltip .pf-tt-copy-btns {
  display: flex;
  gap: 4px;
}
.pf-photo-tooltip .pf-tt-copy-btn {
  flex: 1;
  padding: 3px 6px;
  font-size: 10px;
  border: 1px solid #1976d2;
  border-radius: 3px;
  background: #fff;
  color: #1976d2;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pf-photo-tooltip .pf-tt-copy-btn:hover {
  background: #1976d2;
  color: #fff;
}
.pf-photo-tooltip .pf-tt-copy-btn.copied {
  background: #4caf50;
  border-color: #4caf50;
  color: #fff;
  pointer-events: none;
}
.pf-photo-tooltip .pf-tt-time {
  font-size: 12px;
  color: #444;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pf-photo-tooltip .pf-tt-hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 3px;
}

/* ── 叠点导航条 ── */
.pf-photo-tooltip .pf-tt-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 3px 0;
  background: #f5f5f5;
  border-radius: 4px;
}
.pf-photo-tooltip .pf-tt-nav-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: #e0e0e0;
  color: #333;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  user-select: none;
}
.pf-photo-tooltip .pf-tt-nav-btn:hover {
  background: #1976d2;
  color: #fff;
}
.pf-photo-tooltip .pf-tt-nav-info {
  font-size: 12px;
  font-weight: bold;
  color: #555;
  min-width: 40px;
  text-align: center;
}
/* 导航栏序号输入框 */
.pf-photo-tooltip .pf-tt-nav-input {
  width: 38px;
  font-size: 11px;
  padding: 2px 3px;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-align: center;
  outline: none;
}
.pf-photo-tooltip .pf-tt-nav-input:focus {
  border-color: #1976d2;
}

/* ── 高亮箭头（叠点导航时当前项） ── */
/* 注意：transform 不在此处设置，由 JS 直接操作 SVG 内联样式，
   避免 !important 覆盖 SVG 原有的 rotate() 导致箭头位移 */
.pf-arrow-active {
  z-index: 1000 !important;
}
.pf-arrow-active svg {
  transition: filter 0.15s, transform 0.15s;
}
