* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

body, html, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f7fafc;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 上部コントロールエリア */
.top-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.map-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title {
  font-weight: 700;
  font-size: 15px;
  color: #1a202c;
  white-space: nowrap;
}

.stats-badge {
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  background: #edf2f7;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.search-box input {
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: #3182ce;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

/* カテゴリバー */
.category-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 6px 2px;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.cat-pill:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.cat-pill.active {
  background: #3182ce;
  color: #ffffff;
  border-color: #3182ce;
  box-shadow: 0 3px 10px rgba(49, 130, 206, 0.35);
}

.favorite-pill {
  color: #d69e2e;
}

.favorite-pill.active {
  background: #d69e2e;
  border-color: #d69e2e;
  color: #ffffff;
}

/* サイドバー */
.sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 440px;
  height: 100%;
  background: #ffffff;
  z-index: 1001;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidebar.hidden {
  transform: translateX(100%);
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #4a5568;
  z-index: 10;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.camera-status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #e53e3e;
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.camera-status-tag.offline {
  background: #a0aec0;
}

.fav-action-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #cbd5e0;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}

.fav-action-btn:hover {
  transform: scale(1.2);
}

.fav-action-btn.active {
  color: #ecc94b;
}

.camera-title {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* プレイヤー領域 */
.player-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-container iframe,
.player-container video,
.player-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
}

.player-placeholder {
  color: #94a3b8;
  font-size: 14px;
}

/* プレイヤー補助ツールバー */
.player-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.action-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  background: #edf2f7;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #e2e8f0;
}

.link-btn {
  background: #ebf8ff;
  border-color: #bee3f8;
  color: #2b6cb0;
}

.link-btn:hover {
  background: #bee3f8;
}

/* メタ情報リスト */
.camera-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #edf2f7;
  padding-top: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.info-label {
  color: #718096;
}

.info-value {
  color: #2d3748;
  font-weight: 500;
  max-width: 65%;
  text-align: right;
  word-break: break-all;
}

.info-value a {
  color: #3182ce;
  text-decoration: none;
}

.info-value a:hover {
  text-decoration: underline;
}

/* クラスターアイコン */
.cluster-icon {
  background: rgba(49, 130, 206, 0.9);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.cluster-icon.large {
  background: rgba(229, 62, 62, 0.9);
}

/* 個別カメラマーカー */
.custom-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e53e3e;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}

.custom-pin:hover {
  transform: scale(1.4);
}

.custom-pin.offline {
  background: #a0aec0;
}

/* モバイル対応 */
@media (max-width: 640px) {
  .top-controls {
    width: calc(100vw - 32px);
  }
  .map-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .search-box input {
    width: 100%;
  }
  .sidebar {
    width: 100%;
    height: 65%;
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
  }
  .sidebar.hidden {
    transform: translateY(100%);
  }
}
