/* モバイル */
html {
  font-size: 14px;
}

/* タブレット以上 */
@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

/* PC以上 */
@media (min-width: 1200px) {
  html {
    font-size: 16px;
  }
}

/* ベースフォント */
body {
  font-family:
    "Inter",
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
  height: 100svh;
}

:root {
  --mobile-footer-height: 48px;
  --mobile-footer-main-gap: 0px;
  --mobile-footer-action-gap: 16px;
  --mobile-safe-area-offset: env(safe-area-inset-bottom);
  --mobile-footer-main-offset: calc(
    var(--mobile-footer-height) + var(--mobile-footer-main-gap) + var(--mobile-safe-area-offset)
  );
  --mobile-footer-action-offset: calc(
    var(--mobile-footer-height) + var(--mobile-footer-action-gap) + var(--mobile-safe-area-offset)
  );
}

/* common */
::-webkit-scrollbar {
  display: none;
}

/* Chrome, Safari, Edge, Opera */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

/* Internet Explorer */
input[type="text"]::-ms-clear,
input[type="search"]::-ms-clear {
  display: none;
}

input[type="date"] {
  background-color: white;
  color: black;
  /* Safariのアウトラインを削除する場合 */
  -webkit-appearance: none;
  border: 1px solid grey;
  border-radius: 4px;
  padding: 5px;
}

.btn-dark-design {
  border-color: black;
  white-space: nowrap;
  width: auto;
}

.btn-light-design {
  border-color: black;
  white-space: nowrap;
  width: auto;
}

/* スピナー */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 999;
}

body.loading #loading {
  display: flex;
}

/* 通信中だけ表示 */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #ddd;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* header */
header {
  position: fixed;
  margin: 0;
  z-index: 200;
  width: 100%;
  height: 48px;
  top: 0;
  left: 0;
  background: #ffffff;
  border-bottom: 1px solid #6c757d;
}

/* PC */
@media (min-width: 768px) {
  header {
    height: 56px;
  }
}

.header-logo {
  display: block;
  position: relative;
  text-decoration-line: none;
  white-space: nowrap;
  font-size: 1.2rem;
  color: rgb(33, 37, 41);
  text-align: left;
}

.header-nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  margin-left: 1.2rem;
}

.header-nav-link:first-child {
  margin-left: 0;
}

.header-nav-link:hover {
  text-decoration: none;
}

.header-nav-link.is-active {
  color: #222;
  font-weight: 600;
  border-bottom: 2px solid #222;
  padding-bottom: 2px;
}

.header-nav-link.is-active i {
  color: inherit;
}

.mobile-footer-item.is-active {
  color: #222;
  font-weight: 600;
}

.mobile-footer-item.is-active i {
  color: inherit;
}

.mobile-footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-footer-height);
  background: #ffffff;
  border-top: 1px solid #dddddd;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
  font-size: 11px;
  /* フッター本体はクリック不可にし、子要素リンクのみクリック可能にする */
  pointer-events: none;
}

.mobile-footer-item {
  flex: 1;
  text-decoration: none;
  color: #555555;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: auto;
}

.mobile-footer-label {
  line-height: 1.1;
}

.header-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-right: 4px;
}

.footer-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1rem;
}

.nav-chat-status-unread {
  position: absolute;
  top: -3px;
  right: -6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #1d63d8;
  box-shadow: 0 0 0 2px #ffffff;
}

.header-user {
  display: flex;
  margin: 0 5px;
  padding: 0;
  border-style: none;
}

.header-user-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* PC */
@media (min-width: 768px) {
  .header-user-icon {
    width: 36px;
    height: 36px;
  }
}

.header-help-icon {
  position: relative;
  padding: 0;
  border-style: none;
}

.dropdown-menu-icon {
  display: flex;
  padding: 0;
  border-style: none;
}

.dropdown-item {
  left: 0;
}

.dropdown-icon {
  width: 24px;
}

.dropdown-copyright {
  font-size: 0.8rem;
}

.window-close {
  margin: 10px;
  height: 30px;
}

.dropdown-menu .dropdown-item:active,
.dropdown-menu .dropdown-item:focus {
  background-color: transparent !important;
  color: inherit;
  outline: none;
}

.dropdown-menu .dropdown-item:hover {
  background-color: transparent;
}

nav {
  height: 100%;
  width: 100%;
}

main {
  padding-top: 48px;
  padding-bottom: var(--mobile-footer-main-offset);
  background-color: white;
}

/* PC */
@media (min-width: 768px) {
  main {
    padding-top: 56px;
    padding-bottom: 0;
  }
}

.btn-close:focus,
.btn-close:focus-visible {
  outline: none;
  box-shadow: none;
}

/* エラーメッセージ */

ul.errorlist {
  margin: 0;
  padding: 0;
}

ul.errorlist li {
  color: red;
  display: block;
  text-align: left;
  font-size: 0.8rem;
}

ul.infolist {
  margin-top: 5px;
  margin-bottom: 20px;
  padding: 0;
}

ul.infolist li:before {
  content: "* ";
}

ul.infolist li {
  display: block;
  text-align: left;
  font-size: 0.8rem;
}

.label-required {
  color: orangered;
  font-size: 0.8rem;
}

/* フォーム */

#id_room_name {
  max-width: 100%;
  width: 500px;
}

#id_room_description {
  max-width: 100%;
  width: 500px;
  height: 100%;
  resize: none;
}

#id_user_address {
  max-width: none;
  width: 100%;
}

#id_user_profile {
  width: 100%;
}

#id_nick_name {
  max-width: 100%;
  width: 500px;
}

/* 画面共通 */

.main-common-container {
  max-width: 500px;
  margin: 30px auto;
  padding: 0 20px;
}

.common-container {
  position: relative;
  border-width: 0;
  border-style: none;
  height: 100%;
  width: 100svw;
  max-width: 760px;
  display: flex;
  flex-direction: column;
}

/* PC */
@media (min-width: 768px) {
  .common-container {
    border-width: 1px;
    border-style: solid;
    border-top: none;
    border-bottom: none;
  }
}

.common-content-container {
  padding: 20px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.common-info-content-container {
  padding: 0 20px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.common-select-box {
  width: auto;
}

.common-content {
  margin-top: 10px;
  margin-bottom: 10px;
  width: 100%;
  position: relative;
}

.common-edit-content {
  margin-top: 20px;
  margin-bottom: 20px;
  width: 100%;
  position: relative;
}

.edit-delete-action {
  margin: 30px 0;
  padding-bottom: var(--mobile-footer-action-offset);
}

/* PC */
@media (min-width: 768px) {
  .edit-delete-action {
    padding-bottom: 0;
  }
}

.common-content2 {
  margin-top: 10px;
  width: 100%;
  position: relative;
}

/* 編集画面共通 */

.common-container-header {
  position: relative;
  padding-top: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #6c757d;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.common-container-header-title {
  white-space: nowrap;
  font-size: 1.2rem;
  color: rgb(33, 37, 41);
}

.common-container-header-button {
  display: block;
  position: relative;
  text-decoration-line: none;
  font-size: 1rem;
  text-align: center;
  border-radius: 50px;
  margin-left: 20px;
  margin-right: 20px;
}

.edit-common-main {
  padding: 20px;
}

.edit-common-notice-label {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
  font-weight: bold;
}

.card-container {
  position: relative;
  padding-bottom: 20px;
}

.card-content {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.card-thumb {
  position: relative;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.card-title-clamp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.card-desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  word-wrap: break-word;
}

.card-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc-toggle {
  font-size: 0.8rem;
  white-space: nowrap;
}

.card-desc-toggle::before {
  content: "…";
}

.card-user-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
}

.card-user-text {
  flex: 1 1 auto;
  min-width: 0;
}

.card-user-label {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.1;
}

.card-user-name {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.card-user-badge-empty {
  background: #f7f7f7;
  color: #888;
  border: 1px solid #eee;
  font-weight: 500;
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.card-footer {
  border-top: none;
  background: transparent;
}

.card-like-btn {
  background-color: #ffffff;
  width: 100%;
  font-size: 0.8rem;
}

.card-like-btn:hover {
  background-color: #f3f3f3;
}

.card-like-btn:active {
  background-color: #eaeaea;
}

.card-heart-liked {
  color: #e79cae;
}

.card-footer-link {
  margin-top: auto;
}

.card-footer-actions {
  display: inline-flex;
  align-items: center;
}

/* イメージモーダル */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 999;
}

.image-modal-content {
  text-align: center;
  background-color: white;
}

.crop-image {
  max-width: 85svw;
  max-height: 85svh;
}

/* メッセージモーダル */
.message-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2100;
  justify-content: center;
  align-items: center;
}

.message-modal:not([hidden]) {
  display: flex;
}

.message-modal-content {
  background-color: white;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 15, 15, 0.12);
}

.message-modal-message {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.message-modal-icon {
  display: flex;
  color: #999;
  font-size: 1.5rem;
  align-self: center;
  align-items: center;
  justify-content: center;
}

.message-modal-message-body {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
}

.message-modal-guide-link {
  color: #6c757d;
  text-decoration: underline;
  text-decoration-color: rgba(108, 117, 125, 0.35);
}

.message-modal-guide-link:hover {
  color: #6c757d;
  text-decoration: underline;
  text-decoration-color: #6c757d;
}

.message-modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 0.8rem;
}

.message-modal-footer button {
  min-width: 6rem;
}

.message-modal-cancel-btn {
  margin-right: 8px;
}

.feed-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #f2f2f2;
  color: #0f0f0f;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
}

/* PC */
@media (min-width: 768px) {
  .feed-tab {
    font-size: 0.9rem;
  }
}

.feed-tab:hover {
  background: #e5e5e5;
  text-decoration: none;
}

.feed-tab.is-active {
  background: #0f0f0f;
  color: #ffffff;
}

.search-form {
  width: 100%;
}

.header-search {
  position: relative;
  width: 100%;
  margin: 0;
}

/* PC */
@media (min-width: 768px) {
  .header-search {
    width: 420px;
    margin-left: auto;
    margin-right: 0;
  }
}

.header-search input[type="text"],
.header-search input[type="search"],
.header-search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 34px;
  border: 1px solid #e3e3e3;
  border-radius: 9999px;
  background: #f7f7f7;
  font-size: 0.88rem;
  color: #333;
  outline: none;
  box-shadow: none;
}

.header-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #a0a0a0;
  font-size: 0.9rem;
  line-height: 1;
  pointer-events: none;
}

.common-info-main-action {
  border: 1px solid #1f1f1f;
  background: rgba(255, 255, 255, 0.95);
  color: #1f1f1f;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  padding: 9px 14px;
}

.common-info-sub-action {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #cfcfcf;
  background: rgba(255, 255, 255, 0.95);
  color: #1f1f1f;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 0;
}

/* PC */
@media (min-width: 768px) {
  .common-info-sub-action {
    width: 36px;
    height: 36px;
  }
}

.common-info-main-action:hover {
  border-color: #000;
  background: #fafafb;
  color: #000;
}

.common-info-sub-action:hover {
  border-color: #000;
  background: #f5f5f6;
  color: #000;
}

.common-delete-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.common-delete-icon:hover {
  background: rgba(0, 0, 0, 0.72);
}

.common-delete-icon:active {
  transform: scale(0.96);
}

.common-delete-icon i {
  font-size: 14px;
}

/* PWA インストールバナー */
#pwa-banner {
  display: none;
  position: fixed;
  bottom: 48px;
  left: 0;
  right: 0;
  z-index: 2000;
  background: #0f0f0f;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: "Inter", sans-serif;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
  #pwa-banner {
    bottom: 0;
  }
}

#pwa-banner.is-visible {
  display: flex;
}

.pwa-banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.pwa-banner-icon {
  border-radius: 9px;
  flex-shrink: 0;
}

.pwa-banner-text {
  min-width: 0;
}

.pwa-banner-app-name {
  font-weight: 600;
  font-size: 0.9rem;
}

#pwa-banner-msg {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  white-space: normal;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#pwa-install-btn {
  display: none;
  background: #fff;
  color: #0f0f0f;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

#pwa-install-btn.is-visible {
  display: inline-block;
}

#pwa-dismiss-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
