/* ====== リセット & ベース ====== */
* {
  box-sizing: border-box;
}

header {
  position: sticky;
  z-index: 1000;

  background: #1f2937;
  color: #fff;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: bold;
}

header a {
  text-decoration: none; /* 下線を消す */
  color: inherit;        /* 親要素の色を使う */
}

a:visited,
a:hover,
a:active {
  text-decoration: none;
  color: inherit;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans JP", sans-serif;
  background: #f4f6f8;
  color: #333;
  overflow-y: hidden;
}

#title {
  margin: 20px 10px;
}

h3 {
  margin-top: 0;
}

/* ====== レイアウト ====== */
.container {
  display: flex;
  height: calc(100vh - 136px);
}

/* ====== サイドバー ====== */
.sidebar {
  width: 260px;
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
  padding: 16px;
  overflow-y: auto;
}

.sidebar h3 {
  margin-bottom: 12px;
  font-size: 18px;
  background-color: #fff;
}

#shopList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#shopList li {
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#shopList li:hover {
  background-color: #eef3f7;
}

/* ====== メイン ====== */
.main {
  flex: 1;
  padding: 0 20px 20px 20px;
  overflow-y: auto;
}

/* ====== 検索エリア ====== */
.main input[type="text"] {
  width: 280px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.main button {
  margin-left: 8px;
  padding: 8px 14px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #4f7cff;
  color: white;
  transition: background-color 0.2s;
}

.main button:hover {
  background-color: #3d66d6;
}

.input-container {
  display: flex;
  align-items: center; /* 縦位置を揃える */
  flex-wrap: wrap;     /* 画面が狭い時は折り返す */
}

.input-container input {
  width: 220px;
  margin-left: 30px;
  padding: 8px;
}

.input-container select {
  width: 150px;
  margin-left: 8px;
  padding: 8px;
}

.input-container label {
  display: block;
  margin-bottom: 6px;
  padding-top: 3px;
  font-weight: 600;
}

select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
  background: white;
}

select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ====== 詳細 + 地図 ====== */
.detail-map-container {
  display: flex;
  margin-top: 20px;
  gap: 20px;
}

/* ====== 詳細カード ====== */
.left {
  flex: 0 0 580px; /* 最低限の幅 */
  max-width: 520px;
}

.detail {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}


#shop-detail h2 {
  font-size: 22px;
}

#shop-detail p {
  margin: 6px 0;
  font-size: 16px;
}

#shop-opening-hours {
  padding-left: 18px;
  font-size: 16px;
}

#shop-opening-hours li {
  margin-bottom: 4px;
}

/* ====== DB状態表示 ====== */
#dbStatus {
  width: 80px;
  text-align: center;
  font-size: 14px;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #fff;
}

#dbStatus.saved {
  background-color: #2fa135;
}

#dbStatus.unsaved {
  background-color: #f81111;
}

/* ====== 地図エリア ====== */
#right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#map {
  width: 100%;
  height: 380px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* ====== PDF入力 ====== */
.pdf-inputs {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  height: 290px;
}

.pdf-inputs label {
  font-size: 14px;
}

.pdf-inputs input{
  margin-left: 6px;
  margin-right: 10px;
  padding: 6px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.input-note, .input-staff {
  display: flex;
  align-items: flex-start;
}

.input-note textarea, .input-staff textarea {
  margin-left: 6px;
  margin-right: 10px;
  padding: 6px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  resize: none;
}

#weekday-display {
  margin-left: 8px;
  font-weight: bold;
}

/* ====== ボタン群 ====== */
#button {
  display: flex;
  gap: 10px;
}

#button button {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
}

#outputBtn {
  background-color: #f4f6f8;
  border: 2px solid #2e7d32;
  color: #2e7d32;
  transition: all 0.25s ease;
}

#outputBtn:hover {
  background-color: #2e7d32;
  color: #fff;
}

#addBtn, #updateBtn {
  background-color: #f4f6f8;
  border: 2px solid #4f7cff;
  color: #4f7cff;
  transition: all 0.25s ease;
}

#addBtn:hover, #updateBtn:hover {
  background-color: #4f7cff;
  color: #fff;
}

#deleteBtn {
  background-color: #f4f6f8;
  border: 2px solid #d32f2f;
  color: #d32f2f;
  transition: all 0.25s ease;
}

#deleteBtn:hover {
  background-color: #d32f2f;
  color: #fff;
}

#button button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* ローディング全画面 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  color: #333;

  animation: fadeIn 0.2s ease;
}

/* 非表示用 */
.loading-overlay.hidden {
  display: none;
}

/* スピナー */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #ddd;
  border-top: 4px solid #333;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ====== レスポンシブ ====== */
@media (max-width: 1100px) {
  .detail-map-container {
    flex-direction: column;
  }

  .detail {
    width: 100%;
  }

  #map {
    height: 300px;
  }
}

footer {
  text-align: center;
  padding: 16px;
  color: #777;
  font-size: 12px;
}