/* マイページ - カテゴリ設定タブ専用CSS */

.category-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  background: transparent;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  transition: all 0.2s ease;
}

.category-item:hover {
  background: rgba(245, 248, 255, 0.6);
  border-bottom-color: rgba(94, 200, 216, 0.25);
}

.category-item:last-child {
  border-bottom: none;
}

.category-item-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #dde1f3;
  border-radius: 8px;
  font-size: var(--fs-14);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-item-input:hover {
  border-color: rgba(94, 200, 216, 0.4);
}

.category-item-input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 200, 216, 0.1);
}

.category-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-edit-category,
.btn-delete-category {
  padding: 8px 16px;
  border: 1px solid;
  border-radius: 8px;
  font-size: var(--fs-13);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-edit-category {
  background: rgba(245, 248, 255, 0.8);
  border-color: rgba(94, 200, 216, 0.3);
  color: rgba(94, 200, 216, 0.9);
}

.btn-edit-category:hover {
  background: rgba(94, 200, 216, 0.1);
  border-color: rgba(94, 200, 216, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(94, 200, 216, 0.2);
}

.btn-delete-category {
  background: rgba(255, 245, 248, 0.8);
  border-color: rgba(237, 84, 112, 0.3);
  color: rgba(237, 84, 112, 0.9);
}

.btn-delete-category:hover {
  background: rgba(237, 84, 112, 0.1);
  border-color: rgba(237, 84, 112, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(237, 84, 112, 0.2);
}

.btn-add-category {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, 
    rgba(94, 200, 216, 0.15) 0%,
    rgba(143, 140, 243, 0.12) 100%);
  border: 1px solid rgba(94, 200, 216, 0.3);
  color: rgba(94, 200, 216, 0.9);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(94, 200, 216, 0.15);
}

.btn-add-category-floating {
  display: none;
}

.btn-add-category:hover {
  background: linear-gradient(135deg, 
    rgba(94, 200, 216, 0.2) 0%,
    rgba(143, 140, 243, 0.15) 100%);
  border-color: rgba(94, 200, 216, 0.4);
  box-shadow: 0 4px 12px rgba(94, 200, 216, 0.25);
  transform: translateY(-1px);
}

.btn-add-category:active {
  transform: translateY(0);
}

/* モバイル対応 */
@media (max-width: 768px) {
  .category-list {
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 80px;
  }

  .category-item {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 4px;
  }

  .category-item-input {
    width: 100%;
    padding: 6px 10px;
    font-size: var(--fs-13);
  }

  .category-item-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 3px;
  }

  .btn-edit-category {
    display: none;
  }

  .btn-delete-category {
    padding: 5px 12px;
    font-size: var(--fs-11);
    width: auto;
    min-width: 55px;
  }

  .btn-add-category {
    display: none;
  }
  
  .btn-add-category-floating {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(80px + max(8px, env(safe-area-inset-bottom)));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
      rgba(94, 200, 216, 0.2) 0%,
      rgba(143, 140, 243, 0.15) 100%);
    border: 2px solid rgba(94, 200, 216, 0.3);
    color: rgba(94, 200, 216, 0.9);
    font-size: var(--fs-24);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(94, 200, 216, 0.25);
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-add-category-floating:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(94, 200, 216, 0.2);
  }

  /* カテゴリ追加モーダル（スマホ版） */
  .category-add-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .category-add-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .category-add-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.15);
  }

  .category-add-modal.is-visible {
    transform: translateY(0);
  }

  .category-add-modal::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
  }

  .category-add-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    margin-top: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .category-add-modal-title {
    font-size: var(--fs-18);
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
  }

  .category-add-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: var(--fs-24);
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
  }

  .category-add-modal-close:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
  }

  .category-add-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
  }

  .category-add-form-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .form-row-modal {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .category-name-input-modal {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: var(--fs-14);
    background: white;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }

  .category-name-input-modal:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(94, 200, 216, 0.1);
  }

  .btn-add-category-modal {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: var(--fs-14);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, var(--mint), rgba(143, 140, 243, 0.9));
    color: white;
    box-shadow: 0 2px 8px rgba(94, 200, 216, 0.25);
    margin-top: 8px;
  }

  .btn-add-category-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 200, 216, 0.35);
  }

  .btn-add-category-modal:active {
    transform: translateY(0);
  }
}

/* PC版ではモーダルを非表示 */
@media (min-width: 769px) {
  .category-add-modal-overlay,
  .category-add-modal {
    display: none !important;
  }
}

