/* 釣具管理ページのスタイル */

.tackle-page {
  background-color: #f0f2f5;
  min-height: 100vh;
  padding-bottom: 80px;
  overflow-x: hidden;
}

.tackle-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  overflow-x: hidden;
  box-sizing: border-box;
  width: 100%;
}

.tackle-container .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  gap: 12px;
}

.tackle-container .page-header .btn {
  flex-shrink: 0;
}

.tackle-container .page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1c1e21;
  margin: 0;
}

/* 上限バッジ */
.limit-reached-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background-color: #f0f2f5;
  color: #65676b;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #dddfe2;
}

/* ボタンスタイル */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  border: none;
  max-width: 100%;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: #1877f2;
  color: #fff;
}

.btn-primary:hover {
  background-color: #166fe5;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: #65676b;
  transition: background-color 0.2s, color 0.2s;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-icon:hover {
  background-color: #f0f2f5;
}

.btn-icon.btn-edit {
  color: #1877f2;
}

.btn-icon.btn-edit:hover {
  background-color: #e7f3ff;
}

.btn-icon.btn-delete {
  color: #65676b;
}

.btn-icon.btn-delete:hover {
  background-color: #ffebe6;
  color: #fa383e;
}

/* 種別セクション */
.tackle-type-section {
  margin-bottom: 24px;
}

.tackle-type-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #65676b;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dddfe2;
}

.tackle-type-icon {
  width: 20px;
  height: 20px;
  color: #1877f2;
}

/* 釣具カード（グリッド表示） */
.tackle-items-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tackle-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tackle-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tackle-manufacturer {
  font-size: 12px;
  color: #65676b;
}

.tackle-name {
  font-size: 15px;
  font-weight: 500;
  color: #1c1e21;
}

.tackle-original-name {
  font-size: 12px;
  color: #8a8d91;
}

.tackle-item-actions {
  display: flex;
  gap: 4px;
}

/* タックルセットカード */
.tackle-sets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tackle-set-card {
  background-color: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tackle-set-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.tackle-set-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1c1e21;
  margin: 0;
}

.tackle-set-actions {
  display: flex;
  gap: 4px;
}

.tackle-set-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tackle-set-item-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.item-type-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #1877f2;
  background-color: #e7f3ff;
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 60px;
  text-align: center;
}

.item-type-icon {
  width: 14px;
  height: 14px;
}

.tackle-set-item-group .item-name {
  font-size: 14px;
  color: #1c1e21;
}

.item-with-memo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-memo {
  font-size: 12px;
  color: #65676b;
  font-style: italic;
  padding-left: 4px;
  border-left: 2px solid #dddfe2;
  margin-left: 2px;
}

.tackle-set-usage {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f2f5;
}

.usage-count {
  font-size: 12px;
  color: #65676b;
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background-color: #fff;
  border-radius: 8px;
}

.empty-icon {
  font-size: 48px;
  color: #dddfe2;
  margin-bottom: 16px;
}

.empty-state p {
  color: #65676b;
  margin-bottom: 16px;
}

.empty-hint {
  font-size: 14px;
  color: #8a8d91;
  margin-bottom: 12px !important;
}

/* 戻るリンク */
.back-link-container {
  margin-top: 24px;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1877f2;
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

/* フォームページ */
.tackle-form-page .login-container {
  max-width: 500px;
}

.tackle-form-container {
  max-width: 600px;
}

.form-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1c1e21;
  margin-bottom: 24px;
  text-align: center;
}

.form-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #dddfe2;
  border-radius: 6px;
  font-size: 16px;
  background-color: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #dddfe2;
  border-radius: 6px;
  font-size: 16px;
  background-color: #fff;
  box-sizing: border-box;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  font-weight: normal;
}

/* タックル追加フォーム */
.tackle-add-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* セクションラッパー（マスターセクション内の間隔） */
.tackle-sections-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tackle-form-section {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.tackle-form-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background-color: #f7f8fa;
  border-bottom: 1px solid #e4e6eb;
}

.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: #e7f3ff;
  border-radius: 6px;
  color: #1877f2;
  font-size: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1e21;
}

/* フィルターグリッド */
.tackle-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.tackle-filter-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #65676b;
}

.filter-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #1877f2;
}

.filter-icon {
  width: 16px;
  height: 16px;
}

/* 製品選択 */
.tackle-product-select {
  padding: 16px;
}

.product-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #65676b;
  margin-bottom: 8px;
}

.product-select {
  font-size: 15px;
}

/* カスタマイズフィールド */
.tackle-personal-fields {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tackle-personal-fields .form-field {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: normal;
  color: #65676b;
  margin-bottom: 8px;
}

.field-label i {
  color: #1877f2;
  font-size: 12px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: #8a8d91;
  margin-top: 4px;
}

.form-actions {
  margin-top: 8px;
}

.form-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

.form-actions .btn-disabled,
.form-actions .btn:disabled {
  background-color: #bcc0c4;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.7;
}

.form-actions .btn-disabled:hover,
.form-actions .btn:disabled:hover {
  background-color: #bcc0c4;
}

/* 現在のタックル表示 */
.current-tackle-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background-color: #f7f8fa;
  border-radius: 6px;
}

.tackle-type-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: #1877f2;
  background-color: #e7f3ff;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}

.tackle-full-name {
  font-size: 15px;
  font-weight: 500;
  color: #1c1e21;
}

/* タックルセットフォーム */
.tackle-set-form-container {
  max-width: 600px;
}

.tackle-select-section {
  margin-bottom: 20px;
}

.tackle-select-section > label {
  display: block;
  font-weight: 600;
  color: #1c1e21;
  margin-bottom: 8px;
}

.tackle-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tackle-section-label .tackle-type-icon {
  width: 18px;
  height: 18px;
}

/* 編集画面の読み取り専用タックル表示 */
.tackle-readonly-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background-color: #f7f8fa;
  border-radius: 6px;
}

.tackle-readonly-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tackle-readonly-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #1877f2;
}

.tackle-readonly-icon .tackle-type-icon {
  width: 18px;
  height: 18px;
}

.tackle-readonly-manufacturer {
  font-size: 12px;
  font-weight: 500;
  color: #1877f2;
  background-color: #e7f3ff;
  padding: 2px 8px;
  border-radius: 3px;
}

.tackle-readonly-name {
  font-size: 13px;
  color: #1c1e21;
  background-color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
}

.tackle-readonly-notice {
  font-size: 12px;
  color: #65676b;
  margin-top: 8px;
}

.tackle-select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background-color: #f7f8fa;
  border-radius: 6px;
}

.tackle-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tackle-checkbox-label:hover {
  background-color: #f0f2f5;
}

.tackle-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tackle-checkbox-label input[type="checkbox"]:checked + .tackle-checkbox-text {
  color: #1877f2;
}

.tackle-checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tackle-checkbox-text .manufacturer {
  font-size: 12px;
  color: #65676b;
}

.tackle-checkbox-text .name {
  font-size: 14px;
  color: #1c1e21;
}

.empty-notice {
  font-size: 14px;
  color: #8a8d91;
  padding: 12px;
  text-align: center;
}

/* 釣果投稿フォームのタックルセット選択 */
.tackle-set-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tackle-set-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: #f7f8fa;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tackle-set-option:hover {
  background-color: #e7f3ff;
}

.tackle-set-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tackle-set-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.tackle-set-info .tackle-set-name {
  font-size: 14px;
  font-weight: 500;
  color: #1c1e21;
}

.tackle-set-info .tackle-set-summary {
  font-size: 12px;
  color: #65676b;
}

/* 編集画面のタックルアイテムグリッド */
.tackle-items-grid-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}

.tackle-item-card-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 6px 4px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e4e6eb;
  min-width: 0;
  height: 56px;
  justify-content: center;
}

.tackle-item-icon-edit {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f8fa;
  border-radius: 4px;
}

.tackle-card-icon-edit {
  width: 14px;
  height: 14px;
  fill: #65676b;
}

.tackle-item-name-edit {
  font-size: 11px;
  font-weight: 600;
  color: #1c1e21;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 釣果詳細のタックル表示 */
.used-tackle-section {
  border-top: 1px solid #e0e0e0;
  padding-top: 10px;
  margin-top: 5px;
}

.used-tackle-section h3 {
  font-size: 1.1em;
  margin-bottom: 8px;
  color: #1c1e21;
}

.tackle-set-display {
  background-color: #f0f2f5;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.tackle-set-display:last-child {
  margin-bottom: 0;
}

.tackle-set-display .tackle-set-name {
  font-weight: bold;
  font-size: 0.9em;
  color: #606770;
  display: block;
  margin-bottom: 8px;
}

.tackle-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tackle-items-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tackle-items-list .item-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #1877f2;
  background-color: #e7f3ff;
  padding: 2px 6px;
  border-radius: 3px;
  min-width: 50px;
  text-align: center;
}

.tackle-items-list .item-type-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1877f2;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tackle-list-icon {
  width: 18px;
  height: 18px;
}

.tackle-items-list .item-manufacturer {
  font-size: 11px;
  font-weight: 500;
  color: #1877f2;
  background-color: #e7f3ff;
  padding: 2px 8px;
  border-radius: 3px;
}

.tackle-items-list .item-name {
  font-size: 12px;
  font-weight: 500;
  color: #1c1e21;
  background-color: #f0f2f5;
  padding: 2px 8px;
  border-radius: 3px;
}

/* カスタム入力切り替えセクション */
.custom-toggle-section {
  padding: 16px;
}

.custom-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 16px;
  background-color: #f7f8fa;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.custom-toggle-label:hover {
  background-color: #e7f3ff;
}

.custom-toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1877f2;
  cursor: pointer;
  flex-shrink: 0;
}

.custom-toggle-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1c1e21;
}

.custom-toggle-text i {
  color: #1877f2;
  font-size: 14px;
}

/* 非表示ユーティリティ */
.hidden {
  display: none !important;
}

/* セクション無効化スタイル */
.section-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.section-disabled .form-input,
.section-disabled .form-textarea {
  background-color: #f0f2f5;
  cursor: not-allowed;
}

/* カスタムフィールド */
.tackle-custom-fields {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tackle-custom-fields .form-field {
  margin-bottom: 0;
}

.field-icon {
  width: 14px;
  height: 14px;
}

.required-mark {
  color: #fa383e;
  margin-left: 2px;
}

/* カスタムバッジ */
.custom-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  background-color: #fa8c16;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .tackle-container {
    padding: 16px;
  }

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

  .tackle-container .page-header .btn {
    width: 100%;
    justify-content: center;
  }

  /* タックル追加フォームのレスポンシブ */
  .tackle-filter-grid {
    grid-template-columns: 1fr;
  }
}
