@charset "utf-8";
/* CSS Document */

/* === PC共通 === */
.popup-card {
  position: fixed;
  background: rgba(255,255,255,0.97);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  width: 300px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 9500;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: auto;
}
.popup-card.show { opacity: 1; }

/* === PCは従来の位置 === */
.popup-card.follow {
  /* PC用：JSで left/top を計算してピン下に表示 */
}

/* === 固定モード（スマホ） === */
.popup-card.fixed {
  left: 50%;
  bottom: env(safe-area-inset-bottom, 10px);
  transform: translateX(-50%);
}

/* === スマホ幅調整：広げ＋上に持ち上げる === */
@media (max-width: 700px) {
  .popup-card {
    width: 92vw;
  }
  .popup-card.fixed {
    bottom: calc(env(safe-area-inset-bottom, 10px) + 60px); /* ← 上方向に持ち上げる */
  }
}

/* 開閉アニメーション */
@keyframes popupFade {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ヘッダー部 */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e53935;
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px 10px 0 0;
}

.popup-title {
  font-size: 15px;
  font-weight: bold;
}

.popup-close {
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}
.popup-close:hover {
  color: #ffd700;
  transform: scale(1.2);
}

/* タブボタン部 */
.popup-tabs {
  display: flex;
  border-bottom: 1px solid #ccc;
}

.popup-tab {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  background: #f6f6f6;
  border-right: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, font-weight 0.2s;
}
.popup-tab:last-child {
  border-right: none;
}
.popup-tab.active {
  background: #fff;
  font-weight: bold;
  border-bottom: 2px solid #e53935;
}

/* 本体部 */
.popup-body {
  padding: 10px 14px;
  font-size: 14px;
  color: #333;
}

.popup-tab-content {
  display: none;
}
.popup-tab-content.active,
.popup-tab-content[style*="display: block"] {
  display: block;
}

/* 車両リスト */
#vehicleList {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* ← 2列レイアウト */
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 6px;
}

.vehicle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 6px;
  transition: background 0.2s;
}
.vehicle-item:hover {
  background: rgba(0, 0, 0, 0.07);
}

.vehicle-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;         /* 画像比を一定に */
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  margin-bottom: 4px;
}

/* 車両情報（下部） */
.vehicle-info {
  text-align: center;
  font-size: 12px;
  line-height: 1.3;
  width: 100%;
}
.vehicle-info .vehicle-type {
  font-weight: bold;
  color: #333;
}
.vehicle-info .vehicle-team {
  color: #555;
  font-size: 11px;
}
.vehicle-info .vehicle-number {
  color: #777;
  font-size: 11px;
}

/* === スマホでは1列に戻す === */
@media (max-width: 700px) {
  #vehicleList {
    grid-template-columns: 1fr; /* ← スマホでは1列 */
  }
}
