/* =========================
   基本設定
========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;

  background: #f4f5f7;
  color: #222;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}


/* =========================
   ログイン画面
========================= */

.login-container {
  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 420px;

  background: #ffffff;

  padding: 48px 40px;

  border-radius: 16px;

  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.08);
}

.login-box h1 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 8px;
}

.sub-title {
  text-align: center;

  color: #999;

  font-size: 11px;
  letter-spacing: 1.5px;

  margin-bottom: 40px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;

  font-size: 14px;
  font-weight: 600;

  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  height: 50px;

  padding: 0 15px;

  border: 1px solid #d8dce2;
  border-radius: 8px;

  font-size: 16px;

  outline: none;

  transition: 0.2s;
}

.form-group input:focus {
  border-color: #222;

  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.05);
}

#loginButton {
  width: 100%;
  height: 50px;

  margin-top: 8px;

  border: none;
  border-radius: 8px;

  background: #222;
  color: #fff;

  font-weight: 600;
  font-size: 16px;
}

#loginButton:hover {
  opacity: 0.88;
}

#message {
  min-height: 20px;

  margin-top: 18px;

  text-align: center;

  font-size: 14px;

  color: #c0392b;
}


/* =========================
   アプリ本体
========================= */

.app-screen {
  min-height: 100vh;
}


/* =========================
   ヘッダー
========================= */

.app-header {
  min-height: 90px;

  background: #1d1d1f;
  color: #ffffff;

  padding: 18px 5%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.header-small {
  font-size: 10px;

  letter-spacing: 1.8px;

  color: #aaa;

  margin-bottom: 4px;
}

.app-header h1 {
  font-size: 25px;
}

.logout-button {
  border: 1px solid #555;

  background: transparent;
  color: #fff;

  padding: 9px 16px;

  border-radius: 7px;

  font-size: 13px;
}

.logout-button:hover {
  background: #333;
}


/* =========================
   メイン
========================= */

.app-main {
  width: 90%;
  max-width: 1100px;

  margin: 0 auto;

  padding: 45px 0 80px;
}


/* =========================
   検索
========================= */

.search-area {
  background: #ffffff;

  padding: 28px;

  border-radius: 14px;

  box-shadow:
    0 3px 15px rgba(0, 0, 0, 0.05);

  margin-bottom: 30px;
}

.search-area > label {
  display: block;

  font-size: 15px;
  font-weight: 700;

  margin-bottom: 12px;
}

.search-box {
  display: flex;

  gap: 10px;
}

.search-box input {
  flex: 1;

  min-width: 0;

  height: 52px;

  padding: 0 16px;

  border: 1px solid #d4d7dc;
  border-radius: 8px;

  outline: none;

  font-size: 16px;
}

.search-box input:focus {
  border-color: #222;

  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.04);
}

.search-box button {
  width: 110px;

  border: none;
  border-radius: 8px;

  background: #222;
  color: #fff;

  font-weight: 600;
}

.search-box button:hover {
  opacity: 0.88;
}

.search-help {
  margin-top: 10px;

  color: #888;

  font-size: 12px;
}


/* =========================
   検索結果
========================= */

.result-area {
  margin-top: 15px;
}

.result-header {
  display: flex;

  justify-content: space-between;
  align-items: center;

  margin-bottom: 15px;
}

.result-header h2 {
  font-size: 19px;
}

#resultCount {
  font-size: 13px;

  color: #666;

  background: #e8eaed;

  padding: 5px 10px;

  border-radius: 20px;
}

.loading-message {
  padding: 30px;

  text-align: center;

  color: #777;
}

.result-list {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}


/* =========================
   枝肉カード
========================= */

.edaniku-card {
  background: #ffffff;

  border: 1px solid #e2e4e7;
  border-radius: 12px;

  padding: 22px;

  cursor: pointer;

  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.edaniku-card:hover {
  transform: translateY(-2px);

  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.08);
}

.card-top {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  gap: 15px;

  margin-bottom: 18px;
}

.eda-number-label {
  color: #888;

  font-size: 11px;

  margin-bottom: 3px;
}

.eda-number {
  font-size: 25px;
  font-weight: 700;
}

.grade-badge {
  background: #222;
  color: #fff;

  padding: 6px 10px;

  border-radius: 6px;

  font-size: 13px;
  font-weight: 700;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;

  margin-bottom: 15px;
}

.card-info {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 12px;
}

.info-label {
  display: block;

  color: #999;

  font-size: 10px;

  margin-bottom: 3px;
}

.info-value {
  font-size: 14px;
  font-weight: 500;
}


/* =========================
   詳細モーダル
========================= */

.modal {
  position: fixed;

  inset: 0;

  z-index: 1000;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 20px;
}

.modal-background {
  position: absolute;

  inset: 0;

  background: rgba(0, 0, 0, 0.55);
}

.modal-card {
  position: relative;

  z-index: 1;

  width: 100%;
  max-width: 650px;

  max-height: 90vh;

  overflow-y: auto;

  background: #ffffff;

  border-radius: 16px;

  padding: 30px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  padding-bottom: 20px;

  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  font-size: 25px;
}

.close-button {
  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: #f0f1f2;

  font-size: 24px;

  line-height: 1;
}

.close-button:hover {
  background: #e2e3e5;
}

.detail-content {
  padding-top: 25px;

  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 20px;
}

.detail-item {
  padding-bottom: 13px;

  border-bottom: 1px solid #eee;
}

.detail-label {
  color: #999;

  font-size: 11px;

  margin-bottom: 5px;
}

.detail-value {
  font-size: 15px;
  font-weight: 600;

  word-break: break-all;
}


/* =========================
   データなし
========================= */

.no-result {
  grid-column: 1 / -1;

  background: #ffffff;

  padding: 50px 20px;

  border-radius: 12px;

  text-align: center;

  color: #777;
}


/* =========================
   スマホ対応
========================= */

@media (max-width: 700px) {

  .login-box {
    padding: 38px 25px;
  }

  .app-header {
    min-height: 80px;

    padding:
      15px 20px;
  }

  .app-header h1 {
    font-size: 21px;
  }

  .header-small {
    font-size: 8px;
  }

  .logout-button {
    padding:
      8px 11px;

    font-size: 11px;
  }

  .app-main {
    width: 92%;

    padding:
      25px 0 60px;
  }

  .search-area {
    padding: 20px;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
    height: 48px;
  }

  .search-help {
    line-height: 1.6;
  }

  .result-list {
    grid-template-columns: 1fr;
  }

  .edaniku-card {
    padding: 19px;
  }

  .eda-number {
    font-size: 22px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    padding: 23px 20px;

    border-radius: 13px;
  }

  .detail-content {
    grid-template-columns: 1fr;

    gap: 14px;
  }
}
/* =========================
   絞り込み検索
========================= */

.filter-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.filter-item label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.filter-item select,
.filter-item input {
  width: 100%;
  height: 44px;
  padding: 0 12px;

  background: #fff;

  border: 1px solid #d8dce2;
  border-radius: 7px;

  font-size: 14px;
  color: #222;

  outline: none;
}

.filter-item select:focus,
.filter-item input:focus {
  border-color: #222;

  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.04);
}


/* 条件クリア */

.filter-bottom {
  display: flex;
  justify-content: flex-end;

  margin-top: 15px;
}

#clearFilterButton {
  padding: 9px 16px;

  background: #fff;
  color: #555;

  border: 1px solid #d8dce2;
  border-radius: 7px;

  font-size: 12px;
}

#clearFilterButton:hover {
  background: #f5f5f5;
}


/* =========================
   絞り込み スマホ対応
========================= */

@media (max-width: 700px) {

  .filter-area {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .filter-item select,
  .filter-item input {
    height: 46px;
    font-size: 16px;
  }

  .filter-bottom {
    justify-content: stretch;
  }

  #clearFilterButton {
    width: 100%;
    height: 44px;
  }

}
/* =========================
   検索画面 改良
========================= */

/* メイン検索欄を大きく */
.search-box input {
  height: 62px;
  padding: 0 18px;
  font-size: 17px;
}

.search-box button {
  min-height: 62px;
}


/* =========================
   絞り込み開閉ボタン
========================= */

.filter-toggle-button {
  width: 100%;

  margin-top: 22px;
  padding: 14px 16px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  background: #f7f7f7;
  color: #333;

  border: 1px solid #e1e1e1;
  border-radius: 8px;

  font-size: 14px;
  font-weight: 600;
}

.filter-toggle-button:hover {
  background: #f0f0f0;
}

#filterToggleIcon {
  font-size: 20px;
  font-weight: 400;
}

.filter-panel {
  margin-top: 5px;
}


/* =========================
   A5表示
========================= */

.grade-badge.grade-a5 {
  background: #8f3b3b;
  color: #ffffff;
}


/* =========================
   スマホ
========================= */

@media (max-width: 700px) {

  .search-box input {
    height: 60px;
    padding: 0 16px;
    font-size: 16px;
  }

  .search-box button {
    height: 52px;
    min-height: 52px;
  }

  .filter-toggle-button {
    min-height: 50px;
    font-size: 15px;
  }

}

/* =========================
   メイン検索欄 サイズ調整
========================= */

/* 「枝肉を検索」の文字 */
.search-area > label {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* 検索入力欄 */
.search-box input {
  height: 72px;
  min-height: 72px;
  padding: 0 20px;

  font-size: 17px;

  border-radius: 10px;
}

/* 検索ボタン */
.search-box button {
  min-height: 72px;
  font-size: 16px;
  border-radius: 10px;
}


/* スマホ */
@media (max-width: 700px) {

  .search-area > label {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .search-box input {
    height: 68px;
    min-height: 68px;

    padding: 0 17px;

    font-size: 16px;
  }

  .search-box button {
    height: 54px;
    min-height: 54px;
  }

}