// 선박 아이템 스타일
// dark 프로젝트 패밀리 스타일 적용

.vessel-item {
  display: flex;
  background: var(--tertiary1, rgba(0, 0, 0, 0.15));
  border: 1px solid var(--tertiary2, rgba(255, 255, 255, 0.1));
  border-radius: 0.6rem;
  margin-bottom: 0.4rem;
  padding: 0.8rem 1rem;
  cursor: grab;
  transition: all 0.2s ease;
  overflow: hidden;

  &:hover {
    background: var(--tertiary2, rgba(255, 255, 255, 0.08));
    border-color: var(--primary1, #4a9eff);
    box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2);
  }

  &.dragging {
    cursor: grabbing;
    background: var(--primary1-alpha, rgba(74, 158, 255, 0.15));
    border-color: var(--primary1, #4a9eff);
    box-shadow: 0 0.8rem 1.6rem rgba(74, 158, 255, 0.3);
    transform: rotate(3deg) scale(1.02);
    z-index: 1000;
    opacity: 0.95;
  }

  &.disabled {
    cursor: not-allowed;
    opacity: 0.5;

    &:hover {
      background: var(--tertiary1, rgba(0, 0, 0, 0.15));
      border-color: var(--tertiary2, rgba(255, 255, 255, 0.1));
      box-shadow: none;
    }
  }

  &.selected {
    background: var(--primary1-alpha, rgba(74, 158, 255, 0.1));
    border-color: var(--primary1, #4a9eff);
    box-shadow: 0 0.2rem 0.8rem rgba(74, 158, 255, 0.15);

    .vessel-name {
      color: var(--primary1, #4a9eff);
      font-weight: var(--fw-bold, 700);
    }
  }

  .vessel-item-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0 0.8rem;
  }

  .vessel-index {
    min-width: 2rem;
    font-size: var(--fs-xs, 1.1rem);
    color: var(--tertiary4, #888);
    text-align: center;
  }

  .selection-checkbox {
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;

    input[type="checkbox"] {
      display: none;
    }

    .checkmark {
      position: relative;
      width: 1.8rem;
      height: 1.8rem;
      border: 2px solid var(--tertiary3, #555);
      border-radius: 0.3rem;
      background: transparent;
      transition: all 0.2s ease;
      display: block;

      &::after {
        content: '';
        position: absolute;
        left: 0.5rem;
        top: 0.2rem;
        width: 0.5rem;
        height: 0.9rem;
        border: solid var(--white, #fff);
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        opacity: 0;
        transition: opacity 0.2s ease;
      }
    }

    input[type="checkbox"]:checked + .checkmark {
      border: solid 2px var(--primary1, #4a9eff);
      background-color: var(--primary1, #4a9eff);

      &::after {
        opacity: 1;
      }
    }

    &:hover .checkmark {
      border-color: var(--primary1, #4a9eff);
    }
  }


  .vessel-info {
    flex: 1;
    min-width: 0;

    .vessel-name {
      font-size: var(--fs-s, 1.2rem);
      font-weight: var(--fw-semibold, 600);
      color: var(--white, #fff);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: flex;
      align-items: center;
      gap: 0.6rem;

      .name-text {
        flex-shrink: 1;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .country-flag {
        width: 2rem;
        height: auto;
        flex-shrink: 0;
      }

      .ship-kind-icon {
        width: 1.8rem;
        height: 1.8rem;
        flex-shrink: 0;
      }

      .signal-source {
        color: var(--tertiary4, #888);
        font-size: var(--fs-xs, 1.1rem);
        font-weight: var(--fw-normal, 400);
        flex-shrink: 0;
      }
    }

    .vessel-details {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: var(--fs-xs, 1.1rem);
      color: var(--tertiary4, #999);
      margin-top: 0.2rem;

      .ship-kind {
        background: var(--tertiary2, rgba(255, 255, 255, 0.1));
        padding: 0.2rem 0.6rem;
        border-radius: 1rem;
        font-size: var(--fs-xxs, 1rem);
        font-weight: var(--fw-medium, 500);
        color: var(--tertiary4, #ccc);
      }
    }
  }

  .drag-handle {
    flex-shrink: 0;
    color: var(--tertiary4, #666);
    font-size: 1.2rem;
    cursor: grab;
    padding: 0.4rem;

    &:hover {
      color: var(--white, #ccc);
    }
  }

  .drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary1-alpha, rgba(74, 158, 255, 0.1));
    border-radius: 0.6rem;
    pointer-events: none;
  }
}

.vessel-item-placeholder {
  background: var(--tertiary1, rgba(0, 0, 0, 0.1));
  border: 2px dashed var(--tertiary3, #444);
  border-radius: 0.6rem;
  height: 5rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tertiary4, #666);
  font-size: var(--fs-xs, 1.1rem);
}
