/* リセット & 基本スタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ヘッダー */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

header .info {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

header .info span {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* 地図 */
#map {
  flex: 1;
  z-index: 1;
}

/* クラスターマーカー */
.marker-cluster {
  background: rgba(102, 126, 234, 0.6);
  border-radius: 50%;
  text-align: center;
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-cluster div {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.8);
}

.marker-cluster-small {
  width: 40px;
  height: 40px;
}

.marker-cluster-small div {
  font-size: 14px;
}

.marker-cluster-medium {
  width: 50px;
  height: 50px;
}

.marker-cluster-medium div {
  font-size: 16px;
  background: rgba(118, 75, 162, 0.8);
}

.marker-cluster-large {
  width: 60px;
  height: 60px;
}

.marker-cluster-large div {
  font-size: 18px;
  background: rgba(167, 85, 221, 0.8);
}

/* ピンマーカー */
.pin-marker {
  background: transparent;
  border: none;
  cursor: pointer;
}

.pin-icon {
  position: relative;
  width: 30px;
  height: 42px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.pin-marker:hover .pin-icon {
  transform: rotate(-45deg) scale(1.1);
}

.pin-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
}

/* サムネイルマーカー */
.video-thumbnail-marker {
  background: transparent;
  border: none;
  cursor: pointer;
}

.thumbnail-container {
  position: relative;
  width: 120px;
  height: 90px;
  border: 3px solid white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  background: #000;
}

.video-thumbnail-marker:hover .thumbnail-container {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000 !important;
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

/* ポップアップ */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.video-popup-content {
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
  width: 280px;
  min-width: 280px;
}

.popup-thumbnail {
  width: 100%;
  height: 120px;
  display: block;
  margin-bottom: 0.5rem;
  object-fit: cover;
}

.video-popup-content h3 {
  font-size: 1rem;
  margin: 0 0.8rem 0.3rem;
  color: #333;
}

.video-popup-content .description {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0.8rem 0.5rem;
  line-height: 1.3;
  display: none;
}

.video-popup-content .metadata {
  display: flex;
  gap: 0.8rem;
  margin: 0 0.8rem 0.5rem;
  font-size: 0.8rem;
  color: #888;
  flex-wrap: wrap;
}

.video-popup-content .tags {
  margin: 0 0.8rem 0.8rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tag {
  background: #f0f0f0;
  color: #667eea;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

.watch-button {
  display: block;
  width: calc(100% - 1.6rem);
  margin: 0 0.8rem 0.8rem;
  padding: 0.6rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.watch-button * {
  color: inherit !important;
}

.watch-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* レスポンシブ */
@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
  }

  header h1 {
    font-size: 1.2rem;
  }

  header .info {
    gap: 0.8rem;
    font-size: 0.8rem;
  }

  .thumbnail-container {
    width: 100px;
    height: 75px;
  }

  .video-thumbnail-marker:hover .thumbnail-container {
    transform: scale(1.1);
  }
}
