/* =====================
   基本設定
===================== */
:root {
  --lilac: #c8b4d4;
  --lilac-main: #c8a2c8;
  --lilac-light: #f3edf7;
  --lilac-dark: #9a83b0;
  --text-main: #222;
  --text-sub: #666;
  --white: #fff;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: var(--white);
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: #7a96d3;
}

a:hover {
  opacity: 0.85;
}


h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
}

h2 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 22px;
}

/* =====================
   共通レイアウト
===================== */
html, body {
  height: 100%;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 88px;
  background: var(--lilac);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-title {
  font-size: 30px;
  font-weight: 500;
}

.app-main {
  flex: 1;
  padding-bottom: 80px;
  background: var(--white);
}

.app-main::after {
  content: "";
  display: block;
  height: 40px;
  background: linear-gradient(to bottom, transparent, #fff);
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #c8b4d4;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  padding: 0 20px;
  box-sizing: border-box;
  z-index: 1000;
}

/* 左 */
.footer-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.footer-logo-img {
  height: 36px;
}

/* 中央 */
.footer-center {
  font-size: 14px;
  color: #fff;
  text-align: center;
}


.footer-icon {
  justify-self: end;
  font-size: 34px;
  color: #fff;
  cursor: pointer;
  z-index: 1100;
  line-height: 1;
}

.footer-icon:hover {
  transform: scale(1.1);
}

/* 既存containerを使っているページ用 */
.container {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 0 120px 0;
}

/* =====================
   ボタン
===================== */
.button,
input[type="submit"],
button {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background-color: var(--lilac-main);
  color: white;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.button:hover,
input[type="submit"]:hover,
button:hover {
  opacity: 0.9;
}

.primary-button {
  background: var(--lilac-main);
  color: #fff;
}

.secondary-button {
  background: var(--lilac-light);
  color: #7a4f7a;
}

.danger-button {
  background: #fff0f0;
  color: #c44;
}

form.button_to {
  display: inline-block;
  margin: 0;
}

/* =====================
   フォーム
===================== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  background-color: white;
}

.form-note {
  margin: 6px 0 10px;
  font-size: 14px;
  color: var(--text-sub);
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* =====================
   カード
===================== */
.card {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

/* =====================
   場所一覧
===================== */
.places-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.place-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.place-card {
  position: relative;
  background: #fff;
  border: 1px solid #a7a3a7;
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.place-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(200, 162, 200, 0.25);
}

.place-thumbnail {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  cursor: pointer;
}

.place-thumbnail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3edf7;
  color: #999;
  font-size: 14px;
}

.place-name-overlay {
  position: absolute;
  left: 22px;
  bottom: 3px;
  color: #111;
  font-size: 22px;
  text-decoration: none;
  text-shadow:
    1px 1px 0 #fff,
    -1px 1px 0 #fff,
    1px -1px 0 #fff,
    -1px -1px 0 #fff;
  z-index: 2;
}

.place-edit-button {
  position: absolute;
  top: 18px;
  right: 64px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(200, 162, 200, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.place-edit-button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.place-delete-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  cursor: pointer;
  z-index: 2;
  font-size: 0;
}

.place-delete-button::before,
.place-delete-button::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  left: 9px;
  top: 17px;
}

.place-delete-button::before {
  transform: rotate(45deg);
}

.place-delete-button::after {
  transform: rotate(-45deg);
}

/* 編集ボタン */
.place-edit-button {
  position: absolute;
  top: 18px;
  right: 64px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(200, 162, 200, 0.85);
  color: #fff;
  text-align: center;
  line-height: 36px;
  text-decoration: none;
  font-size: 18px;
  z-index: 2;
}

.place-edit-button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

/* 削除ボタン */
.place-delete-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  font-size: 0;
  z-index: 2;
}

.place-delete-button::before,
.place-delete-button::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.place-delete-button::before {
  transform: rotate(45deg);
}

.place-delete-button::after {
  transform: rotate(-45deg);
}

.place-delete-button:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
}

.place-delete-button:active {
  transform: scale(0.92);
  opacity: 0.8;
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.empty-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.empty-text {
  color: var(--text-sub);
  margin-bottom: 24px;
}

/* =====================
   画像・モーダル
===================== */
.item-image {
  margin-bottom: 16px;
}

.item-image img {
  border-radius: 8px;
  border: 1px solid #ddd;
}

.js-image {
  cursor: zoom-in;
}

.preview-image {
  width: 200px;
  border-radius: 12px;
  object-fit: cover;
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal.is-open {
  display: flex;
  opacity: 1;
}

.modal-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.modal.is-open .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 1000;
}

/* =====================
   フラッシュメッセージ
===================== */
.flash-message {
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
  font-size: 14px;
}

.flash-message.notice {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.flash-message.alert,
.alert-error {
  background-color: #fdecea;
  color: #b71c1c;
  border: 1px solid #f5c2c7;
}

/* =====================
   追加ボタンを下中央
===================== */

.fixed-add-button-wrap {
  margin-top: 24px;
  margin-bottom: 40px;
  text-align: center;
}

.large-add-button {
  font-size: 22px;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =====================
   編集画面
===================== */
.page-title {
  margin-bottom: 24px;
  font-size: 28px;
  color: #333;
}

.btn-primary {
  background: var(--lilac-main);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-secondary {
  color: var(--text-sub);
  text-decoration: none;
}

/* =====================
   places
===================== */
.place-detail-page {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 32px;
}

.items-area {
  min-width: 0;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.item-card {
  position: relative;
  background: #fff;
  border: 1px solid #a7a3a7;
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
}

.item-thumbnail {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.item-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;   /* ← 小さく */
  height: 28px;  /* ← 小さく */
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  font-size: 0;
}

.item-delete-button::before,
.item-delete-button::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  left: 7px;
  top: 13px;
}

.item-delete-button::before {
  transform: rotate(45deg);
}

.item-delete-button::after {
  transform: rotate(-45deg);
}
.place-side-panel {
  background: #f7f1f8;
  padding: 24px;
  min-height: calc(100vh - 148px);
}

.side-place-card {
  position: relative;
  background: #fff;
  padding: 8px;
  border-radius: 14px;
  margin-bottom: 28px;
}

.side-place-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.side-place-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3edf7;
  color: #999;
}

.side-place-name {
  display: block;
  text-align: center;
  color: #111;
  font-size: 22px;
  font-weight: bold;
}

.back-link {
  display: block;
  text-align: center;
  font-size: 18px;
  color: #046eb8;
}





/* =====================
   スマホ対応
===================== */
@media (max-width: 600px) {
  .app-header {
    height: 72px;
  }

  .app-title {
    font-size: 24px;
  }

  .app-main {
    padding: 20px 16px;
  }

  .app-footer {
    height: 56px;
    padding: 0 18px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .place-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .place-image-link {
    height: 220px;
  }
}

@media (max-width: 800px) {
  .place-detail-page {
    grid-template-columns: 1fr;
  }

  .place-side-panel {
    order: -1;
    min-height: auto;
  }

  .side-place-card {
    max-width: 220px;
  }
}


/* =====================
   スライド対応
===================== */

.side-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  z-index: 1000;
}

.side-menu.open {
  right: 0;
}

.side-menu-content {
  padding: 24px;
}

.menu-item {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
  color: #333;
  font-size: 16px;
}

.side-menu .button_to {
  display: block;
  margin: 0;
}

.side-menu .button_to button,
.side-menu .menu-item {
  display: block;
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid #eee;
  background: none;
  color: #333;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

/* =====================
   アイテムチェックボタン
===================== */
.item-check-button {
  position: absolute;
  bottom: 18px;
  left: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: rgba(58, 58, 58, 0.45);
  cursor: pointer;
  z-index: 2;
}

.item-check-button::before {
  content: "";
  position: absolute;
  left: 11px;
  bottom: 6px;
  width: 14px;
  height: 24px;
  border-right: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(45deg);
  opacity: 0;
}

.item-check-button.is-checked {
  background: rgba(0, 0, 0, 0.65);
}

.item-check-button.is-checked::before {
  opacity: 1;
}

.item-count-box {
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
  font-size: 15px;
  color: #333;
}

.item-count-box p {
  margin: 6px 0;
}

/* =====================
   ログイン画面
===================== */
.auth-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 24px;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-links {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.auth-links a {
  color: #046eb8;
  font-size: 14px;
}

.auth-page {
  min-height: calc(100vh - 88px - 60px);
  display: flex;
  flex-direction: column;   /* ← ロゴを上部に表示 */
  align-items: center;
  justify-content: center;
}

.auth-logo {
  margin-bottom: 40px;
  text-align: center;  /* テキストも中央揃え */
}

.auth-logo-image {
  align-items: center;
  width: 250px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  padding: 32px 28px;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(200, 162, 200, 0.25);
}

.container {
  padding-bottom: 120px;
}

/* =====================
  チェック
===================== */

.item-card.checked img {
  opacity: 0.4;
}

.item-card.checked::after {
  content: "✔ 確認済み";
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #000;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
}

.form-actions {
  margin-top: 16px;
  justify-content: center;
}
